|
eXo Kernel :: Container 2.4.11-UXP01 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TenantsContainerContext
Context for TenantsContainer. Prescribes general contract between container and
multitenancy capable components registration/unregistration. Container should use
accept(ComponentAdapter) method during the registration to answer should a some
component be registered in TenantsContainer or not. The same way method
accept(Object) should be used to choose from where to get a component in getters.
Context implementation should apply own "container" for per-tenant managed components and use it
for TenantsContainer methods implementation.
| Method Summary | |
|---|---|
boolean |
accept(org.picocontainer.ComponentAdapter adapter)
Answers if given component should be regarded as per-tenant service and can be registered (and unregistered) in the context. |
boolean |
accept(Object key)
Answers if given component key should be regarded as a key of per-tenant service and can be used to get a component from the context. |
org.picocontainer.ComponentAdapter |
getComponentAdapterOfType(Class<?> key)
Return component adapter regarding the given Class key and Current Tenant. |
List<?> |
getComponentAdaptersOfType(Class<?> componentType)
Return list of component adapters regarding the given Class key and Current Tenant. |
Object |
getComponentInstance(Object componentKey)
Return component instance regarding the given key (String in most cases) and Current Tenant. |
Object |
getComponentInstanceOfType(Class<?> componentType)
Return component instance regarding the given Class key and Current Tenant. |
List<?> |
getComponentInstancesOfType(Class<?> componentType)
Return list of component instances regarding the given Class key and Current Tenant. |
org.picocontainer.ComponentAdapter |
registerComponent(org.picocontainer.ComponentAdapter component)
Register component adapter in the context. |
org.picocontainer.ComponentAdapter |
unregisterComponent(Object componentKey)
Unregister component by key from the context. |
| Method Detail |
|---|
List<?> getComponentAdaptersOfType(Class<?> componentType)
componentType - Class type of a components
List<?> getComponentInstancesOfType(Class<?> componentType)
componentType - Class type of instances
org.picocontainer.ComponentAdapter getComponentAdapterOfType(Class<?> key)
key - Class type of a component
ComponentAdapter of a component or null if nothing found in Current Tenant.Object getComponentInstance(Object componentKey)
key - Object key of a component
null if nothing found in Current Tenant.Object getComponentInstanceOfType(Class<?> componentType)
componentType - Class type of a component
null if nothing found in Current Tenant.boolean accept(org.picocontainer.ComponentAdapter adapter)
registerComponent(ComponentAdapter) and unregisterComponent(Object) methods.
adapter - ComponentAdapter
true if given component should be regarded as per-tenant service,
false otherwise.boolean accept(Object key)
key - Object, it can be a Class otherwise it will be treated as
String.
true if given key should be regarded as a key of
per-tenant component, false otherwise.accept(ComponentAdapter)
org.picocontainer.ComponentAdapter registerComponent(org.picocontainer.ComponentAdapter component)
throws TenantComponentRegistrationException
false,
otherwise will register it into current tenant container and return true. false returned it means that given component should be registered in the
container itself also (for use by Default Tenant).registerComponent(ComponentAdapter) method doesn't check if the given
component is regarding as per-tenant service. To get this answer use
accept(ComponentAdapter) method. TenantComponentRegistrationException will be
thrown.
component - ComponentAdapter
ComponentAdapter, Not null indicates that component was successfully registered,
false tells that component also should be registered in the container.
TenantComponentRegistrationException - if tenant services not ready or Current Tenant
cannot be defined (not set properly in most cases).
org.picocontainer.ComponentAdapter unregisterComponent(Object componentKey)
throws TenantComponentRegistrationException
null, otherwise it will unregister the component from the
context and return its adapter. null returned it means that this component should be unregistered from the
container also. See also registration in registerComponent(ComponentAdapter) for
false result.#unregisterComponent(ComponentAdapter) method doesn't check if the given
component is regarding as per-tenant service. To get this answer use
accept(ComponentAdapter) method. TenantComponentRegistrationException will be
thrown.
componentKey - Object
ComponentAdapter what was registered in the context or null if
component should be unregistered from the
container.
TenantComponentRegistrationException - if tenant services not ready or Current Tenant
cannot be defined (not set properly in most cases).for registration details.
|
eXo Kernel :: Container 2.4.11-UXP01 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||