public class CarbonContext extends Object
CarbonContextDataHolder instance, which will store the actual data.| Modifier | Constructor and Description |
|---|---|
protected |
CarbonContext(CarbonContextDataHolder carbonContextHolder)
Creates a CarbonContext using the given CarbonContext holder as its backing instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.osgi.framework.Filter |
createFilter(org.osgi.framework.BundleContext bundleContext,
Class clazz,
Hashtable<String,String> props)
Create filter from the bundle context adding class name and properties
|
String[] |
discover(URI[] scopes)
Method to discover a set of service endpoints belonging the defined scopes..
|
String |
getApplicationName() |
protected CarbonContextDataHolder |
getCarbonContextDataHolder()
Utility method to obtain the current CarbonContext holder after an instance of a
CarbonContext has been created.
|
Context |
getJNDIContext()
Method to obtain a JNDI-context.
|
Context |
getJNDIContext(Hashtable properties)
Method to obtain a JNDI-context with the given initialization properties.
|
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.queuing.CarbonQueue<?> |
getQueue(String name)
Deprecated.
|
org.wso2.carbon.registry.api.Registry |
getRegistry(RegistryType type)
Method to obtain an instance of a registry 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 CarbonContext |
getThreadLocalCarbonContext() |
String |
getUsername()
Method to obtain the username on this CarbonContext instance.
|
org.wso2.carbon.user.api.UserRealm |
getUserRealm()
Method to obtain the user realm on this CarbonContext instance.
|
protected CarbonContext(CarbonContextDataHolder carbonContextHolder)
carbonContextHolder - the CarbonContext holder that backs this CarbonContext object.CarbonContextDataHolderprotected CarbonContextDataHolder getCarbonContextDataHolder()
public static CarbonContext getThreadLocalCarbonContext()
public int getTenantId()
public String getUsername()
public String getTenantDomain()
public org.wso2.carbon.registry.api.Registry getRegistry(RegistryType type)
type - the type of registry required.public org.wso2.carbon.user.api.UserRealm getUserRealm()
@Deprecated public org.wso2.carbon.queuing.CarbonQueue<?> getQueue(String name)
name - the name of the queue instance.public Context getJNDIContext(Hashtable properties) throws NamingException
properties - the properties required to create the JNDI-contNDext instance.NamingException - if the operation failed.public Context getJNDIContext() throws NamingException
NamingException - if the operation failed.public String[] discover(URI[] scopes)
scopes - the scopes in which to look-up for the service.@Deprecated public Object getOSGiService(Class clazz)
getOSGiService(Class, java.util.Hashtable) insteadclazzclazz - The type of the OSGi service@Deprecated public List<Object> getOSGiServices(Class clazz)
getOSGiServices(Class, java.util.Hashtable) insteadclazzclazz - The type of the OSGi servicepublic Object getOSGiService(Class clazz, Hashtable<String,String> props)
clazz and propsprops - attribute list that filter the serviceclazz - The type of the OSGi servicepublic List<Object> getOSGiServices(Class clazz, Hashtable<String,String> props)
clazz and propsprops - attribute list that filter the service listclazz - The type of the OSGi serviceprotected org.osgi.framework.Filter createFilter(org.osgi.framework.BundleContext bundleContext,
Class clazz,
Hashtable<String,String> props)
throws org.osgi.framework.InvalidSyntaxException
bundleContext - BundleContextclazz - The type of the OSGi serviceprops - attribute list that filter the service listorg.osgi.framework.InvalidSyntaxExceptionpublic String getApplicationName()
Copyright © 2015 WSO2 Inc. All rights reserved.