public class TenantsServiceImpl extends Object implements TenantsService, ThreadContextHolder
TenantsService based on plugins. Following kinds of plugin supported: | Modifier and Type | Field and Description |
|---|---|
protected static Log |
LOG |
protected List<CurrentTenantLookup> |
lookups
List of registered
CurrentTenantLookup implementations. |
protected List<TenantStateObserver> |
observers
List of registered
TenantStateObserver implementations. |
MANAGE_THREAD_LOCAL| Constructor and Description |
|---|
TenantsServiceImpl()
Constructor without dependencies.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(TenantsStateListener listener)
Add listener for Tenant events in Multitenancy sub-system.
|
void |
addPlugin(ComponentPlugin plugin)
Register component plugin.
|
Tenant |
getCurrentTenant()
Return Current Tenant or throws an exception if Current Tenant not set in current thread.
|
ThreadContext |
getThreadContext()
Gives the value corresponding to the context of the thread
|
boolean |
hasCurrentTenant()
Answers if Current Tenant is set in current thread.
|
void |
removeListener(TenantsStateListener listener)
Remove Tenant events listener from Multitenancy sub-system.
|
protected static final Log LOG
protected final List<CurrentTenantLookup> lookups
CurrentTenantLookup implementations.protected final List<TenantStateObserver> observers
TenantStateObserver implementations.public void addPlugin(ComponentPlugin plugin)
plugin - ComponentPluginpublic void addListener(TenantsStateListener listener)
TenantsService.removeListener(TenantsStateListener) method.addListener in interface TenantsServicelistener - TenantsStateListenerpublic void removeListener(TenantsStateListener listener)
removeListener in interface TenantsServicelistener - TenantsStateListenerpublic Tenant getCurrentTenant() throws CurrentTenantNotSetException
getCurrentTenant in interface TenantsServiceTenant Current Tenant descriptor.CurrentTenantNotSetException - if Current Tenant not found or not set.public boolean hasCurrentTenant()
TenantsService.getCurrentTenant() for details.hasCurrentTenant in interface TenantsServicetrue if current tenant is set in current thread, false otherwise.TenantsService.getCurrentTenant()public ThreadContext getThreadContext()
getThreadContext in interface ThreadContextHolderThreadContext if there are some
valuable ThreadLocal variables to share otherwise null
is expectedCopyright © 2015 eXo Platform SAS. All Rights Reserved.