Methods Summary |
---|
private com.sun.appserv.management.deploy.DeploymentStatusImpl | deploy(DeployThreadParams params, DeploymentCallback callback)
try {
Map options = params.getOptions();
File deployFile = params.getDeployFile();
File planFile = params.getPlanFile();
if (deployFile == null) {
DeploymentSource deploySource = params.getDeploymentSource();
if (deploySource != null) {
deployFile = deploySource.getArchive();
}
DeploymentSource deployPlan = params.getDeploymentPlan();
if (deployPlan != null) {
planFile = deployPlan.getArchive();
}
}
DeploymentProperties dProps = new DeploymentProperties(options);
String archiveName = dProps.getArchiveName();
if (archiveName == null && deployFile != null) {
archiveName = deployFile.getAbsolutePath();
if (deployFile.isDirectory()) {
moduleID = dProps.getName(archiveName);
} else {
//In case the archive was passed in as an MemoryArchive,
//ie. no file name available to a default moduleID, ask
//the backend to supply a computed moduleID (using display
//name in dd)
String computedID =
DeploymentService.getDeploymentService().getModuleIDFromDD(deployFile);
moduleID = dProps.getProperty(
DeploymentProperties.NAME, computedID);
}
} else {
moduleID = dProps.getName(archiveName);
}
com.sun.enterprise.deployment.backend.DeploymentStatus ds = DeploymentService.getDeploymentService().deploy(deployFile, planFile, archiveName, moduleID, dProps, callback);
ds.setStageStatus(ds.getStatus()); // This is done for the AMX clients to get complete status
DeploymentRequestRegistry.getRegistry().removeDeploymentRequest(
moduleID);
final Map<String,Serializable> m =
TypeCast.checkMap( ds.asMap(), String.class, Serializable.class );
return new DeploymentStatusImpl( m );
} catch(Exception e) {
com.sun.enterprise.deployment.backend.DeploymentStatus ds =
new com.sun.enterprise.deployment.backend.DeploymentStatus();
ds.setStageException(e);
ds.setStageStatus(com.sun.enterprise.deployment.backend.DeploymentStatus.FAILURE);
ds.setStageStatusMessage(e.getMessage());
ds.setStageDescription("Deployment");
DeploymentRequestRegistry.getRegistry().removeDeploymentRequest(
moduleID);
final Map<String,Serializable> m =
TypeCast.checkMap( ds.asMap(), String.class, Serializable.class );
return new DeploymentStatusImpl( m );
}
|
public com.sun.appserv.management.deploy.DeploymentStatus | getDeploymentStatus()
return( mDeploymentStatus );
|
public java.lang.Object | getID()
return( mDeployID );
|
public long | getMillisSinceDone()
return( isDone() ? (System.currentTimeMillis() - mDoneMillis) : 0 );
|
public boolean | isDone()
return( mDone );
|
public void | queueNotification(javax.management.Notification notif)
if ( isDone() ) {
throw new IllegalArgumentException(
"Notification cannot be queued after being done for: " +
mDeployID);
}
synchronized( mQueuedNotifications ) {
mQueuedNotifications.add( notif );
}
|
public boolean | quit()
mQuit = true;
return DeploymentService.getDeploymentService().quit(moduleID);
|
public void | run()
mDone = false;
trace( "DeployThread.run: starting: " + getID() );
if ( mParams == null ) {
throw new IllegalArgumentException( "no params specified" );
}
trace( "DeployThread.run: calling deploy() for: " + getID() );
mDeploymentStatus = deploy( mParams, mDeploymentCallback );
trace( "DeployThread.run: deploy() successful for: " + getID() );
mDeploymentCallback.deploymentDone( mDeploymentStatus );
// success or failure, always kill the file
if ( mParams.getDeployFile() != null ) {
trace( "DeployThread.run: deleting deploy file: " + mParams.getDeployFile() );
mParams.getDeployFile().delete();
}
// success or failure, always kill the file
if ( mParams.getPlanFile() != null ) {
trace( "DeployThread.run: deleting plan file: " + mParams.getPlanFile() );
mParams.getPlanFile().delete();
}
mDoneMillis = System.currentTimeMillis();
mDone = true;
trace( "DeployThread.run: done with: " + getID() );
|
public void | setParams(DeployThreadParams params)
if ( mParams != null ) {
throw new IllegalArgumentException();
}
mParams = params;
|
public javax.management.Notification[] | takeNotifications()
Notification[] notifs = null;
synchronized( mQueuedNotifications ) {
notifs = new Notification[ mQueuedNotifications.size() ];
mQueuedNotifications.toArray( notifs );
mQueuedNotifications.clear();
}
return( notifs );
|
private void | trace(java.lang.Object o)
final String name = this.getClass().getName();
Logger.getLogger( name ).fine( o.toString() );
|