FileDocCategorySizeDatePackage
JDBCConnectionPoolConfigFactory.javaAPI DocGlassfish v2 API7856Fri May 04 22:23:18 BST 2007com.sun.enterprise.management.config

JDBCConnectionPoolConfigFactory

public final class JDBCConnectionPoolConfigFactory extends ResourceFactoryImplBase
MBean managing all instances of JDBC resource.

Fields Summary
private final Set
LEGAL_OPTIONAL_KEYS
Constructors Summary
public JDBCConnectionPoolConfigFactory(ConfigFactoryCallback callbacks)

		super( callbacks );
	
Methods Summary
public javax.management.ObjectNamecreate(java.lang.String name, java.lang.String datasourceClassname, java.util.Map optional)
Create a new <jdbc-connection-pool>. Name and datasource classname are required parameters.

param
name name of the <jdbc-connection-pool> to be created
param
datasourceClassname vendor supplied JDBC resource manager such as javax.sql.XADatasource interface.
param
optional optional parameters for jdbc connection pool creation

        final String[] requiredParams = new String[]
		{
			JDBCConnectionPoolConfigKeys.DATASOURCE_CLASSNAME_KEY,       datasourceClassname,
		};
                
		final Map<String,String> params	= initParams( name, requiredParams, optional );
		
		final ObjectName	amxName = createNamedChild( name, params );
		
		return( amxName );
	
public javax.management.ObjectNamecreate(java.lang.String name, java.lang.String connectionValidationMethod, java.lang.String datasourceClassname, boolean failAllConnections, int idleTimeoutSeconds, boolean connectionValidationRequired, boolean isolationLevelGuaranteed, java.lang.String transactionIsolationLevel, int maxPoolSize, int maxWaitTimeMillis, int poolResizeQuantity, java.lang.String resType, int steadyPoolSize, java.lang.String databaseName, java.lang.String databaseUserName, java.lang.String databasePassword, java.util.Map reserved)

		final Map<String,String> optionalParams = new java.util.HashMap<String,String>();
		optionalParams.put(JDBCConnectionPoolConfigKeys.CONNECTION_VALIDATION_METHOD_KEY,connectionValidationMethod);
		optionalParams.put(JDBCConnectionPoolConfigKeys.FAIL_ALL_CONNECTIONS_KEY,Boolean.toString(failAllConnections));
		optionalParams.put(JDBCConnectionPoolConfigKeys.IDLE_TIMEOUT_IN_SECONDS_KEY,Integer.toString(idleTimeoutSeconds));
		optionalParams.put(JDBCConnectionPoolConfigKeys.IS_CONNECTION_VALIDATION_REQUIRED_KEY,Boolean.toString(connectionValidationRequired));
		optionalParams.put(JDBCConnectionPoolConfigKeys.IS_ISOLATION_LEVEL_GUARANTEED_KEY,Boolean.toString(isolationLevelGuaranteed));
		optionalParams.put(JDBCConnectionPoolConfigKeys.TRANSACTION_ISOLATION_LEVEL_KEY, transactionIsolationLevel);
		optionalParams.put(JDBCConnectionPoolConfigKeys.MAX_POOL_SIZE_KEY,Integer.toString(maxPoolSize));
		optionalParams.put(JDBCConnectionPoolConfigKeys.MAX_WAIT_TIME_MILLIS_KEY,Integer.toString(maxWaitTimeMillis));
		optionalParams.put(JDBCConnectionPoolConfigKeys.POOL_RESIZE_QUANTITY_KEY,Integer.toString(poolResizeQuantity));
		optionalParams.put(JDBCConnectionPoolConfigKeys.RES_TYPE_KEY,resType);
		optionalParams.put(JDBCConnectionPoolConfigKeys.STEADY_POOL_SIZE_KEY,Integer.toString(steadyPoolSize));
		optionalParams.put(JDBCConnectionPoolConfigKeys.DATABASE_NAME_KEY,databaseName);
		optionalParams.put(JDBCConnectionPoolConfigKeys.DATABASE_USER_KEY,databaseUserName);
		optionalParams.put(JDBCConnectionPoolConfigKeys.DATABASE_PASSWORD_KEY,databasePassword);

		optionalParams.putAll( reserved );

		final ObjectName amxName =  create( name, datasourceClassname, optionalParams);
		return( amxName );
	
protected javax.management.ObjectNamecreateOldChildConfig(javax.management.AttributeList translatedAttrs)
The caller is responsible for dealing with any Properties.

		trace( "JDBCConnectionPoolConfigFactory.createOldChildConfig: creating using: " +
			stringify( translatedAttrs ) );
			
		final ObjectName	objectName	=
				getOldResourcesMBean().createJdbcConnectionPool( translatedAttrs );
		
		return( objectName );
	
protected java.util.SetgetLegalOptionalCreateKeys()

	
	     
	
	
		return( LEGAL_OPTIONAL_KEYS );
	
protected voidremoveByName(java.lang.String name)

		getOldResourcesMBean().removeJdbcConnectionPoolByName( name );