FileDocCategorySizeDatePackage
ResourceDeployerFactory.javaAPI DocGlassfish v2 API8460Fri May 04 22:35:42 BST 2007com.sun.enterprise.server

ResourceDeployerFactory

public class ResourceDeployerFactory extends Object
Deployer factory for different resource types.

Fields Summary
private ResourceDeployer
resourceAdapterConfigDeployer_
Admin object resource deployer
private ResourceDeployer
adminObjectResourceDeployer_
Admin object resource deployer
private ResourceDeployer
connectorResourceDeployer_
Connector Resource deployer
private ResourceDeployer
connectorConnectionPoolDeployer_
Connector Connection pool
private ResourceDeployer
jdbcResourceDeployer_
jdbc resource deployer
private ResourceDeployer
pmfResourceDeployer_
pmf resource deployer
private ResourceDeployer
customResourceDeployer_
custom resource deployer
private ResourceDeployer
externalJndiResourceDeployer_
external jndi resource deployer
private ResourceDeployer
mailResourceDeployer_
java mail resource deployer
private ResourceDeployer
JdbcConnectionPoolDeployer_
jdbc connection pool deployer
static Logger
_logger
logger to log core messages
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
public ResourceDeployerFactory()
Initializes the resource deployers.

    
             
      
        this.resourceAdapterConfigDeployer_ = 
                 new ResourceAdapterConfigDeployer();
        this.adminObjectResourceDeployer_          = new AdminObjectResourceDeployer();
        this.connectorResourceDeployer_          = new ConnectorResourceDeployer();
        this.connectorConnectionPoolDeployer_          = new ConnectorConnectionPoolDeployer();
        this.jdbcResourceDeployer_         = new JdbcResourceDeployer();
        this.pmfResourceDeployer_          = 
                            new PersistenceManagerFactoryResourceDeployer();
        this.customResourceDeployer_       = new CustomResourceDeployer();
        this.externalJndiResourceDeployer_ = new ExternalJndiResourceDeployer();
        this.mailResourceDeployer_         = new MailResourceDeployer();
    // start 4650787
	// new JdbcConnectionPoolDeployer instance was created to support
	// dynamic connection pool - bug # 4650787
    /** jdbc connection pool deployer */
        this.JdbcConnectionPoolDeployer_    = new JdbcConnectionPoolDeployer();
	// end 4650787        
    
Methods Summary
public java.lang.ObjectgetResource(java.lang.String type, java.lang.String name, com.sun.enterprise.config.serverbeans.Resources rbeans)
Convenience method. It delegates the call to the deployer with the config resource beands. The deployer returns the implementation specific object that it wants.

param
type type of resource
param
name jndi name of the resource
param
rbeans config resource beans


        return getResourceDeployer(type).getResource(name, rbeans);
	
public ResourceDeployergetResourceDeployer(java.lang.String type)
Returns a resource deployer for the given resource type.

param
type resource type
throws
Exception if unknown resource type


	ResourceDeployer deployer = null;

	if (type.equals(ResourceDeployEvent.RES_TYPE_JDBC)) {

            deployer = this.jdbcResourceDeployer_;

        } else if (type.equals(ResourceDeployEvent.RES_TYPE_PMF)) {

            deployer = this.pmfResourceDeployer_;

	} else if (type.equals(ResourceDeployEvent.RES_TYPE_CUSTOM)) {

            deployer = this.customResourceDeployer_;

	} else if (type.equals(ResourceDeployEvent.RES_TYPE_EXTERNAL_JNDI)) {

            deployer = this.externalJndiResourceDeployer_;

        } else if (type.equals(ResourceDeployEvent.RES_TYPE_MAIL)) {

            deployer = this.mailResourceDeployer_;

        } else if (type.equals(ResourceDeployEvent.RES_TYPE_AOR)) {

            deployer = this.adminObjectResourceDeployer_;

        } else if (type.equals(ResourceDeployEvent.RES_TYPE_CR)) {

            deployer = this.connectorResourceDeployer_;

        } else if (type.equals(ResourceDeployEvent.RES_TYPE_CCP)) {

            deployer = this.connectorConnectionPoolDeployer_;

        } else if (type.equals(ResourceDeployEvent.RES_TYPE_RAC)) {

            deployer = this.resourceAdapterConfigDeployer_;

	} else if (type.equals(ResourceDeployEvent.RES_TYPE_JCP)) {
    // start 4650787
	// type check was created to support
	// dynamic connection pool - bug # 4650787
            deployer = this.JdbcConnectionPoolDeployer_;
	// end 4650787

        } else {
	    String msg = localStrings.getString(
				"resource.deployment.resource_type_not_implemented" ,type);
	    throw new Exception(msg);
        }

        return deployer;