Methods Summary |
---|
public void | cleanup()Clean things up. This mainly means
removing this listener from the DeploymentMgr.
try
{
mDeploymentMgr.removeNotificationListener( this, null, null );
}
catch( ListenerNotFoundException e )
{
}
|
protected void | deploymentAborted(javax.management.Notification notif, com.sun.appserv.management.deploy.DeploymentStatus status)Deployment has been cancelled. There may or may not be a
DeploymentStatus.
mIsCompleted = true;
mDeploymentStatus = status;
|
protected void | deploymentDone(javax.management.Notification notif, com.sun.appserv.management.deploy.DeploymentStatus status)Deployment has finished. For convenience, the DeploymentStatus
has been extracted from the Notification.
//SampleUtil.println( "Deployment completed for " + deployID + " with status: " +
//status.getStageStatus() );
mIsCompleted = true;
mDeploymentStatus = status;
|
protected void | deploymentProgress(javax.management.Notification notif, com.sun.appserv.management.deploy.DeploymentProgress status)Deployment progress. For convenience, the DeploymentProgress
has been extracted from the Notification.
mDeploymentProgress = status;
|
protected void | deploymentStarted(javax.management.Notification notif)Deployment has begun. The Notification contains no additional
data.
|
public java.lang.Object | getDeployID()
return mDeployID;
|
public com.sun.appserv.management.deploy.DeploymentMgr | getDeploymentMgr()
return mDeploymentMgr;
|
public com.sun.appserv.management.deploy.DeploymentProgress | getDeploymentProgress()
return( mDeploymentProgress );
|
public com.sun.appserv.management.deploy.DeploymentStatus | getDeploymentStatus()
return( mDeploymentStatus );
|
public synchronized void | handleNotification(javax.management.Notification notif, java.lang.Object handback)Callback for all Notifications occurring during deployment.
Note for public use.
try
{
realHandleNotification( notif, handback );
}
catch( Exception e )
{
e.printStackTrace();
}
|
public boolean | isCompleted()Return true if deployment has finished.
return( mIsCompleted );
|
protected final void | realHandleNotification(javax.management.Notification notif, java.lang.Object handback)Handle a received Notification.
final String type = notif.getType();
final Map<String,?> m = TypeCast.asMap( notif.getUserData() );
final Object deployID = m.get( DeploymentMgr.NOTIF_DEPLOYMENT_ID_KEY );
if ( deployID.equals( mDeployID ) )
{
if ( type.equals( DeploymentMgr.DEPLOYMENT_STARTED_NOTIFICATION_TYPE ) )
{
deploymentStarted( notif );
}
else if ( type.equals( DeploymentMgr.DEPLOYMENT_ABORTED_NOTIFICATION_TYPE ) )
{
try
{
deploymentAborted( notif, null );
}
finally
{
cleanup();
}
}
else if ( type.equals( DeploymentMgr.DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE ) )
{
final Map<String,Serializable> statusData = (Map<String,Serializable>)
Util.getAMXNotificationValue( notif, NOTIF_DEPLOYMENT_COMPLETED_STATUS_KEY );
final DeploymentStatus status =
DeploymentSupport.mapToDeploymentStatus( statusData );
try
{
deploymentDone( notif, status );
}
finally
{
cleanup();
}
}
else if ( type.equals( DeploymentMgr.DEPLOYMENT_PROGRESS_NOTIFICATION_TYPE ) )
{
final Map<String,Serializable> statusData = (Map<String,Serializable>)
Util.getAMXNotificationValue( notif, NOTIF_DEPLOYMENT_PROGRESS_KEY );
final DeploymentProgress progress =
DeploymentSupport.mapToDeploymentProgress( statusData );
deploymentProgress( notif, progress );
}
}
|