FileDocCategorySizeDatePackage
ConfigDelegateFactory.javaAPI DocGlassfish v2 API4935Fri May 04 22:23:40 BST 2007com.sun.enterprise.management.offline

ConfigDelegateFactory

public final class ConfigDelegateFactory extends Object

Fields Summary
private com.sun.enterprise.config.ConfigContext
mConfigContext
private final File
mDomainXML
private static Map
mFactories
Constructors Summary
private ConfigDelegateFactory(File domainXML)

        mDomainXML  = domainXML;
        mConfigContext  = createConfigContext( mDomainXML );
    
Methods Summary
private com.sun.enterprise.config.ConfigContextcreateConfigContext(java.io.File domainXML)

        setPreEnvironment();
        
        final ConfigContext ctx =
            ConfigFactory.createConfigContext( domainXML.toString(),
                true, true, true );
        
        setPostEnvironment( ctx );
        
        return ctx;
    
synchronized ConfigDelegatecreateConfigDelegate(com.sun.enterprise.config.ConfigBean configBean)

        if ( getConfigContext() != configBean.getConfigContext() )
        {
            throw new IllegalArgumentException( "ConfigBean " +
                configBean.getXPath() + " has mismatched ConfigContext" );
        }

        return new ConfigDelegate( getConfigContext(), configBean );
    
private voiddebug(java.lang.Object o)

        AMXDebug.getInstance().getOutput( "ConfigDelegateFactory" ).println( o );
    
public com.sun.enterprise.config.ConfigContextgetConfigContext()

        return mConfigContext;
    
public static synchronized com.sun.enterprise.management.offline.ConfigDelegateFactorygetInstance(java.io.File domainXML)

        if ( mFactories == null )
        {
            mFactories  = new HashMap<File,ConfigDelegateFactory>();
        }

        ConfigDelegateFactory   instance    = mFactories.get( domainXML );
	    if ( instance == null )
	    {
	        instance    = new ConfigDelegateFactory( domainXML );
	        mFactories.put( domainXML, instance );
	    }
	    
	    return instance;
    
private voidsetPostEnvironment(com.sun.enterprise.config.ConfigContext ctx)

        try
        {
            ((ConfigContextImpl)ctx).setXPathInAllBeans();
        }
        catch(ConfigException e)
        {
            throw new RuntimeException( e );
        }
    
private voidsetPreEnvironment()

        System.setProperty(
              "com.sun.enterprise.config.config_environment_factory_class", 
              "com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory"
         );