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 Details

    • CarbonInitialContextFactory

      public CarbonInitialContextFactory()
  • Method Details

    • 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:
      getInitialContext in interface InitialContextFactory
      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 provider
      providerICF - Provider instance