Class ConcurrentContainerMT

java.lang.Object
org.exoplatform.container.AbstractContainer
org.exoplatform.container.AbstractInterceptor
org.exoplatform.container.ConcurrentContainer
org.exoplatform.container.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:
  • Field Details

    • 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:
  • Constructor Details

    • 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 Details

    • 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
    • getConstructor

      public <T> Constructor<T> getConstructor(Class<T> clazz, List<Dependency> dependencies) throws Exception
      Throws:
      Exception
    • 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
    • createComponentTask

      public <T> ComponentTask<T> createComponentTask(Constructor<T> constructor, org.exoplatform.container.xml.InitParams params, List<Dependency> dependencies, DependencyStackListener caller) throws Exception
      Throws:
      Exception
    • loadArguments

      public void loadArguments(Object[] args)
    • loadDependencies

      public void loadDependencies(Object originalComponentKey, ComponentTaskContext ctx, Collection<Dependency> dependencies, ComponentTaskType type) throws Exception
      Throws:
      Exception
    • 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()