/** * Destroys the naming store. * * @param context The stop context */ public void stop(StopContext context) { if(store != null) { try { store.close(); store = null; } catch (NamingException e) { throw NamingLogger.ROOT_LOGGER.failedToDestroyRootContext(e); } } }
/** * Bind the entry into the injected context. * * @param context The start context * @throws StartException If the entity can not be bound */ public void start(StartContext context) throws StartException { final ServiceBasedNamingStore namingStore = namingStoreValue.getValue(); controller = context.getController(); namingStore.add(controller.getName()); ROOT_LOGGER.tracef("Bound resource %s into naming store %s (service name %s)", name, namingStore, controller.getName()); }
public List<NameClassPair> list(final Name name) throws NamingException { final ServiceName lookupName = buildServiceName(name); final ServiceName floor = boundServices.floor(lookupName); boolean isContextBinding = false; if (floor != null && floor.isParentOf(lookupName)) { Object obj = lookup(name.toString(), floor, true); if (obj instanceof NamingContext) { isContextBinding = true; } else if (obj != null) { throw new RequireResolveException(convert(floor)); final List<ServiceName> children = listChildren(lookupName, isContextBinding); final String[] lookupParts = lookupName.toArray(); final Set<String> childContexts = new HashSet<String>(); childContexts.add(childParts[lookupParts.length]); } else { final Object binding = lookup(name.toString(), child, false); final String bindingType; if (binding instanceof ContextListManagedReferenceFactory) {
return new NamingContext(EMPTY_NAME, this, null); final ServiceName lookupName = buildServiceName(name); Object obj = lookup(name.toString(), lookupName, dereference); if (obj == null) { final ServiceName lower = boundServices.lower(lookupName); if (lower != null && lower.isParentOf(lookupName)) { obj = lookup(name.toString(), lower, dereference); checkReferenceForContinuation(name, obj); return new ResolveResult(obj, suffix(lower, lookupName));
/** * Unbind the entry from the injected context. * * @param context The stop context */ public void stop(StopContext context) { final ServiceBasedNamingStore namingStore = namingStoreValue.getValue(); namingStore.remove(controller.getName()); ROOT_LOGGER.tracef("Unbound resource %s into naming store %s (service name %s)", name, namingStore, context.getController().getName()); }
private void checkReferenceForContinuation(final Name name, final Object object) throws CannotProceedException { if (object instanceof Reference) { if (((Reference) object).get("nns") != null) { throw cannotProceedException(object, name); } } }
@Override public Object lookup(Name name) throws NamingException { return lookup(name, true); }
return new NamingContext(EMPTY_NAME, this, null); final ServiceName lookupName = buildServiceName(name); Object obj = lookup(name.toString(), lookupName, dereference); if (obj == null) { final ServiceName lower = boundServices.lower(lookupName); if (lower != null && lower.isParentOf(lookupName)) { obj = lookup(name.toString(), lower, dereference); checkReferenceForContinuation(name, obj); return new ResolveResult(obj, suffix(lower, lookupName));
/** * Unbind the entry from the injected context. * * @param context The stop context */ public synchronized void stop(StopContext context) { final ServiceBasedNamingStore namingStore = namingStoreValue.getValue(); namingStore.remove(context.getController().getName()); }
private void checkReferenceForContinuation(final Name name, final Object object) throws CannotProceedException { if (object instanceof Reference) { if (((Reference) object).get("nns") != null) { throw cannotProceedException(object, name); } } }
@Override public Object lookup(Name name) throws NamingException { return lookup(name, true); }
public List<Binding> listBindings(final Name name) throws NamingException { final ServiceName lookupName = buildServiceName(name); final ServiceName floor = boundServices.floor(lookupName); boolean isContextBinding = false; if (floor != null && floor.isParentOf(lookupName)) { Object obj = lookup(name.toString(), floor, true); if (obj instanceof NamingContext) { isContextBinding = true; } else if (obj != null) { throw new RequireResolveException(convert(floor)); final List<ServiceName> children = listChildren(lookupName, isContextBinding); final String[] lookupParts = lookupName.toArray(); final Set<String> childContexts = new HashSet<String>(); childContexts.add(childParts[lookupParts.length]); } else { final Object binding = lookup(name.toString(), child, true); results.add(new Binding(childParts[childParts.length - 1], binding));
return new NamingContext(EMPTY_NAME, this, null); final ServiceName lookupName = buildServiceName(name); Object obj = lookup(name.toString(), lookupName, dereference); if (obj == null) { final ServiceName lower = boundServices.lower(lookupName); if (lower != null && lower.isParentOf(lookupName)) { obj = lookup(name.toString(), lower, dereference); checkReferenceForContinuation(name, obj); return new ResolveResult(obj, suffix(lower, lookupName));
/** * Destroys the naming store. * * @param context The stop context */ public synchronized void stop(StopContext context) { try { store.close(); store = null; } catch (NamingException e) { throw MESSAGES.failedToDestroyRootContext(e); } }
/** * Unbind the entry from the injected context. * * @param context The stop context */ public void stop(StopContext context) { final ServiceBasedNamingStore namingStore = namingStoreValue.getValue(); namingStore.remove(controller.getName()); ROOT_LOGGER.tracef("Unbound resource %s into naming store %s (service name %s)", name, namingStore, context.getController().getName()); }
/** * Bind the entry into the injected context. * * @param context The start context * @throws StartException If the entity can not be bound */ public void start(StartContext context) throws StartException { final ServiceBasedNamingStore namingStore = namingStoreValue.getValue(); controller = context.getController(); namingStore.add(controller.getName()); ROOT_LOGGER.tracef("Bound resource %s into naming store %s (service name %s)", name, namingStore, controller.getName()); }
private void checkReferenceForContinuation(final Name name, final Object object) throws CannotProceedException { if (object instanceof Reference) { if (((Reference) object).get("nns") != null) { throw cannotProceedException(object, name); } } }
@Override public Object lookup(Name name) throws NamingException { return lookup(name, true); }
public List<NameClassPair> list(final Name name) throws NamingException { final ServiceName lookupName = buildServiceName(name); final ServiceName floor = boundServices.floor(lookupName); boolean isContextBinding = false; if (floor != null && floor.isParentOf(lookupName)) { Object obj = lookup(name.toString(), floor, true); if (obj instanceof NamingContext) { isContextBinding = true; } else if (obj != null) { throw new RequireResolveException(convert(floor)); final List<ServiceName> children = listChildren(lookupName, isContextBinding); final String[] lookupParts = lookupName.toArray(); final Set<String> childContexts = new HashSet<String>(); childContexts.add(childParts[lookupParts.length]); } else { final Object binding = lookup(name.toString(), child, false); final String bindingType; if (binding instanceof ContextListManagedReferenceFactory) {
return new NamingContext(EMPTY_NAME, this, null); final ServiceName lookupName = buildServiceName(name); Object obj = lookup(name.toString(), lookupName, dereference); if (obj == null) { final ServiceName lower = boundServices.lower(lookupName); if (lower != null && lower.isParentOf(lookupName)) { obj = lookup(name.toString(), lower, dereference); checkReferenceForContinuation(name, obj); return new ResolveResult(obj, suffix(lower, lookupName));