FileDocCategorySizeDatePackage
ProgressObjectImpl.javaAPI DocJBoss 4.2.15206Fri Jul 13 20:52:32 BST 2007org.jboss.deployment.spi.status

ProgressObjectImpl

public class ProgressObjectImpl extends Object implements javax.enterprise.deploy.spi.status.ProgressObject
The ProgressObject interface tracks and reports the progress of the deployment activities, distribute, start, stop, undeploy.
author
thomas.diesler@jboss.org
version
$Revision: 62520 $

Fields Summary
private List
listeners
private DeploymentStatusImpl
deploymentStatus
private javax.enterprise.deploy.spi.TargetModuleID[]
targetModules
Constructors Summary
public ProgressObjectImpl(javax.enterprise.deploy.spi.status.DeploymentStatus deploymentStatus, javax.enterprise.deploy.spi.TargetModuleID[] targetModules)


       
   
      this.deploymentStatus = (DeploymentStatusImpl)deploymentStatus;
      this.targetModules = targetModules;
   
Methods Summary
public voidaddProgressListener(javax.enterprise.deploy.spi.status.ProgressListener listener)
Add a progress listener

param
listener the listener

      listeners.add(listener);
   
public voidcancel()
Cancels the deployment

throws
javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException when cancel is not supported

      throw new OperationUnsupportedException("cancel not supported");
   
public javax.enterprise.deploy.spi.status.ClientConfigurationgetClientConfiguration(javax.enterprise.deploy.spi.TargetModuleID id)
Return the client configuration associated with the module

param
id the module id
return
the client configuration or null if none exists

      return null; //[todo] implement method
   
public javax.enterprise.deploy.spi.status.DeploymentStatusgetDeploymentStatus()
Retrieve the status of the deployment

return
the status

      return deploymentStatus;
   
public javax.enterprise.deploy.spi.TargetModuleID[]getResultTargetModuleIDs()
Retrieve the resulting target module ids

return
the module ids

      return targetModules;
   
public booleanisCancelSupported()
Is cancel supported

return
true when cancel is supported, false otherwise

      return false;
   
public booleanisStopSupported()
Is stop supported

return
true when stop is supported, false otherwise

      return false;
   
public voidremoveProgressListener(javax.enterprise.deploy.spi.status.ProgressListener listener)
Remove a progress listener

param
listener the listener

      listeners.remove(listener);
   
public voidsendProgressEvent(javax.enterprise.deploy.shared.StateType stateType, java.lang.String message, javax.enterprise.deploy.spi.TargetModuleID moduleID)
Set the current deployment status

      deploymentStatus.setStateType(stateType);
      deploymentStatus.setMessage(message);
      ProgressEvent progressEvent = new ProgressEvent(this, moduleID, deploymentStatus);
      for (int i = 0; i < listeners.size(); i++)
      {
         ProgressListener progressListener = (ProgressListener)listeners.get(i);
         progressListener.handleProgressEvent(progressEvent);
      }
   
public voidstop()
Stops the deployment

throws
javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException when stop is not supported

      throw new OperationUnsupportedException("stop not supported");
   
public java.lang.StringtoString()

      StringBuffer sbuf = new StringBuffer();
      sbuf.append("[ deploymentStatus=").append(deploymentStatus);
      for (int i = 0; i < targetModules.length; i++)
      {
         sbuf.append(", ").append(targetModules[i]);
      }
      sbuf.append(" ]");
      
      return sbuf.toString();