private List<ActiveDescriptor<?>> getDescriptors(final String cname) throws ClassNotFoundException { return serviceLocator.getDescriptors(new Filter() { @Override public boolean matches(Descriptor d) { return d.getImplementation().equals(cname); } }); } }
@Override public List<ActiveDescriptor<?>> getDescriptors(Filter filter) { return delegate.getDescriptors(filter); }
@Override public List<ActiveDescriptor<?>> getDescriptors(Filter filter) { return delegate.getDescriptors(filter); }
habitat.getDescriptors(BuilderHelper.createContractFilter(GenericContainer.class.getName())), habitat.getService(GenericContainer.class)); assertNull("GenericConfig descriptor test still has " + habitat.getDescriptors(BuilderHelper.createContractFilter(GenericConfig.class.getName())), habitat.getService(GenericConfig.class, "test")); assertNull("GenericConfig descriptor still has " + habitat.getDescriptors(BuilderHelper.createContractFilter(GenericConfig.class.getName())), habitat.getService(GenericConfig.class));
private List<ActiveDescriptor<?>> getImmediateServices() { List<ActiveDescriptor<?>> inScopeAndInThisLocator; try { inScopeAndInThisLocator = locator.getDescriptors(validationFilter); } catch (IllegalStateException ise) { // locator has been shutdown inScopeAndInThisLocator = Collections.emptyList(); } return inScopeAndInThisLocator; }
private List<ActiveDescriptor<?>> getImmediateServices() { List<ActiveDescriptor<?>> inScopeAndInThisLocator; try { inScopeAndInThisLocator = locator.getDescriptors(validationFilter); } catch (IllegalStateException ise) { // locator has been shutdown inScopeAndInThisLocator = Collections.emptyList(); } return inScopeAndInThisLocator; }
private List<ActiveDescriptor<?>> getImmediateServices() { List<ActiveDescriptor<?>> inScopeAndInThisLocator; try { inScopeAndInThisLocator = locator.getDescriptors(validationFilter); } catch (IllegalStateException ise) { // locator has been shutdown inScopeAndInThisLocator = Collections.emptyList(); } return inScopeAndInThisLocator; }
private List<ActiveDescriptor<?>> getImmediateServices() { List<ActiveDescriptor<?>> inScopeAndInThisLocator; try { inScopeAndInThisLocator = locator.getDescriptors(validationFilter); } catch (IllegalStateException ise) { // locator has been shutdown inScopeAndInThisLocator = Collections.emptyList(); } return inScopeAndInThisLocator; }
private List<ActiveDescriptor<?>> getImmediateServices() { List<ActiveDescriptor<?>> inScopeAndInThisLocator; try { inScopeAndInThisLocator = locator.getDescriptors(immediateContext.getValidationFilter()); } catch (IllegalStateException ise) { // locator has been shutdown inScopeAndInThisLocator = Collections.emptyList(); } return inScopeAndInThisLocator; }
private List<ActiveDescriptor<?>> getImmediateServices() { List<ActiveDescriptor<?>> inScopeAndInThisLocator; try { inScopeAndInThisLocator = locator.getDescriptors(immediateContext.getValidationFilter()); } catch (IllegalStateException ise) { // locator has been shutdown inScopeAndInThisLocator = Collections.emptyList(); } return inScopeAndInThisLocator; }
private List<ActiveDescriptor<?>> getImmediateServices() { List<ActiveDescriptor<?>> inScopeAndInThisLocator; try { inScopeAndInThisLocator = locator.getDescriptors(immediateContext.getValidationFilter()); } catch (IllegalStateException ise) { // locator has been shutdown inScopeAndInThisLocator = Collections.emptyList(); } return inScopeAndInThisLocator; }
private List<ActiveDescriptor<?>> getImmediateServices() { List<ActiveDescriptor<?>> inScopeAndInThisLocator; try { inScopeAndInThisLocator = locator.getDescriptors(immediateContext.getValidationFilter()); } catch (IllegalStateException ise) { // locator has been shutdown inScopeAndInThisLocator = Collections.emptyList(); } return inScopeAndInThisLocator; }
/** * Dumps all descriptors in this ServiceLocator to the given PrintStream * * @param locator The non-null locator to dump * @param output The non-null PrintStream to print the descriptors to */ public static void dumpAllDescriptors(ServiceLocator locator, PrintStream output) { if (locator == null || output == null) throw new IllegalArgumentException(); List<ActiveDescriptor<?>> all = locator.getDescriptors(BuilderHelper.allFilter()); for (ActiveDescriptor<?> d : all) { output.println(d.toString()); } }
/** * Dumps all descriptors in this ServiceLocator to the given PrintStream * * @param locator The non-null locator to dump * @param output The non-null PrintStream to print the descriptors to */ public static void dumpAllDescriptors(ServiceLocator locator, PrintStream output) { if (locator == null || output == null) throw new IllegalArgumentException(); List<ActiveDescriptor<?>> all = locator.getDescriptors(BuilderHelper.allFilter()); for (ActiveDescriptor<?> d : all) { output.println(d.toString()); } }
/** * Dumps all descriptors in this ServiceLocator to the given PrintStream * * @param locator The non-null locator to dump * @param output The non-null PrintStream to print the descriptors to */ public static void dumpAllDescriptors(ServiceLocator locator, PrintStream output) { if (locator == null || output == null) throw new IllegalArgumentException(); List<ActiveDescriptor<?>> all = locator.getDescriptors(BuilderHelper.allFilter()); for (ActiveDescriptor<?> d : all) { output.println(d.toString()); } }
/** * Dumps all descriptors in this ServiceLocator to the given PrintStream * * @param locator The non-null locator to dump * @param output The non-null PrintStream to print the descriptors to */ public static void dumpAllDescriptors(ServiceLocator locator, PrintStream output) { if (locator == null || output == null) throw new IllegalArgumentException(); List<ActiveDescriptor<?>> all = locator.getDescriptors(BuilderHelper.allFilter()); for (ActiveDescriptor<?> d : all) { output.println(d.toString()); } }
public ServiceInitializerFilter(final ServiceInitializerListener listener, final ServiceLocator habitat, final Logger logger) { this.locator = habitat; initializerImplList = habitat.getDescriptors(BuilderHelper.createContractFilter(LazyServiceInitializer.class.getName())); if (initializerImplList.isEmpty()) { throw new IllegalStateException("NO Lazy Initializer was found for port = " + listener.getPort()); } this.logger = logger; this.listener = listener; }
private void dumpContracts(StringBuilder sb) { // Probably not very efficient but it is not a factor for this rarely-used // user-called command... sb.append("\n*********** Sorted List of all Registered Contracts in the Habitat **************\n"); List<ActiveDescriptor<?>> allDescriptors = serviceLocator.getDescriptors(BuilderHelper.allFilter()); SortedSet<String> allContracts = new TreeSet<String>(); for (ActiveDescriptor<?> aDescriptor : allDescriptors) { allContracts.addAll(aDescriptor.getAdvertisedContracts()); } // now the contracts are sorted... Iterator<String> it = allContracts.iterator(); for (int i = 1; it.hasNext(); i++) { sb.append("Contract-" + i + ": " + it.next() + "\n"); } }
private void dumpTypes(StringBuilder sb) { sb.append("\n\n*********** Sorted List of all Types in the Habitat **************\n\n"); List<ActiveDescriptor<?>> allDescriptors = serviceLocator.getDescriptors(BuilderHelper.allFilter()); HashSet<String> allTypes = new HashSet<String>(); for (ActiveDescriptor<?> aDescriptor : allDescriptors) { allTypes.add(aDescriptor.getImplementation()); } Iterator<String> it = allTypes.iterator(); if (it == null) //PP (paranoid programmer) return; SortedSet<String> types = new TreeSet<String>(); while (it.hasNext()) { types.add(it.next()); } // now the types are sorted... it = types.iterator(); for (int i = 1; it.hasNext(); i++) { sb.append("Type-" + i + ": " + it.next() + "\n"); } }
/** * Given a command name, return the name of the class that implements * that command in the server. */ private static String getCommandClass(String cmdName) { ServiceLocator h = getManHabitat(); String cname = "org.glassfish.api.admin.AdminCommand"; for (ActiveDescriptor<?> ad : h.getDescriptors(BuilderHelper.createContractFilter(cname))) { if (ad.getName() != null && ad.getName().equals(cmdName)) { return ad.getImplementation(); } } return null; }