|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.carbon.context.internal.CarbonContextDataHolder
public final class CarbonContextDataHolder
This class will preserve an instance the current CarbonContext as a thread local variable. If a CarbonContext is available on a global-scope (i.e. HTTP Session or AxisConfiguration) this class will do the required lookup and obtain the corresponding instance.
The CarbonContext provides the API for sub-tenant/super-tenant programming around WSO2 Carbon and WSO2 Stratos.
| Field Summary | |
|---|---|
protected org.wso2.carbon.registry.api.Registry |
configSystemRegistry
The name of the property that stores a reference to the configuration registry instance of the current tenant, as visible to the system. |
protected org.wso2.carbon.registry.api.Registry |
configUserRegistry
The name of the property that stores a reference to the configuration registry instance of the current tenant, as visible to a user. |
protected org.wso2.carbon.registry.api.Registry |
governanceSystemRegistry
The name of the property that stores a reference to the governance registry instance of the current tenant, as visible to the system. |
protected org.wso2.carbon.registry.api.Registry |
governanceUserRegistry
The name of the property that stores a reference to the governance registry instance of the current tenant, as visible to a user. |
protected org.wso2.carbon.registry.api.Registry |
localRepository
The name of the property that stores a reference to the local repository instance of the current tenant. |
protected org.wso2.carbon.user.api.UserRealm |
userRealm
The name of the property that stores a reference to the UserRealm instance of the current tenant, as visible to a user. |
| Constructor Summary | |
|---|---|
CarbonContextDataHolder(CarbonContextDataHolder carbonContextHolder)
Constructor that can be used to create clones. |
|
| Method Summary | |
|---|---|
static void |
destroyCurrentCarbonContextHolder()
This method will destroy the current CarbonContext holder. |
void |
endTenantFlow()
This will end the tenant flow and restore the previous CarbonContext. |
String |
getApplicationName()
|
org.wso2.carbon.registry.api.Registry |
getConfigSystemRegistry()
|
org.wso2.carbon.registry.api.Registry |
getConfigUserRegistry()
|
static CarbonContextDataHolder |
getCurrentCarbonContextHolderBase()
Method to obtain the current carbon context holder's base. |
static org.wso2.carbon.base.DiscoveryService |
getDiscoveryServiceProvider()
Method to obtain an instance to the Discovery Service. |
org.wso2.carbon.registry.api.Registry |
getGovernanceSystemRegistry()
|
org.wso2.carbon.registry.api.Registry |
getGovernanceUserRegistry()
|
org.wso2.carbon.registry.api.Registry |
getLocalRepository()
|
Object |
getProperty(String name)
Method to obtain a property on this CarbonContext instance. |
String |
getTenantDomain()
Method to obtain the tenant domain on this CarbonContext instance. |
int |
getTenantId()
Method to obtain the tenant id on this CarbonContext instance. |
static CarbonContextDataHolder |
getThreadLocalCarbonContextHolder()
This method will always attempt to obtain an instance of the current CarbonContext from the thread-local copy. |
String |
getUsername()
Method to obtain the username on this CarbonContext instance. |
org.wso2.carbon.user.api.UserRealm |
getUserRealm()
|
static void |
registerUnloadTenantTask(org.wso2.carbon.base.UnloadTenantTask unloadTenantTask)
Method to register a task that will be executed when a tenant is unloaded. |
void |
removeQueueManager()
This method will remove the current multi-tenant queue manager instance. |
void |
setApplicationName(String applicationName)
|
void |
setConfigSystemRegistry(org.wso2.carbon.registry.api.Registry configSystemRegistry)
|
void |
setConfigUserRegistry(org.wso2.carbon.registry.api.Registry configUserRegistry)
|
static void |
setDiscoveryServiceProvider(org.wso2.carbon.base.DiscoveryService discoveryServiceProvider)
Method to define the instance of the Discovery Service. |
void |
setGovernanceSystemRegistry(org.wso2.carbon.registry.api.Registry governanceSystemRegistry)
|
void |
setGovernanceUserRegistry(org.wso2.carbon.registry.api.Registry governanceUserRegistry)
|
void |
setLocalRepository(org.wso2.carbon.registry.api.Registry localRepository)
|
void |
setProperty(String name,
Object value)
Method to set a property on this CarbonContext instance. |
void |
setQueueManager(MultitenantCarbonQueueManager queueManager)
This method will set the current multi-tenant queue manager instance. |
void |
setTenantDomain(String domain)
Method to set the tenant domain on this CarbonContext instance. |
void |
setTenantId(int tenantId)
Method to set the tenant id on this CarbonContext instance. |
void |
setUsername(String username)
Method to set the username on this CarbonContext instance. |
void |
setUserRealm(org.wso2.carbon.user.api.UserRealm userRealm)
|
void |
startTenantFlow()
Starts a tenant flow. |
void |
unloadTenant()
Method to be called when this tenant is unloaded. |
static void |
unloadTenant(int tenantId)
Method that will be called when a tenant is unloaded. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.wso2.carbon.registry.api.Registry localRepository
protected org.wso2.carbon.registry.api.Registry configSystemRegistry
protected org.wso2.carbon.registry.api.Registry governanceSystemRegistry
protected org.wso2.carbon.registry.api.Registry configUserRegistry
protected org.wso2.carbon.registry.api.Registry governanceUserRegistry
protected org.wso2.carbon.user.api.UserRealm userRealm
| Constructor Detail |
|---|
public CarbonContextDataHolder(CarbonContextDataHolder carbonContextHolder)
carbonContextHolder - the CarbonContext holder instance of which the clone will be
created from.| Method Detail |
|---|
public org.wso2.carbon.registry.api.Registry getLocalRepository()
public void setLocalRepository(org.wso2.carbon.registry.api.Registry localRepository)
public org.wso2.carbon.registry.api.Registry getConfigSystemRegistry()
public void setConfigSystemRegistry(org.wso2.carbon.registry.api.Registry configSystemRegistry)
public org.wso2.carbon.registry.api.Registry getGovernanceSystemRegistry()
public void setGovernanceSystemRegistry(org.wso2.carbon.registry.api.Registry governanceSystemRegistry)
public org.wso2.carbon.registry.api.Registry getConfigUserRegistry()
public void setConfigUserRegistry(org.wso2.carbon.registry.api.Registry configUserRegistry)
public org.wso2.carbon.registry.api.Registry getGovernanceUserRegistry()
public void setGovernanceUserRegistry(org.wso2.carbon.registry.api.Registry governanceUserRegistry)
public org.wso2.carbon.user.api.UserRealm getUserRealm()
public void setUserRealm(org.wso2.carbon.user.api.UserRealm userRealm)
public String getApplicationName()
public void setApplicationName(String applicationName)
public void unloadTenant()
public static CarbonContextDataHolder getThreadLocalCarbonContextHolder()
public void setQueueManager(MultitenantCarbonQueueManager queueManager)
throws org.wso2.carbon.queuing.QueuingException
queueManager - the multi-tenant queue manager.
org.wso2.carbon.queuing.QueuingException - if the operation failed.
public void removeQueueManager()
throws org.wso2.carbon.queuing.QueuingException
org.wso2.carbon.queuing.QueuingException - if the operation failed.public static org.wso2.carbon.base.DiscoveryService getDiscoveryServiceProvider()
public static void setDiscoveryServiceProvider(org.wso2.carbon.base.DiscoveryService discoveryServiceProvider)
discoveryServiceProvider - the Discovery Service instance.public static CarbonContextDataHolder getCurrentCarbonContextHolderBase()
public static void registerUnloadTenantTask(org.wso2.carbon.base.UnloadTenantTask unloadTenantTask)
unloadTenantTask - the task to run.UnloadTenantTaskpublic static void unloadTenant(int tenantId)
tenantId - the tenant's identifier.public void startTenantFlow()
public void endTenantFlow()
public int getTenantId()
public void setTenantId(int tenantId)
tenantId - the tenant id.public String getUsername()
public void setUsername(String username)
username - the username.public String getTenantDomain()
public void setTenantDomain(String domain)
domain - the tenant domain.public Object getProperty(String name)
name - the property name.
public void setProperty(String name,
Object value)
name - the property name.value - the value to be set to the property by the given name.public static void destroyCurrentCarbonContextHolder()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||