public class PrivilegedCarbonContext extends CarbonContext
Modifier and Type | Method and Description |
---|---|
static void |
destroyCurrentContext() |
static void |
endTenantFlow()
This will end the tenant flow and restore the previous CarbonContext.
|
Object |
getOSGiService(Class clazz)
Deprecated.
please use
getOSGiService(Class, java.util.Hashtable) instead |
Object |
getOSGiService(Class clazz,
Hashtable<String,String> props)
Obtain the first OSGi service found for interface or class
clazz and props |
List<Object> |
getOSGiServices(Class clazz)
Deprecated.
please use
getOSGiServices(Class, java.util.Hashtable) instead |
List<Object> |
getOSGiServices(Class clazz,
Hashtable<String,String> props)
Obtain the OSGi services found for interface or class
clazz and props |
org.wso2.carbon.registry.api.Registry |
getRegistry(RegistryType type)
Method to obtain an instance of a registry on this CarbonContext instance.
|
String |
getTenantDomain(boolean resolve)
Method to obtain the tenant domain on this CarbonContext instance.
|
int |
getTenantId(boolean resolve)
Method to obtain the tenant id on this CarbonContext instance.
|
static PrivilegedCarbonContext |
getThreadLocalCarbonContext() |
void |
setApplicationName(String applicationName) |
void |
setRegistry(RegistryType type,
org.wso2.carbon.registry.api.Registry registry)
Method to set an instance of a registry on this CarbonContext instance.
|
void |
setTenantDomain(String tenantDomain)
Method to set the tenant domain on this CarbonContext instance.
|
void |
setTenantDomain(String tenantDomain,
boolean resolveTenantId)
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 |
setTenantId(int tenantId,
boolean resolveTenantDomain)
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) |
static void |
startTenantFlow()
Starts a tenant flow.
|
static void |
unloadTenant(int tenantId) |
createFilter, discover, getApplicationName, getCarbonContextDataHolder, getJNDIContext, getJNDIContext, getQueue, getTenantDomain, getTenantId, getUsername, getUserRealm
public static void startTenantFlow()
public static void endTenantFlow()
public static void unloadTenant(int tenantId)
public static void destroyCurrentContext()
public static PrivilegedCarbonContext getThreadLocalCarbonContext()
public void setTenantId(int tenantId)
tenantId
- the tenant id.public void setTenantId(int tenantId, boolean resolveTenantDomain)
tenantId
- the tenant id.resolveTenantDomain
- whether the tenant domain should be calculated based on this
tenant id.public void setUsername(String username)
username
- the username.public void setTenantDomain(String tenantDomain)
tenantDomain
- the tenant domain.public void setTenantDomain(String tenantDomain, boolean resolveTenantId)
tenantDomain
- the tenant domain.resolveTenantId
- whether the tenant id should be calculated based on this tenant
domain.public String getTenantDomain(boolean resolve)
resolve
- whether the tenant domain should be calculated based on the tenant id that is
already known.public int getTenantId(boolean resolve)
resolve
- whether the tenant id should be calculated based on the tenant domain that is
already known.public void setRegistry(RegistryType type, org.wso2.carbon.registry.api.Registry registry)
type
- the type of registry to set.registry
- the registry instance.public org.wso2.carbon.registry.api.Registry getRegistry(RegistryType type)
getRegistry
in class CarbonContext
type
- the type of registry required.public void setUserRealm(org.wso2.carbon.user.api.UserRealm userRealm)
@Deprecated public Object getOSGiService(Class clazz)
getOSGiService(Class, java.util.Hashtable)
insteadclazz
getOSGiService
in class CarbonContext
clazz
- The type of the OSGi service@Deprecated public List<Object> getOSGiServices(Class clazz)
getOSGiServices(Class, java.util.Hashtable)
insteadclazz
getOSGiServices
in class CarbonContext
clazz
- The type of the OSGi servicepublic Object getOSGiService(Class clazz, Hashtable<String,String> props)
clazz
and propsgetOSGiService
in class CarbonContext
props
- attribute list that filter the serviceclazz
- The type of the OSGi servicepublic List<Object> getOSGiServices(Class clazz, Hashtable<String,String> props)
clazz
and propsgetOSGiServices
in class CarbonContext
props
- attribute list that filter the service listclazz
- The type of the OSGi servicepublic void setApplicationName(String applicationName)
Copyright © 2016 WSO2 Inc. All rights reserved.