FileDocCategorySizeDatePackage
JDBCResourceConfigTest.javaAPI DocGlassfish v2 API5324Fri May 04 22:23:54 BST 2007com.sun.enterprise.management.config

JDBCResourceConfigTest

public final class JDBCResourceConfigTest extends ResourceConfigTestBase

Fields Summary
private static final String
JDBC_RESOURCE_POOL_NAME_BASE
private static final String
JDBC_DATASOURCE_CLASSNAME
private static final Map
OPTIONAL
private com.sun.appserv.management.config.JDBCConnectionPoolConfig
mPool
Constructors Summary
public JDBCResourceConfigTest()

	
     
    
    	mPool	= null;
	    if ( checkNotOffline( "ensureDefaultInstance" ) )
	    {
	        ensureDefaultInstance( getDomainConfig() );
	    }
    
Methods Summary
public static com.sun.appserv.management.config.JDBCResourceConfigcreateInstance(com.sun.appserv.management.config.DomainConfig domainConfig, java.lang.String name, java.lang.String datasourceClassname, java.util.Map optional)

	    return  domainConfig.createJDBCResourceConfig(
	            name, datasourceClassname, optional );
	
private com.sun.appserv.management.config.JDBCConnectionPoolConfigcreatePool(java.lang.String name)

		try
		{
			getDomainConfig().removeJDBCConnectionPoolConfig( name );
		}
		catch( Exception e )
		{
		}
		
	    final JDBCConnectionPoolConfig	config	=
	    	getDomainConfig().createJDBCConnectionPoolConfig( name, JDBC_DATASOURCE_CLASSNAME, null );
	    
	    return( config );
	
protected final com.sun.appserv.management.config.AMXConfigcreateProgeny(java.lang.String name, java.util.Map options)

		mPool	= createPool( name + "-temppool" );
		
	    final JDBCResourceConfig	config	=
	    	getDomainConfig().createJDBCResourceConfig( name, mPool.getName(), options);
		assert( config != null );
			    
		addReference( config );

		return( config );
	
public static com.sun.appserv.management.config.JDBCResourceConfigensureDefaultInstance(com.sun.appserv.management.config.DomainConfig domainConfig)

	    JDBCResourceConfig   result  =
	        domainConfig.getJDBCResourceConfigMap().get( getDefaultInstanceName() );
	    
	    if ( result == null )
	    {
	        final JDBCConnectionPoolConfig  pool = 
	            JDBCConnectionPoolConfigTest.ensureDefaultInstance( domainConfig );
	            
	        result  = createInstance( domainConfig,
	            getDefaultInstanceName(), pool.getName(), OPTIONAL );
	    }
	    
	    return result;
	
public static java.lang.StringgetDefaultInstanceName()

        return getDefaultInstanceName( "JDBCResourceConfig" );
    
protected com.sun.appserv.management.base.ContainergetProgenyContainer()

		return getDomainConfig();
	
protected java.lang.StringgetProgenyJ2EEType()

		return XTypes.JDBC_RESOURCE_CONFIG;
	
protected java.lang.StringgetProgenyTestName()

		return( "jdbc/JDBCResourceConfigMgrTest" );
	
protected final voidremove(java.lang.String name)

		getDomainConfig().removeJDBCResourceConfig( name );
		
		if ( mPool != null )
		{
			getDomainConfig().removeJDBCConnectionPoolConfig( mPool.getName() );
			mPool	= null;
		}
	
protected voidremoveProgeny(java.lang.String name)

		getDomainConfig().removeJDBCConnectionPoolConfig( name );