Java EE 5 SDK

com.sun.appserv.management.helper
Class DeployNotificationListener

java.lang.Object
  extended by com.sun.appserv.management.helper.DeployNotificationListener
All Implemented Interfaces:
EventListener, NotificationListener

public class DeployNotificationListener
extends Object
implements NotificationListener

A NotificationListener designed to listen to the DeploymentMgr.

Note that Notifications are not guaranteed to be delivered in order. Thus, it is theoretically possible for a DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE to be received before a DEPLOYMENT_STARTED_NOTIFICATION_TYPE.

A subclass may choose to override deploymentStarted(javax.management.Notification), deploymentProgress(javax.management.Notification, com.sun.appserv.management.deploy.DeploymentProgress) and

Since:
AppServer 9.0

Constructor Summary
DeployNotificationListener(DeploymentMgr deploymentMgr, Object deployID)
           
 
Method Summary
 void cleanup()
          Clean things up.
protected  void deploymentAborted(Notification notif, DeploymentStatus status)
          Deployment has been cancelled.
protected  void deploymentDone(Notification notif, DeploymentStatus status)
          Deployment has finished.
protected  void deploymentProgress(Notification notif, DeploymentProgress status)
          Deployment progress.
protected  void deploymentStarted(Notification notif)
          Deployment has begun.
 Object getDeployID()
           
 DeploymentMgr getDeploymentMgr()
           
 DeploymentProgress getDeploymentProgress()
           
 DeploymentStatus getDeploymentStatus()
           
 void handleNotification(Notification notif, Object handback)
          Callback for all Notifications occurring during deployment.
 boolean isCompleted()
          Return true if deployment has finished.
protected  void realHandleNotification(Notification notif, Object handback)
          Handle a received Notification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeployNotificationListener

public DeployNotificationListener(DeploymentMgr deploymentMgr,
                                  Object deployID)
Method Detail

getDeploymentMgr

public DeploymentMgr getDeploymentMgr()
Returns:
the DeploymentMgr in use for deployment.

getDeployID

public Object getDeployID()
Returns:
the deployID this listener responds to

isCompleted

public boolean isCompleted()
Return true if deployment has finished.


getDeploymentStatus

public DeploymentStatus getDeploymentStatus()
Returns:
DeploymentStatus, may be null if not finished or abnormally terminated.

getDeploymentProgress

public DeploymentProgress getDeploymentProgress()
Returns:
the latest DeploymentProgress, may be null

handleNotification

public void handleNotification(Notification notif,
                               Object handback)
Callback for all Notifications occurring during deployment. Note for public use.

Specified by:
handleNotification in interface NotificationListener

deploymentDone

protected void deploymentDone(Notification notif,
                              DeploymentStatus status)
Deployment has finished. For convenience, the DeploymentStatus has been extracted from the Notification.


deploymentAborted

protected void deploymentAborted(Notification notif,
                                 DeploymentStatus status)
Deployment has been cancelled. There may or may not be a DeploymentStatus.


deploymentProgress

protected void deploymentProgress(Notification notif,
                                  DeploymentProgress status)
Deployment progress. For convenience, the DeploymentProgress has been extracted from the Notification.


deploymentStarted

protected void deploymentStarted(Notification notif)
Deployment has begun. The Notification contains no additional data.


cleanup

public void cleanup()
Clean things up. This mainly means removing this listener from the DeploymentMgr.


realHandleNotification

protected final void realHandleNotification(Notification notif,
                                            Object handback)
Handle a received Notification.


Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.