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

PreResCreationPhase

public class PreResCreationPhase extends ResourcePhase
This class manages the creation of the resources from sun-resource.xml that need to created prior to resource adapter loading

Fields Summary
public static final Logger
sLogger
Deployment Logger object for this class
private static com.sun.enterprise.util.i18n.StringManager
localStrings
string manager
Constructors Summary
public PreResCreationPhase(DeploymentContext deploymentCtx)
Creates a new instance of PreResCreationPhase

param
deploymentCtx context object for the deployment

   
                        
       
    
        this.deploymentCtx = deploymentCtx;        
        this.name = PRE_RES_CREATION;
    
Methods Summary
private com.sun.enterprise.deployment.backend.DeploymentEventgetPostPhaseEvent(com.sun.enterprise.deployment.backend.DeploymentRequest req)
Event that will be broadcasted at the end of the phase

return
DeploymentEvent

        return new DeploymentEvent(DeploymentEventType.POST_RES_CREATE, new DeploymentEventInfo(req));
    
private com.sun.enterprise.deployment.backend.DeploymentEventgetPrePhaseEvent(com.sun.enterprise.deployment.backend.DeploymentRequest req)
Event that will be broadcasted at the start of the phase

param
req Deployment request object
return
DeploymentEvent

        return new DeploymentEvent(DeploymentEventType.PRE_RES_CREATE, new DeploymentEventInfo(req));
    
public java.util.ListgetRelevantResources(java.util.List allResources)

        return ResourcesXMLParser.getNonConnectorResourcesList(allResources, true);
    
public voidhandleRedeployment(java.util.List targetList, java.util.List resourceList)

        handleDeployment(targetList, resourceList);
    
public voidrunPhase(DeploymentPhaseContext phaseCtx)
Phase specific execution logic will go in this method. Any phase implementing this class will provide its implementation for this method.

param
req Deployment request object
param
phaseCtx the DeploymentPhaseContext object

        DeploymentStatus status = phaseCtx.getDeploymentStatus();

        try {
            DeploymentRequest req = phaseCtx.getDeploymentRequest();
                                                                      
            prePhaseNotify(getPrePhaseEvent(req));
            doResourceOperation(req);
            postPhaseNotify(getPostPhaseEvent(req));
                                                                      
            phaseCtx.getDeploymentStatus().setStageStatus(DeploymentStatus.SUCCESS);
        } catch(Exception e) {
            status.setStageStatus(DeploymentStatus.WARNING);
            status.setStageException(e);
            status.setStageStatusMessage(e.getMessage());
        }