Class ConcurrentContainerMT

  • All Implemented Interfaces:
    Serializable, org.exoplatform.container.spi.Container, org.exoplatform.container.spi.Interceptor, org.picocontainer.Disposable, org.picocontainer.Startable

    public class ConcurrentContainerMT
    extends org.exoplatform.container.ConcurrentContainer
    Version:
    $Id$
    Author:
    Nicolas Filotto
    See Also:
    Serialized Form
    • Field Detail

      • THREAD_POOL_SIZE_PARAM_NAME

        public static final String THREAD_POOL_SIZE_PARAM_NAME
        The name of the system parameter to indicate the total amount of threads to use for the kernel
        See Also:
        Constant Field Values
    • Constructor Detail

      • ConcurrentContainerMT

        public ConcurrentContainerMT()
        Creates a new container with the default ComponentAdapterFactory and a parent container.
      • ConcurrentContainerMT

        public ConcurrentContainerMT​(org.exoplatform.container.ExoContainer holder,
                                     org.exoplatform.container.ExoContainer parent)
        Creates a new container with the default ComponentAdapterFactory and a parent container.
        Parameters:
        holder - the holder of the container
        parent - the parent container (used for component dependency lookups).
    • Method Detail

      • initialize

        public void initialize()
        Specified by:
        initialize in interface org.exoplatform.container.spi.Container
        Overrides:
        initialize in class org.exoplatform.container.ConcurrentContainer
      • getDefaultComponentAdapterFactory

        protected org.exoplatform.container.spi.ComponentAdapterFactory getDefaultComponentAdapterFactory()
        Overrides:
        getDefaultComponentAdapterFactory in class org.exoplatform.container.ConcurrentContainer
      • getComponentInstanceFromContext

        protected <T> T getComponentInstanceFromContext​(org.exoplatform.container.spi.ComponentAdapter<T> componentAdapter,
                                                        Class<T> bindType)
        Overrides:
        getComponentInstanceFromContext in class org.exoplatform.container.ConcurrentContainer
      • getComponentFromSharedMemory

        public <T> T getComponentFromSharedMemory​(Object key)
        Gives a value from the shared memory
      • addComponentToCtx

        public <T> org.exoplatform.container.ConcurrentContainer.CreationalContextComponentAdapter<T> addComponentToCtx​(Object key)
        Overrides:
        addComponentToCtx in class org.exoplatform.container.ConcurrentContainer
      • removeComponentFromCtx

        public void removeComponentFromCtx​(Object key)
        Overrides:
        removeComponentFromCtx in class org.exoplatform.container.ConcurrentContainer
      • getComponentInstancesOfType

        public <T> List<T> getComponentInstancesOfType​(Class<T> componentType)
                                                throws org.exoplatform.container.spi.ContainerException
        A multi-threaded implementation of the start method
        Specified by:
        getComponentInstancesOfType in interface org.exoplatform.container.spi.Container
        Overrides:
        getComponentInstancesOfType in class org.exoplatform.container.ConcurrentContainer
        Throws:
        org.exoplatform.container.spi.ContainerException
      • start

        public void start()
        A multi-threaded implementation of the start method
        Specified by:
        start in interface org.picocontainer.Startable
        Overrides:
        start in class org.exoplatform.container.ConcurrentContainer
      • start

        protected void start​(Collection<org.exoplatform.container.spi.ComponentAdapter<?>> adapters,
                             Map<org.exoplatform.container.spi.ComponentAdapter<?>,​Object> alreadyStarted,
                             Set<org.exoplatform.container.spi.ComponentAdapter<?>> startInProgress,
                             AtomicReference<Exception> error,
                             boolean skippable)
        Starts all the provided adapters
      • initializeComponent

        public <T> boolean initializeComponent​(Class<T> targetClass,
                                               List<Dependency> dependencies,
                                               List<ComponentTask<Void>> componentInitTasks,
                                               DependencyStackListener caller)
        Initializes the instance by injecting objects into fields and the methods with the annotation Inject
        Returns:
        true if at least Inject annotation has been found, false otherwise
      • createComponent

        public <T> T createComponent​(Class<T> clazz)
                              throws Exception
        Overrides:
        createComponent in class org.exoplatform.container.ConcurrentContainer
        Throws:
        Exception
      • createComponent

        public <T> T createComponent​(Class<T> clazz,
                                     org.exoplatform.container.xml.InitParams params)
                              throws Exception
        Specified by:
        createComponent in interface org.exoplatform.container.spi.Container
        Overrides:
        createComponent in class org.exoplatform.container.ConcurrentContainer
        Throws:
        Exception
      • loadArguments

        public void loadArguments​(Object[] args)
      • getComponentTaskContext

        public ComponentTaskContext getComponentTaskContext()
        Gives the current context
      • setComponentTaskContext

        public void setComponentTaskContext​(ComponentTaskContext ctx)
        Set the current context
      • execute

        protected <T> T execute​(ComponentTask<T> task,
                                org.exoplatform.container.ConcurrentContainer.CreationalContextComponentAdapter<?> cCtx)
                         throws Exception
        Throws:
        Exception
      • getArguments

        public <T> Object[] getArguments​(Constructor<T> constructor,
                                         org.exoplatform.container.xml.InitParams params,
                                         List<Dependency> dependencies)
      • getId

        public String getId()
        Specified by:
        getId in interface org.exoplatform.container.spi.Interceptor
        Overrides:
        getId in class org.exoplatform.container.AbstractInterceptor
      • onStartupComplete

        public void onStartupComplete()