@Test public void testContainers() throws Exception { final URL rootURL = getClass().getResource("test-exo-container.xml"); final URL portalURL = getClass().getResource("test-exo-container.xml"); assertNotNull(rootURL); assertNotNull(portalURL); new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).profiledBy("testContainers").build(); ExoContainer container = PortalContainer.getInstance(); CCTC1 c1 = (CCTC1)container.getComponentInstanceOfType(CCTC1.class); assertNotNull(c1); assertNotNull(c1.container); assertNotNull(c1.c2); assertNotNull(c1.c2.container); assertNotNull(c1.c3); assertNotNull(c1.c3.container); assertSame(c1.container, c1.c2.container); assertSame(c1.container, c1.c3.container); assertSame(container, c1.container); }
public <T> T getComponentInstanceOfType(Class<T> componentType) { return getComponentInstanceOfType(componentType, true); }
ExoContainer extends AbstractContainer { public <T> T getComponentInstanceOfType(Class<T> componentType) { return getComponentInstanceOfType(componentType, true); } }
ExoContainer extends AbstractContainer { public <T> T getComponentInstanceOfType(Class<T> componentType) { return getComponentInstanceOfType(componentType, true); } ExoContainer();  ExoContainer(ExoContainer parent); }
ExoContainer extends AbstractContainer { public <T> T getComponentInstanceOfType(Class<T> componentType) { return getComponentInstanceOfType(componentType, true); } ExoContainer();  ExoContainer(ExoContainer parent); static Set<String> getProfilesFromProperty(); static Set<String> getProfiles(); static boolean hasProfileInProperty(String profileName); static boolean hasProfile(String profileName); ExoContainerContext getContext(); synchronized void dispose(); synchronized void start(boolean init); synchronized void initialize(); synchronized void start(); synchronized void stop(); void addComponentLifecylePlugin(ComponentLifecyclePlugin plugin); void addContainerLifecylePlugin(ContainerLifecyclePlugin plugin); ComponentAdapter<T> registerComponentImplementation(Class<T> componentImplementation); ComponentAdapter<T> registerComponentInstance(T componentInstance); T createComponent(Class<T> clazz); ComponentAdapter<?> getComponentAdapter(Object componentKey); Object getComponentInstance(Object componentKey); @Managed @ManagedName("RegisteredComponentNames") @ManagedDescription("Return the list of the registered component names") Set<String> getRegisteredComponentNames(); ExoContainer getParent(); boolean canBeStarted(); boolean canBeStopped(); boolean canBeDisposed(); ContextManager getContextManager(); boolean isContextManagerLoaded(); T getComponentInstanceOfType(Class<T> componentType); T getComponentInstanceOfType(Class<T> componentType, boolean autoRegistration); ComponentAdapter<T> getComponentAdapterOfType(Class<T> componentType); ComponentAdapter<T> getComponentAdapterOfType(Class<T> componentType, boolean autoRegistration); T getComponentInstance(Object componentKey, Class<T> bindType); T getComponentInstance(Object componentKey, Class<T> bindType, boolean autoRegistration); ComponentAdapter<T> getComponentAdapter(Object componentKey, Class<T> bindType); ComponentAdapter<T> getComponentAdapter(Object componentKey, Class<T> bindType, boolean autoRegistration); }
ExoContainer extends AbstractContainer { public <T> T getComponentInstanceOfType(Class<T> componentType) { return getComponentInstanceOfType(componentType, true); } ExoContainer();  ExoContainer(ExoContainer parent); static Set<String> getProfilesFromProperty(); static Set<String> getProfiles(); static boolean hasProfileInProperty(String profileName); static boolean hasProfile(String profileName); ExoContainerContext getContext(); synchronized void dispose(); synchronized void start(boolean init); synchronized void initialize(); synchronized void start(); synchronized void stop(); void addComponentLifecylePlugin(ComponentLifecyclePlugin plugin); void addContainerLifecylePlugin(ContainerLifecyclePlugin plugin); ComponentAdapter<T> registerComponentImplementation(Class<T> componentImplementation); ComponentAdapter<T> registerComponentInstance(T componentInstance); T createComponent(Class<T> clazz); ComponentAdapter<?> getComponentAdapter(Object componentKey); Object getComponentInstance(Object componentKey); @Managed @ManagedName("RegisteredComponentNames") @ManagedDescription("Return the list of the registered component names") Set<String> getRegisteredComponentNames(); ExoContainer getParent(); boolean canBeStarted(); boolean canBeStopped(); boolean canBeDisposed(); ContextManager getContextManager(); boolean isContextManagerLoaded(); T getComponentInstanceOfType(Class<T> componentType); T getComponentInstanceOfType(Class<T> componentType, boolean autoRegistration); ComponentAdapter<T> getComponentAdapterOfType(Class<T> componentType); ComponentAdapter<T> getComponentAdapterOfType(Class<T> componentType, boolean autoRegistration); T getComponentInstance(Object componentKey, Class<T> bindType); T getComponentInstance(Object componentKey, Class<T> bindType, boolean autoRegistration); ComponentAdapter<T> getComponentAdapter(Object componentKey, Class<T> bindType); ComponentAdapter<T> getComponentAdapter(Object componentKey, Class<T> bindType, boolean autoRegistration);  }