Methods Summary |
---|
public com.sun.enterprise.deployment.backend.DeploymentStatus | associate(java.lang.String targetName, boolean enabled, java.lang.String virtualServers, java.lang.String referenceName)This method is used to associate an application to a target.
It constructs the DeploymentRequest using the parameters first.
try {
long startTime = System.currentTimeMillis();
//FIXME: add validation code such as checking context root
DeployableObjectType type =
DeploymentServiceUtils.getRegisteredType(referenceName);
final DeploymentTarget target =
DeploymentServiceUtils.getAndValidateDeploymentTarget(
targetName, referenceName, false);
InstanceEnvironment env =
ApplicationServer.getServerContext().getInstanceEnvironment();
DeploymentRequest req = new DeploymentRequest(
env,
type,
DeploymentCommand.DEPLOY);
/*
* Force enabled to true for app client modules to address temporarily
* issue 3248.
*/
enabled = enabled || type.isCAR();
req.setName(referenceName);
req.setStartOnDeploy(enabled);
req.setTarget(target);
Properties optionalAttributes = new Properties();
if(virtualServers!=null) {
optionalAttributes.put(ServerTags.VIRTUAL_SERVERS,
virtualServers);
}
req.setOptionalAttributes(optionalAttributes);
return associate(req, createAuditInfoIfOn(req, AuditInfo.Operation.associate, startTime));
} catch(Exception e) {
if (e instanceof IASDeploymentException) {
throw (IASDeploymentException)e;
}
else {
throw new IASDeploymentException(e);
}
}
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | associate(java.lang.String targetName, java.lang.String referenceName, java.util.Map options)This method is used to associate an application to a target.
It constructs the DeploymentRequest using the parameters first.
try {
long startTime = System.currentTimeMillis();
DeployableObjectType type =
DeploymentServiceUtils.getRegisteredType(referenceName);
DeploymentProperties dProps = new DeploymentProperties(options);
/*
*A preexisting reference is allowed to exist if a redeployment
*is underway and the reference's attributes are not changing
*during the redeployment, so long as a
*preceding disassociation phase has recorded this fact.
*/
boolean enforceValidation = true;
if (dProps.getRedeploy()) {
/*
*Make sure this app ref was saved during an earlier disassociation.
*/
DeploymentContext.SavedApplicationRefInfo info =
deploymentContext.getSavedAppRef(referenceName, targetName);
enforceValidation = (info == null);
}
/*
* Force enabled to true for app client modules to address temporarily
* issue 3248.
*/
if (type.isCAR()) {
dProps.setEnable(true);
}
final DeploymentTarget target = enforceValidation ?
DeploymentServiceUtils.getAndValidateDeploymentTarget(
targetName, referenceName, false) :
DeploymentServiceUtils.getDeploymentTarget(targetName);
InstanceEnvironment env =
ApplicationServer.getServerContext().getInstanceEnvironment();
DeploymentRequest req = new DeploymentRequest(
env,
type,
DeploymentCommand.DEPLOY);
String virtualServers = dProps.getVirtualServers();
boolean enabled = dProps.getEnable();
req.setName(referenceName);
req.setStartOnDeploy(enabled);
req.setTarget(target);
req.setIsRedeployInProgress(dProps.getRedeploy());
DeploymentServiceUtils.setResourceOptionsInRequest(req, dProps);
Properties optionalAttributes = new Properties();
if(virtualServers!=null) {
optionalAttributes.put(ServerTags.VIRTUAL_SERVERS,
virtualServers);
}
req.setOptionalAttributes(optionalAttributes);
return associate(req, createAuditInfoIfOn(req, AuditInfo.Operation.associate, startTime));
} catch(Exception e) {
if (e instanceof IASDeploymentException) {
throw (IASDeploymentException)e;
}
else {
throw new IASDeploymentException(e);
}
}
|
private com.sun.enterprise.deployment.backend.DeploymentStatus | associate(com.sun.enterprise.deployment.backend.DeploymentRequest req, com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo auditInfo)Associates an application to a target.
DeploymentStatus result = executePhases(req, associatePhaseList);
if (auditInfo != null) {
auditInfo.reportEnd(result.getStatus());
}
return result;
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | associate(com.sun.enterprise.deployment.backend.DeploymentRequest req)This method is used to associate an application to a target.
return associate(req, createAuditInfoIfOn(req, AuditInfo.Operation.associate));
|
private com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo | createAuditInfoIfOn(com.sun.enterprise.deployment.backend.DeploymentRequest req, AuditInfo.Operation operation)Returns an instance of AuditInfo if the audit logging level mandates; null otherwise.
return auditLogger.isLoggable(Level.INFO) ? new AuditInfo(req, operation, System.currentTimeMillis()) : null;
|
private com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo | createAuditInfoIfOn(com.sun.enterprise.deployment.backend.DeploymentRequest req, AuditInfo.Operation operation, long startTime)Returns an instance of AuditInfo if the audit logging level mandates; null otherwise.
return auditLogger.isLoggable(Level.INFO) ? new AuditInfo(req, operation, startTime) : null;
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | deploy(java.io.File deployFile, java.io.File planFile, java.lang.String archiveName, java.lang.String moduleID, com.sun.enterprise.deployment.util.DeploymentProperties dProps, com.sun.enterprise.management.deploy.DeploymentCallback callback)This method deploys application to the domain.
It constructs the DeploymentRequest using the parameters first.
try {
if (deployFile == null) {
throw new IASDeploymentException(
localStrings.getString("deployfile_not_specified"));
}
/*
*Save the current time to use in preparing the audit info later so
*the audit measurement includes all the logic below.
*/
long startTime = System.currentTimeMillis();
sLogger.log(Level.FINE, "mbean.begin_deploy", moduleID);
DeployableObjectType type = null;
if (dProps.getType() != null) {
type = DeploymentServiceUtils.getDeployableObjectType(dProps.getType());
} else {
type = DeploymentServiceUtils.getTypeFromFile(
moduleID, deployFile.getAbsolutePath());
}
InstanceEnvironment env =
ApplicationServer.getServerContext().getInstanceEnvironment();
DeploymentRequest req = new DeploymentRequest(
env,
type,
DeploymentCommand.DEPLOY);
DeploymentRequestRegistry.getRegistry().addDeploymentRequest(
moduleID, req);
req.setName(moduleID);
boolean isRegistered = false;
isRegistered = DeploymentServiceUtils.isRegistered(moduleID, type);
// FIXME validation for new REDEPLOY property
if (isRegistered) {
DeploymentServiceUtils.validate(moduleID,type,REDEPLOY_ACTION, req);
}
req.setFileSource(deployFile);
req.setDeploymentPlan(planFile);
req.setForced(dProps.getForce());
if(type.isWEB()) {
req.setDefaultContextRoot(dProps.getDefaultContextRoot(
archiveName));
req.setContextRoot(dProps.getContextRoot());
}
req.setVerifying(dProps.getVerify());
req.setPrecompileJSP(dProps.getPrecompileJSP());
req.setGenerateRMIStubs(dProps.getGenerateRMIStubs());
req.setAvailabilityEnabled(dProps.getAvailabilityEnabled());
req.setStartOnDeploy(dProps.getEnable());
req.setDescription(dProps.getDescription());
req.setLibraries(dProps.getLibraries());
req.setJavaWebStartEnabled(dProps.getJavaWebStartEnabled());
req.setExternallyManagedPath(dProps.getExternallyManaged());
req.setDeploymentCallback(callback);
req.setIsRedeployInProgress(dProps.getRedeploy());
DeploymentServiceUtils.setResourceOptionsInRequest(req, dProps);
Properties optionalAttributes = new Properties();
String virtualServers = dProps.getVirtualServers();
if(virtualServers!=null) {
optionalAttributes.put(ServerTags.VIRTUAL_SERVERS,
virtualServers);
}
req.setOptionalAttributes(optionalAttributes);
req.addOptionalArguments(dProps.prune());
DeploymentServiceUtils.setHostAndPort(req);
return deploy(req, createAuditInfoIfOn(req, AuditInfo.Operation.deploy, startTime));
} catch(Exception e) {
sLogger.log(Level.WARNING, "mbean.deploy_failed", e);
if (e instanceof IASDeploymentException) {
throw (IASDeploymentException)e;
}
else {
throw new IASDeploymentException(e);
}
}
|
private com.sun.enterprise.deployment.backend.DeploymentStatus | deploy(com.sun.enterprise.deployment.backend.DeploymentRequest req, com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo auditInfo)
// deploy to instance
DeploymentStatus result = null;
if (req.getTarget() != null &&
!req.getTarget().getName().equals("domain")) {
result = executePhases(req, getDeployPhaseListForTarget(req));
// deploy to domain
} else {
result = executePhases(req, deployToDomainPhaseList);
}
if (auditInfo != null) {
auditInfo.reportEnd(result.getStatus());
}
return result;
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | deploy(com.sun.enterprise.deployment.backend.DeploymentRequest req)This method deploys application to the DAS. Prepares the app, stores it in
central repository and registers with config
return deploy(req, createAuditInfoIfOn(req, AuditInfo.Operation.deploy));
|
private com.sun.enterprise.deployment.backend.DeploymentStatus | disassociate(com.sun.enterprise.deployment.backend.DeploymentRequest req, com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo auditInfo)
String moduleID = req.getName();
DeployableObjectType type = req.getType();
DeploymentServiceUtils.validate(moduleID,type,DISASSOCIATE_ACTION, req);
DeploymentStatus result = executePhases(req, disassociatePhaseList);
if (auditInfo != null) {
auditInfo.reportEnd(result.getStatus());
}
return result;
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | disassociate(com.sun.enterprise.deployment.backend.DeploymentRequest req)This method removes references of an application on a particular target
return disassociate(req, createAuditInfoIfOn(req, AuditInfo.Operation.disassociate));
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | disassociate(java.lang.String targetName, java.lang.String referenceName)This method removes references of an application on a particular target
It constructs the DeploymentRequest using the parameters first.
try {
long startTime = System.currentTimeMillis();
DeployableObjectType type =
DeploymentServiceUtils.getRegisteredType(referenceName);
final DeploymentTarget target =
DeploymentServiceUtils.getAndValidateDeploymentTarget(
targetName, referenceName, true);
InstanceEnvironment env =
ApplicationServer.getServerContext().getInstanceEnvironment();
DeploymentRequest req = new DeploymentRequest(
env,
type,
DeploymentCommand.UNDEPLOY);
req.setName(referenceName);
req.setTarget(target);
return disassociate(req, createAuditInfoIfOn(req, AuditInfo.Operation.disassociate, startTime));
} catch(Exception e) {
if (e instanceof IASDeploymentException) {
throw (IASDeploymentException)e;
}
else {
throw new IASDeploymentException(e);
}
}
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | disassociate(java.lang.String targetName, java.lang.String referenceName, java.util.Map options)
try {
long startTime = System.currentTimeMillis();
DeployableObjectType type =
DeploymentServiceUtils.getRegisteredType(referenceName);
final DeploymentTarget target =
DeploymentServiceUtils.getAndValidateDeploymentTarget(
targetName, referenceName, true);
InstanceEnvironment env =
ApplicationServer.getServerContext().getInstanceEnvironment();
DeploymentRequest req = new DeploymentRequest(
env,
type,
DeploymentCommand.UNDEPLOY);
req.setName(referenceName);
req.setTarget(target);
DeploymentProperties dProps = new DeploymentProperties(options);
req.setCascade(dProps.getCascade());
req.setForced(dProps.getForce());
req.setExternallyManagedPath(dProps.getExternallyManaged());
req.setIsRedeployInProgress(dProps.getRedeploy());
DeploymentServiceUtils.setResourceOptionsInRequest(req, dProps);
return disassociate(req, createAuditInfoIfOn(req, AuditInfo.Operation.disassociate, startTime));
} catch(Exception e) {
if (e instanceof IASDeploymentException) {
throw (IASDeploymentException)e;
}
else {
throw new IASDeploymentException(e);
}
}
|
protected com.sun.enterprise.deployment.backend.DeploymentStatus | executePhases(com.sun.enterprise.deployment.backend.DeploymentRequest req, java.util.List phases)utility method to succesively invoke DeploymentPhases instances
provided as a list and rollback them in case of an exception
during one of the phase execution
Note - after the phases are executed executePhases invokes the done
method on the DeploymentRequest to release its resources, in particular
the EJBClassLoaders. The DeploymentRequest cannot be reused for
another deployment upon return from executePhases.
try {
Descriptor.setBoundsChecking(true);
// first we create our deployment status to return feedback to the user
DeploymentStatus ds = new DeploymentStatus();
ds.setStageDescription("Deployment");
req.setCurrentDeploymentStatus(ds);
DeploymentPhaseContext phaseCtx[] = new DeploymentPhaseContext[phases.size()];
for(int i=0 ; i < phases.size() ; i++)
{
try{
// create a new status for this phase
DeploymentStatus phaseDs = new DeploymentStatus(ds);
// execute the phase
phaseCtx[i] = ((DeploymentPhase)phases.get(i)).executePhase(req, phaseDs);
// if the previous phase did not excecute successfully.
// we need to allow previous phases to rollback.
if (phaseDs.getStageStatus()<DeploymentStatus.WARNING) {
rollbackPhases(phases, phaseCtx, i-1);
// return main deployment status
return ds;
}
} catch(Throwable dpe) {
// an exception has occured in the I'th phase, we need to rollback
// all previously executed phases (and ignore any failures that may
// be raised by this rollback).
String msg =
localStrings.getString( "enterprise.deployment.phasing.deploymentservice.exception");
sLogger.log(Level.SEVERE, msg ,dpe);
rollbackPhases(phases, phaseCtx, i-1);
// we register the original exception as it was raised
// by the executePhase method in our deployment status
ds.setStageStatus(DeploymentStatus.FAILURE);
if (dpe instanceof java.io.Serializable) {
ds.setStageException(dpe);
} else {
sLogger.severe(localStrings.getString("enterprise.deployment.phasing.exception_notserializable", dpe.getClass()));
sLogger.severe(localStrings.getString("enterprise.deployment.phasing.exception_notforwarded", dpe.getMessage()));
}
ds.setStageException(dpe);
ds.setStageStatusMessage(dpe.getMessage());
return ds;
}
}
// we do not set the state of the deployment status
// since it will be provided by the sub phases status.
return ds;
} finally {
req.done();
}
|
public static java.lang.String | getClientJarPath(java.lang.String moduleID)
// let's ensure first that our client jar is ready.
ClientJarMakerRegistry registry = ClientJarMakerRegistry.getInstance();
if (registry.isRegistered(moduleID)) {
// let's wait until it is finished.
registry.waitForCompletion(moduleID);
}
return moduleID + DeploymentImplConstants.ClientJarSuffix;
|
protected java.util.List | getDeployPhaseListForTarget(com.sun.enterprise.deployment.backend.DeploymentRequest req)
if (deployPhaseList != null) {
return deployPhaseList;
}
//XXX FIXME. Need to verify the type of the target.
J2EECPhase j2eec = new J2EECPhase(deploymentContext);
AssociationPhase associate = new AssociationPhase(deploymentContext);
ResourceAdapterStartPhase raStart =
new ResourceAdapterStartPhase(deploymentContext);
ApplicationStartPhase appStart =
new ApplicationStartPhase(deploymentContext);
PreResCreationPhase preResCreation =
new PreResCreationPhase(deploymentContext);
PostResCreationPhase postResCreation =
new PostResCreationPhase(deploymentContext);
//(re)deploy phaseList
deployPhaseList = new ArrayList();
deployPhaseList.add(j2eec);
deployPhaseList.add(associate);
deployPhaseList.add(preResCreation);
deployPhaseList.add(raStart);
deployPhaseList.add(postResCreation);
deployPhaseList.add(appStart);
return deployPhaseList;
|
public java.lang.String | getModuleIDFromDD(java.io.File file)This method finds moduleID by explicitly loading the dd for its
display name.
This method is called by the DeployThread if and only if the client
uses JSR88.distribute with InputStream signature.
Archivist source = ArchivistFactory.getArchivistForArchive(file);
InputJarArchive archive = new InputJarArchive();
archive.open(file.getAbsolutePath());
Descriptor descriptor = null;
String moduleID = null;
String displayName = null;
try {
descriptor = source.readStandardDeploymentDescriptor(archive);
} catch (Exception ex) {
//ignore
}
if (descriptor != null) {
displayName = descriptor.getDisplayName();
}
if ((displayName != null) && (displayName.length() > 0)) {
moduleID = displayName;
} else {
//We give up. Use the uploaded file name instead
moduleID =
(new DeploymentProperties()).getName(file.getAbsolutePath());
}
moduleID = moduleID.replace(' ",'_");
// This moduleID will be later used to construct file path,
// replace the illegal characters in file name
// \ / : * ? " < > | with _
moduleID = moduleID.replace('\\", '_").replace('/", '_");
moduleID = moduleID.replace(':", '_").replace('*", '_");
moduleID = moduleID.replace('?", '_").replace('"", '_");
moduleID = moduleID.replace('<", '_").replace('>", '_");
moduleID = moduleID.replace('|", '_");
// This moduleID will also be used to construct an ObjectName
// to register the module, so replace additional special
// characters , = used in property parsing with -
moduleID = moduleID.replace(',", '_").replace('=", '_");
return moduleID;
|
private void | initializePhases()Initializes phaseList corresponding to deploy operations. Each phase is
initialized with a deploymentContext object. Deployment operations that
are intialized are deploy/undeploy/associate/disassociate.
J2EECPhase j2eec = new J2EECPhase(deploymentContext);
AssociationPhase associate = new AssociationPhase(deploymentContext);
DisassociationPhase disassociate = new DisassociationPhase(deploymentContext);
UndeployFromDomainPhase undeploy = new UndeployFromDomainPhase(deploymentContext);
ResourceAdapterStartPhase raStart =
new ResourceAdapterStartPhase(deploymentContext);
ApplicationStartPhase appStart =
new ApplicationStartPhase(deploymentContext);
PreResCreationPhase preResCreation =
new PreResCreationPhase(deploymentContext);
PostResCreationPhase postResCreation =
new PostResCreationPhase(deploymentContext);
ResourceAdapterStopPhase raStop =
new ResourceAdapterStopPhase(deploymentContext);
ApplicationStopPhase appStop =
new ApplicationStopPhase(deploymentContext);
PreResDeletionPhase preResDeletion =
new PreResDeletionPhase(deploymentContext);
PostResDeletionPhase postResDeletion =
new PostResDeletionPhase(deploymentContext);
//(re)deploy to domain phaseList
deployToDomainPhaseList = new ArrayList();
//for special case (re)deploy to domain
deployToDomainPhaseList.add(preResDeletion);
deployToDomainPhaseList.add(postResDeletion);
deployToDomainPhaseList.add(j2eec);
deployToDomainPhaseList.add(preResCreation);
deployToDomainPhaseList.add(postResCreation);
//associate phaseList
associatePhaseList = new ArrayList();
associatePhaseList.add(associate);
//disassociate phaseList
disassociatePhaseList = new ArrayList();
disassociatePhaseList.add(disassociate);
//undeploy phaseList
undeployPhaseList = new ArrayList();
undeployPhaseList.add(appStop);
undeployPhaseList.add(preResDeletion);
undeployPhaseList.add(raStop);
undeployPhaseList.add(postResDeletion);
undeployPhaseList.add(disassociate);
undeployPhaseList.add(undeploy);
//undeploy from domain phaseList
undeployFromDomainPhaseList = new ArrayList();
undeployFromDomainPhaseList.add(preResDeletion);
undeployFromDomainPhaseList.add(postResDeletion);
undeployFromDomainPhaseList.add(undeploy);
startPhaseList = new ArrayList();
startPhaseList.add(preResCreation);
startPhaseList.add(raStart);
startPhaseList.add(postResCreation);
startPhaseList.add(appStart);
stopPhaseList = new ArrayList();
stopPhaseList.add(appStop);
stopPhaseList.add(preResDeletion);
stopPhaseList.add(raStop);
stopPhaseList.add(postResDeletion);
|
public boolean | quit(java.lang.String moduleID)
DeploymentRequest request = DeploymentRequestRegistry.getRegistry().getDeploymentRequest(moduleID);
if (request != null) {
request.setAbort(true);
return true;
} else {
return false;
}
|
private void | rollbackPhases(java.util.List phases, DeploymentPhaseContext[] phaseCtx, int index)Rollback previously excuted phases
// now we are going to rollback all the previously executed phases
for (int j=index; j>=0 ; j--) {
try {
((DeploymentPhase)phases.get(j)).rollback(phaseCtx[j]);
} catch(Exception rollbackException) {
// it failed ! just log
String msg =
localStrings.getString( "enterprise.deployment.phasing.deploymentservice.rollbackexception");
sLogger.log(Level.INFO, msg ,rollbackException);
// we swallow the exception to allow all phases to execute their
// rollback
}
}
|
private com.sun.enterprise.deployment.backend.DeploymentStatus | start(com.sun.enterprise.deployment.backend.DeploymentRequest req, com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo auditInfo)
DeploymentStatus result = executePhases(req, startPhaseList);
if (auditInfo != null) {
auditInfo.reportEnd(result.getStatus());
}
return result;
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | start(com.sun.enterprise.deployment.backend.DeploymentRequest req)
return start(req, createAuditInfoIfOn(req, AuditInfo.Operation.start));
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | start(java.lang.String moduleID, java.lang.String targetName, java.util.Map options)
try {
long startTime = System.currentTimeMillis();
DeployableObjectType type =
DeploymentServiceUtils.getRegisteredType(moduleID);
final DeploymentTarget target =
DeploymentServiceUtils.getDeploymentTarget(targetName);
InstanceEnvironment env =
ApplicationServer.getServerContext().getInstanceEnvironment();
DeploymentRequest req = new DeploymentRequest(
env,
type,
DeploymentCommand.DEPLOY);
int actionCode;
if(type.isAPP()) {
actionCode = BaseDeployEvent.APPLICATION_DEPLOYED;
}
else {
actionCode = BaseDeployEvent.MODULE_DEPLOYED;
}
req.setName(moduleID);
req.setActionCode(actionCode);
req.setTarget(target);
DeploymentProperties dProps = new DeploymentProperties(options);
req.setForced(dProps.getForce());
DeploymentServiceUtils.setResourceOptionsInRequest(req, dProps);
return start(req, createAuditInfoIfOn(req, AuditInfo.Operation.start, startTime));
} catch(Exception e) {
if (e instanceof IASDeploymentException) {
throw (IASDeploymentException)e;
}
else {
throw new IASDeploymentException(e);
}
}
|
private com.sun.enterprise.deployment.backend.DeploymentStatus | stop(com.sun.enterprise.deployment.backend.DeploymentRequest req, com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo auditInfo)
String moduleID = req.getName();
DeployableObjectType type = req.getType();
DeploymentServiceUtils.validate(moduleID,type,STOP_ACTION, req);
DeploymentStatus result = executePhases(req, stopPhaseList);
if (auditInfo != null) {
auditInfo.reportEnd(result.getStatus());
}
return result;
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | stop(com.sun.enterprise.deployment.backend.DeploymentRequest req)
return stop(req, createAuditInfoIfOn(req, AuditInfo.Operation.stop));
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | stop(java.lang.String moduleID, java.lang.String targetName, java.util.Map options)
try {
long startTime = System.currentTimeMillis();
DeployableObjectType type =
DeploymentServiceUtils.getRegisteredType(moduleID);
final DeploymentTarget target =
DeploymentServiceUtils.getDeploymentTarget(targetName);
InstanceEnvironment env =
ApplicationServer.getServerContext().getInstanceEnvironment();
DeploymentRequest req = new DeploymentRequest(
env,
type,
DeploymentCommand.UNDEPLOY);
int actionCode;
if(type.isAPP()) {
actionCode = BaseDeployEvent.APPLICATION_UNDEPLOYED;
}
else {
actionCode = BaseDeployEvent.MODULE_UNDEPLOYED;
}
req.setName(moduleID);
req.setActionCode(actionCode);
req.setTarget(target);
DeploymentProperties dProps = new DeploymentProperties(options);
req.setCascade(dProps.getCascade());
req.setForced(dProps.getForce());
req.setExternallyManagedPath(dProps.getExternallyManaged());
DeploymentServiceUtils.setResourceOptionsInRequest(req, dProps);
return stop(req, createAuditInfoIfOn(req, AuditInfo.Operation.stop, startTime));
} catch(Exception e) {
if (e instanceof IASDeploymentException) {
throw (IASDeploymentException)e;
}
else {
throw new IASDeploymentException(e);
}
}
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | undeploy(java.lang.String mModuleID, java.util.Map mParams)This method undeploys application from domain.
It constructs the DeploymentRequest using the parameters first.
sLogger.log(Level.FINE, "mbean.begin_undeploy", mModuleID);
try {
/*
*Save the current time to use in preparing the audit info later so
*the audit measurement includes all the logic below.
*/
long startTime = System.currentTimeMillis();
DeployableObjectType objectType =
DeploymentServiceUtils.getRegisteredType(mModuleID);
DeploymentServiceUtils.checkAppReferencesBeforeUndeployFromDomain(
mModuleID);
if (objectType.isWEB()) {
DeploymentServiceUtils.checkWebModuleReferences(mModuleID);
}
InstanceEnvironment env =
ApplicationServer.getServerContext().getInstanceEnvironment();
DeploymentRequest req = new DeploymentRequest(env,
objectType, DeploymentCommand.UNDEPLOY);
DeploymentRequestRegistry.getRegistry().addDeploymentRequest(
mModuleID, req);
DeploymentProperties dProps =
new DeploymentProperties(mParams);
req.setName(mModuleID);
req.setCascade(dProps.getCascade());
req.setExternallyManagedPath(dProps.getExternallyManaged());
DeploymentServiceUtils.setResourceOptionsInRequest(req, dProps);
req.addOptionalArguments(dProps.prune());
return undeploy(req, createAuditInfoIfOn(req, AuditInfo.Operation.undeploy, startTime));
}
catch(Exception e) {
String msg = localStrings.getString(
"enterprise.deployment.phasing.deploymentservice.undeploy.failed",
mModuleID, e.getLocalizedMessage());
sLogger.log(Level.WARNING, msg);
if (e instanceof IASDeploymentException) {
throw (IASDeploymentException)e;
}
else {
IASDeploymentException ias =
new IASDeploymentException(e.getLocalizedMessage());
ias.initCause(e);
throw ias;
}
}
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | undeploy(com.sun.enterprise.deployment.backend.DeploymentRequest req)This method undeploys application from DAS. Removes the application from
central repository and unregisters the application from config
return undeploy(req, createAuditInfoIfOn(req, AuditInfo.Operation.undeploy));
|
private com.sun.enterprise.deployment.backend.DeploymentStatus | undeploy(com.sun.enterprise.deployment.backend.DeploymentRequest req, com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo auditInfo)This method undeploys application from DAS. Removes the application from
central repository and unregisters the application from config, with
auditing if turned on.
DeploymentStatus result = null;
//Re-record instrospect/instrument/verifier data if
//any of the application is un-deployed
if (AppVerification.doInstrument()) {
AppVerification.getInstrumentLogger().handleChangeInDeployment();
}
String moduleID = req.getName();
DeployableObjectType type = req.getType();
DeploymentServiceUtils.validate(moduleID, type, UNDEPLOY_ACTION, req);
// undeploy from DAS
if (req.getTarget() != null) {
result = executePhases(req, undeployPhaseList);
// undeploy from domain
} else {
result = executePhases(req, undeployFromDomainPhaseList);
}
if (auditInfo != null) {
auditInfo.reportEnd(result.getStatus());
}
return result;
|