@Override public <T> List<T> getComponentsByType(Class<T> tClass) { return pico.getComponents(tClass); }
void initializeEagerComponents() { if(initializeComponentsEagerly){ container.getComponents(); } }
@Override public <T> List<T> getComponents(final Class<T> componentType) { return delegatePicoContainer.getComponents(componentType); }
@Override public List<Object> getComponents() { return delegatePicoContainer.getComponents(); }
public <T> List<T> getComponentsByType(Class<T> tClass) { return pico.getComponents(tClass); }
@Override public <T> List<T> getComponentsByType(Class<T> tClass) { return pico.getComponents(tClass); }
public static <T> List<T> getComponents(java.lang.Class<T> tClass) { return cache.getComponents(tClass); }
@SuppressWarnings({ "unchecked" }) public Collection values() { return Collections.unmodifiableCollection(mutablePicoContainer.getComponents()); }
/** * {@inheritDoc} * * @return * * @see org.picocontainer.PicoContainer#getComponents() */ public List getComponents() { if (logger.isDebugEnabled()) { logger.debug("Retrieving all component instances for container " + delegate); } return delegate.getComponents(); }
public static <T> T getComponent(java.lang.Class<T> tClass, String className) { final List<T> list = cache.getComponents(tClass); for (T component : list) { if (component.getClass().getName().endsWith(className)) { return component; } } return null; }
/** * {@inheritDoc} * * @return * * @see org.picocontainer.PicoContainer#getComponents() */ public List getComponents() { if (log.isDebugEnabled()) { log.debug("Retrieving all component instances for container " + delegate); } return delegate.getComponents(); }
protected <T> List<T> getComponents(Class<T> ofClass){ checkIfBuilt(); return container.getComponents(ofClass); }
/** * {@inheritDoc} * * @param componentType * * @return * * @see org.picocontainer.PicoContainer#getComponents(java.lang.Class) */ public <T> List<T> getComponents(final Class<T> componentType) { if (logger.isDebugEnabled()) { logger.debug("Loading all component instances of type " + componentType + " for container " + delegate); } List<T> result = delegate.getComponents(componentType); if (result == null || result.isEmpty()) { if (logger.isInfoEnabled()) { logger.info("Could not find any components " + " in container or parent container."); } } return result; }
/** * {@inheritDoc} * * @param componentType * * @return * * @see org.picocontainer.PicoContainer#getComponents(java.lang.Class) */ public <T> List<T> getComponents(final Class<T> componentType) { if (log.isDebugEnabled()) { log.debug("Loading all component instances of type " + componentType + " for container " + delegate); } List<T> result = delegate.getComponents(componentType); if (result == null || result.isEmpty()) { if (log.isInfoEnabled()) { log.info("Could not find any components " + " in container or parent container."); } } return result; }
public Instrumenter createInstrumenter() throws EngineException { final List<Instrumenter> instrumenters = new ArrayList<Instrumenter>(); for (ScriptEngineService service : m_container.getComponents(ScriptEngineService.class)) { for (Instrumenter instrumenter : service.createInstrumenters()) { instrumenters.add(instrumenter); } } return new MasterInstrumenter(instrumenters); } }
public ScriptEngine getScriptEngine(ScriptLocation script) throws EngineException { for (ScriptEngineService service : m_container.getComponents(ScriptEngineService.class)) { final ScriptEngine engine = service.createScriptEngine(script); if (engine != null) { return engine; } } throw new EngineException("No suitable script engine installed for '" + script + "'"); }
public final void start(ServletContext context) { ComponentRegistry componentRegistry = getComponentRegistry(); registerBundledComponents(componentRegistry); this.picoContainer.addComponent(context); BasicConfiguration config = new BasicConfiguration(context); // using the new vraptor.scan WebAppBootstrap webAppBootstrap = new WebAppBootstrapFactory().create(config); webAppBootstrap.configure(componentRegistry); // call old-style custom components registration registerCustomComponents(componentRegistry); // start the container getComponentRegistry().init(); picoContainer.start(); registerCacheComponents(); // call all handlers for registered components Collection<Class<?>> components = getComponentRegistry().getAllRegisteredApplicationScopedComponents(); List<StereotypeHandler> handlers = picoContainer.getComponents(StereotypeHandler.class); for (Class<?> type : components) { for (StereotypeHandler handler : handlers) { if (type.isAnnotationPresent(handler.stereotype())) { handler.handle(type); } } } }