FileDocCategorySizeDatePackage
DeploymentTargetFactoryPEImpl.javaAPI DocGlassfish v2 API5654Fri May 04 22:34:38 BST 2007com.sun.enterprise.deployment.phasing

DeploymentTargetFactoryPEImpl

public class DeploymentTargetFactoryPEImpl extends DeploymentTargetFactory
Target factory used for PE case. In case target name is domain a GroupDeploymentTarget that acts as an aggregation of servers in the domain is returned.
author
Sandhya E Changed by Sridatta for bug fix: 4932179 Target is always ServerDeploymentTarget for PE. There is always only 1 instance in PE. Changing the implementation to reflect this.

Fields Summary
private static final com.sun.enterprise.admin.target.TargetType[]
VALID_DEPLOYMENT_TYPES
Constructors Summary
public DeploymentTargetFactoryPEImpl()
Creates a new instance of DeploymentTargetFactoryPEImpl

    
                 
      
Methods Summary
public DeploymentTargetgetTarget(com.sun.enterprise.config.ConfigContext configContext, java.lang.String domainName, java.lang.String targetName)
Returns the Deployment target for the targetName. If targetName is default_target "domain" then a GroupDeploymentTarget representing a collection of all servers in this domain is returned. This method is called from Association/DisassociationPhase and Start/StopPhase. For PE, when no target name is specified in the deployment commands association/disassociation/start/stop need to execute for all servers.

param
configContext
param
targetName name of the target
return
DeploymentTarget representing the targetName [ GroupDeploymentTarget is targetName == "domain"]
throws
IASDeploymentException

        try{
            //parse the given target and ensure that it is a valid server instance. Server instance
            //is the only valid target type for PE.            
            final Target target = TargetBuilder.INSTANCE.createTarget(VALID_DEPLOYMENT_TYPES, 
                targetName, configContext);    
            if (targetName == null) {
                targetName = target.getName();            
            }
            return new ServerDeploymentTarget(configContext , domainName, targetName);
        } catch(Throwable t){            
            throw new IASDeploymentException("Error:" + t.getMessage(), t);
        }
    
public DeploymentTargetgetTarget(com.sun.enterprise.config.ConfigContext configContext, java.lang.String domainName)
Returns the default target. Used incase when deployment command doesnt get the target name from user

param
configContext config context
return
DeploymentTarget
throws
IASDeploymentException

        return getTarget(configContext, domainName, null);
    
public com.sun.enterprise.admin.target.TargetType[]getValidDeploymentTargetTypes()

return
valid deployment target types for this target factory

        return this.VALID_DEPLOYMENT_TYPES;