/** * Obtains all instances of a particular class from a container by navigating up the container * hierachy. * * @param container The container. * @param clazz The class. * @return A list of all instances of <code>clazz</code>, or the empty list if none found. */ public static List getComponentInstancesOfType(PicoContainer container, Class clazz) { List instances = new ArrayList(); while (container != null) { List l = container.getComponentInstancesOfType(clazz); instances.addAll(l); container = container.getParent(); } return instances; }
public List<ParserDelegate> getDelegates() { if (this.delegates == null) { this.delegates = container.getComponentInstancesOfType(ParserDelegate.class); } return this.delegates; } }
public List getComponentInstancesOfType(Class type) throws PicoException { return delegate.getComponentInstancesOfType(type); }
public void visitContainer(PicoContainer pico) { super.visitContainer(pico); componentInstances.addAll(pico.getComponentInstancesOfType(type)); }
/** * Obtains all instances of a particular class from a container by navigating * up the container hierachy. * * @param container The container. * @param clazz The class. * * @return A list of all instances of <code>clazz</code>, or the empty list if none found. */ public static List getComponentInstancesOfType(PicoContainer container, Class clazz) { List instances = new ArrayList(); while (container != null) { List l = container.getComponentInstancesOfType(clazz); instances.addAll(l); container = container.getParent(); } return instances; }
/** * Obtains all instances of a particular class from a container by navigating * up the container hierachy. * * @param container The container. * @param clazz The class. * * @return A list of all instances of <code>clazz</code>, or the empty list if none found. */ public static List getComponentInstancesOfType( PicoContainer container, Class clazz ) { List instances = new ArrayList(); while( container != null ) { List l = container.getComponentInstancesOfType( clazz ); instances.addAll( l ); container = container.getParent(); } return instances; }
/** * Obtains all instances of a particular class from a container by navigating * up the container hierachy. * * @param container The container. * @param clazz The class. * * @return A list of all instances of <code>clazz</code>, or the empty list if none found. */ public static List getComponentInstancesOfType(PicoContainer container, Class clazz) { List instances = new ArrayList(); while (container != null) { List l = container.getComponentInstancesOfType(clazz); instances.addAll(l); container = container.getParent(); } return instances; }
/** * @jmx.managed-operation description = "Destroy this Proxy" impact = "ACTION" */ public final void destroy() { checkDestroyStatus(); container_.dispose(); final List list = container_.getComponentInstancesOfType(IContainer.class); for (Iterator i = list.iterator(); i.hasNext();) { IContainer element = (IContainer) i.next(); element.destroy(); } }