Methods Summary |
---|
public boolean | abortDeploy(java.lang.Object deployID)
final DeployThread deployThread = getDeployThread( deployID );
final boolean abortedSuccessfully = deployThread.quit();
issueDeploymentAbortedNotification( deployID );
return( abortedSuccessfully );
|
private DeployThread | addDeployThread(java.lang.Object deployID)
final DeploymentCallback callback =
new InternalDeploymentCallback( deployID );
final DeployThread deployThread =
new DeployThread( deployID, callback, null );
mDeployThreads.put( deployThread.getID(), deployThread );
return( deployThread );
|
public byte[] | downloadBytes(java.lang.Object downloadID, int requestSize)
return( getUploadDownloadMgr().downloadBytes( downloadID, requestSize ) );
|
private DeployThread | getDeployThread(java.lang.Object deployID)
final DeployThread deployThread = (DeployThread)mDeployThreads.get( deployID );
if ( deployThread == null )
{
final IllegalArgumentException e = new IllegalArgumentException( "" + deployID );
e.printStackTrace();
throw e;
}
return( deployThread );
|
public long | getDownloadLength(java.lang.Object downloadID)Get the total length the download will be, in bytes.
return( getUploadDownloadMgr().getDownloadLength( downloadID ) );
|
public java.util.Map | getFinalDeploymentStatus(java.lang.Object deployID)
final DeployThread deployThread = removeDeployThread( deployID );
if ( deployThread == null )
{
throw new IllegalArgumentException( deployID.toString() );
}
return( deployThread.getDeploymentStatus().asMap() );
|
protected java.util.Set | getNotificationTypes(java.util.Set existing)
existing.addAll( NOTIF_TYPES );
return existing;
|
private com.sun.appserv.management.base.UploadDownloadMgr | getUploadDownloadMgr()
return( getDomainRoot().getUploadDownloadMgr() );
|
public java.lang.Object | initDeploy()
final Object deployID = mDeployIDs.createID();
final DeployThread deployThread = addDeployThread( deployID );
return( deployID );
|
public java.lang.Object | initiateFileDownload(java.lang.String moduleID, java.lang.String filename)
final DownloadFileSource source = new DownloadFileSource( moduleID, filename );
final File theFile = source.getDownloadFile( );
final boolean deleteWhenDone = source.isTempFile();
return( getUploadDownloadMgr().initiateDownload( theFile, deleteWhenDone ) );
|
public java.lang.Object | initiateFileUpload(long totalSize)
return initiateFileUpload( null, totalSize );
|
public java.lang.Object | initiateFileUpload(java.lang.String name, long totalSize)
debug( "initiateFileUpload(" + name + ", " + totalSize + ")" );
return( getUploadDownloadMgr().initiateUpload( name, totalSize ) );
|
protected void | issueDeploymentAbortedNotification(java.lang.Object deployID)
final NotificationBuilder builder =
getNotificationBuilder( DEPLOYMENT_ABORTED_NOTIFICATION_TYPE );
final Notification notif = builder.buildNew( );
builder.putMapData( notif, NOTIF_DEPLOYMENT_ID_KEY, (Serializable)deployID );
issueNotification( deployID, notif );
|
protected void | issueDeploymentDoneNotification(java.lang.Object deployID, com.sun.appserv.management.deploy.DeploymentStatus deploymentStatus)
final NotificationBuilder builder =
getNotificationBuilder( DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE );
final Notification notif = builder.buildNew( );
builder.putMapData( notif, NOTIF_DEPLOYMENT_ID_KEY, (Serializable)deployID );
builder.putMapData( notif, NOTIF_DEPLOYMENT_COMPLETED_STATUS_KEY, (Serializable)deploymentStatus.asMap() );
issueNotification( deployID, notif );
|
protected void | issueDeploymentProgressNotification(java.lang.Object deployID, com.sun.appserv.management.deploy.DeploymentProgress progress)
final NotificationBuilder builder =
getNotificationBuilder( DEPLOYMENT_PROGRESS_NOTIFICATION_TYPE );
final Notification notif = builder.buildNew( );
builder.putMapData( notif, NOTIF_DEPLOYMENT_ID_KEY, (Serializable)deployID );
builder.putMapData( notif, NOTIF_DEPLOYMENT_PROGRESS_KEY, (Serializable)progress.asMap() );
issueNotification( deployID, notif );
|
protected void | issueDeploymentStartedNotification(java.lang.Object deployID)
final NotificationBuilder builder =
getNotificationBuilder( DEPLOYMENT_STARTED_NOTIFICATION_TYPE );
final Notification notif = builder.buildNew( );
builder.putMapData( notif, NOTIF_DEPLOYMENT_ID_KEY, (Serializable)deployID );
issueNotification( deployID, notif );
|
private void | issueNotification(java.lang.Object deployID, javax.management.Notification notif)
// send it, for normal callers
sendNotification( notif );
trace( "\nDeploymentMgrImpl.issueNotification: sent notification for " +
deployID + " = " + notif.toString() );
// queue it, for pollers
final DeployThread deployThread = getDeployThread( deployID );
deployThread.queueNotification( notif );
|
private boolean | notifsAreDone(javax.management.Notification[] notifs)
boolean done = false;
for( int i = notifs.length -1; i >= 0; --i )
{
final String notifType = notifs[ notifs.length - 1].getType();
if ( notifType.equals( DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE ) ||
notifType.equals( DEPLOYMENT_ABORTED_NOTIFICATION_TYPE ) )
{
done = true;
break;
}
}
return( done );
|
public void | remove(java.lang.String name)
throw new RuntimeException( "not applicable" );
|
private DeployThread | removeDeployThread(java.lang.Object deployID)
trace( "\n###Removing deploy thread: " + deployID );
return( (DeployThread)mDeployThreads.remove( deployID ) );
|
private final void | staleDeployCheck()Cleanup any threads that have been done for a proscribed
amount of time given by UPLOAD_KEEP_ALIVE_MILLIS. We don't want to clean them
up immediately because the client should have a reasonable chance to
get the status after completion.
final Set<Object> keySet = mDeployThreads.keySet();
synchronized( mDeployThreads )
{
final String[] deployIDs = GSetUtil.toStringArray( keySet );
for( final String deployID : deployIDs )
{
final DeployThread deployThread = (DeployThread)mDeployThreads.get( deployID );
if ( deployThread.getMillisSinceDone() > DEPLOY_KEEP_ALIVE_MILLIS )
{
removeDeployThread( deployID );
}
}
}
|
private void | startDeploy(java.lang.Object deployID, DeployThreadParams params)
final DeployThread deployThread = getDeployThread( deployID );
if ( deployThread == null )
{
throw new IllegalArgumentException( deployID.toString() );
}
deployThread.setParams( params );
/**
Issue a DEPLOYMENT_STARTED_NOTIFICATION_TYPE *before*
starting the thread, because a client could receive
other Notifications (even "done") before the "started" one.
*/
issueDeploymentStartedNotification( deployID );
deployThread.start();
|
public void | startDeploy(java.lang.Object deployID, java.lang.Object uploadID, java.lang.Object planUploadID, java.util.Map options)
staleDeployCheck();
final UploadDownloadMgr mgr = getUploadDownloadMgr();
final File deployFile = mgr.takeUpload( uploadID );
final File planFile = planUploadID == null ? null : mgr.takeUpload( planUploadID );
final DeployThreadParams params =
new DeployThreadParams(
getQueryMgr(),
options,
deployFile,
planFile );
startDeploy( deployID, params );
|
public void | startDeploy(java.lang.Object deployID, java.util.Map sourceData, java.util.Map planData, java.util.Map options)
final DeploymentSource source =
DeploymentSupport.mapToDeploymentSource( sourceData );
final DeploymentSource plan = planData == null ?
null : DeploymentSupport.mapToDeploymentSource( planData );
final DeployThreadParams params =
new DeployThreadParams( getQueryMgr(), options, source, plan );
startDeploy( deployID, params );
|
public javax.management.Notification[] | takeNotifications(java.lang.Object deployID)
final DeployThread deployThread = getDeployThread( deployID );
final Notification[] notifs = deployThread.takeNotifications();
return( notifs );
|
public java.util.Map | undeploy(java.lang.String moduleID, java.util.Map optionalParams)
final Undeployer undeployer = new Undeployer( moduleID, optionalParams );
final DeploymentStatus undeploymentStatus = undeployer.undeploy();
return( undeploymentStatus.asMap() );
|
public boolean | uploadBytes(java.lang.Object uploadID, byte[] bytes)
return( getUploadDownloadMgr().uploadBytes( uploadID, bytes ) );
|