eXo Kernel :: Container 2.4.11-UXP01

org.exoplatform.container
Class TenantsContainer

java.lang.Object
  extended by org.exoplatform.container.ConcurrentPicoContainer
      extended by org.exoplatform.container.mc.MCIntegrationContainer
          extended by org.exoplatform.container.CachingContainer
              extended by org.exoplatform.container.TenantsContainer
All Implemented Interfaces:
Serializable, org.picocontainer.Disposable, org.picocontainer.MutablePicoContainer, org.picocontainer.PicoContainer, org.picocontainer.Startable
Direct Known Subclasses:
ManageableContainer

public class TenantsContainer
extends CachingContainer

TenantsContainer separate generally used components from ones what should be instantiated, started and stopped on per-tenant basis.
It overrides component getters, registerComponent(ComponentAdapter) and unregisterComponent(Object) methods to get components taking in account Current Tenant context.
The Current Tenant context it's an abstraction what will be set by actual Multitenancy implementation (for versions currently in production it's based on JCR Current Repository, but this should be transparent for Kernel level and implementation can be changed in future).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.exoplatform.container.ConcurrentPicoContainer
ConcurrentPicoContainer.ContainerVisitor
 
Field Summary
protected  TenantsContainerContext tenantsContainerContext
           
 
Fields inherited from class org.exoplatform.container.ConcurrentPicoContainer
componentAdapterFactory
 
Constructor Summary
TenantsContainer()
           
TenantsContainer(org.picocontainer.defaults.ComponentAdapterFactory componentAdapterFactory)
           
TenantsContainer(org.picocontainer.defaults.ComponentAdapterFactory componentAdapterFactory, org.picocontainer.PicoContainer parent)
           
TenantsContainer(org.picocontainer.PicoContainer parent)
           
 
Method Summary
 org.picocontainer.ComponentAdapter getComponentAdapterOfType(Class componentType)
          
 List getComponentAdaptersOfType(Class componentType)
          
 Object getComponentInstance(Object componentKey)
          
 Object getComponentInstanceOfType(Class componentType)
          If no ComponentAdapter can be found it returns null otherwise it first try to get it from the dependency resolution context if it still cannot be found we get the instance from the ComponentAdapter.
 List getComponentInstancesOfType(Class componentType)
          
 org.picocontainer.ComponentAdapter registerComponent(org.picocontainer.ComponentAdapter componentAdapter)
          Method interception that swaps the original component adapter for intercepting one for components that require mc integration.
 org.picocontainer.ComponentAdapter unregisterComponent(Object componentKey)
          
 
Methods inherited from class org.exoplatform.container.CachingContainer
registerComponentImplementation, registerComponentImplementation, registerComponentImplementation, registerComponentImplementation, registerComponentInstance, registerComponentInstance
 
Methods inherited from class org.exoplatform.container.mc.MCIntegrationContainer
hasMCKernel
 
Methods inherited from class org.exoplatform.container.ConcurrentPicoContainer
accept, accept, addChildContainer, addComponentToCtx, canBeDisposed, canBeStarted, canBeStopped, dispose, getComponentAdapter, getComponentAdapters, getComponentInstances, getParent, makeChildContainer, removeChildContainer, removeComponentFromCtx, start, stop, unregisterComponentByInstance, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tenantsContainerContext

protected TenantsContainerContext tenantsContainerContext
Constructor Detail

TenantsContainer

public TenantsContainer(org.picocontainer.defaults.ComponentAdapterFactory componentAdapterFactory,
                        org.picocontainer.PicoContainer parent)

TenantsContainer

public TenantsContainer(org.picocontainer.PicoContainer parent)

TenantsContainer

public TenantsContainer(org.picocontainer.defaults.ComponentAdapterFactory componentAdapterFactory)

TenantsContainer

public TenantsContainer()
Method Detail

getComponentAdapterOfType

public org.picocontainer.ComponentAdapter getComponentAdapterOfType(Class componentType)

Specified by:
getComponentAdapterOfType in interface org.picocontainer.PicoContainer
Overrides:
getComponentAdapterOfType in class CachingContainer

getComponentInstance

public Object getComponentInstance(Object componentKey)
                            throws org.picocontainer.PicoException

Specified by:
getComponentInstance in interface org.picocontainer.PicoContainer
Overrides:
getComponentInstance in class CachingContainer
Throws:
org.picocontainer.PicoException

getComponentAdaptersOfType

public List getComponentAdaptersOfType(Class componentType)

Specified by:
getComponentAdaptersOfType in interface org.picocontainer.PicoContainer
Overrides:
getComponentAdaptersOfType in class CachingContainer

getComponentInstancesOfType

public List getComponentInstancesOfType(Class componentType)
                                 throws org.picocontainer.PicoException

Specified by:
getComponentInstancesOfType in interface org.picocontainer.PicoContainer
Overrides:
getComponentInstancesOfType in class CachingContainer
Throws:
org.picocontainer.PicoException

getComponentInstanceOfType

public Object getComponentInstanceOfType(Class componentType)
If no ComponentAdapter can be found it returns null otherwise it first try to get it from the dependency resolution context if it still cannot be found we get the instance from the ComponentAdapter.

Specified by:
getComponentInstanceOfType in interface org.picocontainer.PicoContainer
Overrides:
getComponentInstanceOfType in class CachingContainer
See Also:
PicoContainer.getComponentInstanceOfType(java.lang.Class)

registerComponent

public org.picocontainer.ComponentAdapter registerComponent(org.picocontainer.ComponentAdapter componentAdapter)
                                                     throws org.picocontainer.defaults.DuplicateComponentKeyRegistrationException
Method interception that swaps the original component adapter for intercepting one for components that require mc integration. If mc integration isn't available in the current runtime environment, then interception simply delegates to parent without interfering.

Specified by:
registerComponent in interface org.picocontainer.MutablePicoContainer
Overrides:
registerComponent in class CachingContainer
Parameters:
componentAdapter - original component adapter
Returns:
the original component adapter, or the intercepting component adapter that takes care of mc integration
Throws:
org.picocontainer.defaults.DuplicateComponentKeyRegistrationException

unregisterComponent

public org.picocontainer.ComponentAdapter unregisterComponent(Object componentKey)

Specified by:
unregisterComponent in interface org.picocontainer.MutablePicoContainer
Overrides:
unregisterComponent in class CachingContainer

eXo Kernel :: Container 2.4.11-UXP01

Copyright © 2014 eXo Platform SAS. All Rights Reserved.