Package org.wso2.carbon.base
Class CarbonInitialContextFactory
- java.lang.Object
-
- org.wso2.carbon.base.CarbonInitialContextFactory
-
- All Implemented Interfaces:
InitialContextFactory
public class CarbonInitialContextFactory extends Object implements InitialContextFactory
ICF wrapper class for Carbon. This class itself can not create any initial context. It makes use of an already registered provider ICF instance to create an initial context. The desired provider ICF name should be specified using the environment variable provider.naming.factory.initial, which is the fully qualified class name of the provider.
-
-
Constructor Summary
Constructors Constructor Description CarbonInitialContextFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ContextgetInitialContext(Hashtable environment)Create initial context using the given provider ICF name.static voidregisterProviderICF(String providerName, InitialContextFactory providerICF)Register a provider ICF instance
-
-
-
Method Detail
-
getInitialContext
public Context getInitialContext(Hashtable environment) throws NamingException
Create initial context using the given provider ICF name. If the provider ICF name is not given the default provider is used.- Specified by:
getInitialContextin interfaceInitialContextFactory- Parameters:
environment- Initial context properties- Returns:
- Created IC
- Throws:
NamingException
-
registerProviderICF
public static void registerProviderICF(String providerName, InitialContextFactory providerICF)
Register a provider ICF instance- Parameters:
providerName- Fully qualified class name of the providerproviderICF- Provider instance
-
-