org.glassfish.deployapi
Class ProgressObjectImpl

java.lang.Object
  extended by org.glassfish.deployment.client.DFProgressObject
      extended by org.glassfish.deployapi.ProgressObjectImpl
All Implemented Interfaces:
ProgressObject

public class ProgressObjectImpl
extends DFProgressObject

Implementation of the Progress Object

Author:
dochez, tjquinn

Field Summary
protected  Object[] args
           
protected  CommandType commandType
           
protected  Vector deliveredEvents
           
protected  boolean deployActionCompleted
           
protected  DeploymentStatusImpl deploymentStatus
           
protected  DFDeploymentStatus finalDeploymentStatus
           
protected  String moduleID
           
protected  ModuleType moduleType
           
protected  TargetImpl target
           
protected  TargetModuleID[] targetModuleIDs
           
protected  TargetImpl[] targetsList
           
protected  String warningMessages
           
 
Constructor Summary
ProgressObjectImpl(Target target)
           
ProgressObjectImpl(Target[] targets)
           
ProgressObjectImpl(TargetImpl target)
          Creates a new instance of ProgressObjectImpl
ProgressObjectImpl(TargetImpl[] targets)
           
 
Method Summary
 void addProgressListener(ProgressListener pol)
          Add a listener to receive Progress events on deployment actions.
 void cancel()
          (optional) A cancel request on an in-process operation stops all further processing of the operation and returns the environment to it original state before the operation was executed.
 boolean checkStatusAndAddStage(TargetImpl aTarget, String action, DFDeploymentStatus currentStatus)
          Given a Deployment status, this checks if the status is success
protected  void fireProgressEvent(ProgressEvent progressEvent)
          Notifies all listeners that have registered interest for ProgressEvent notification.
protected  void fireProgressEvent(StateType state, String message)
          Notifies all listeners that have registered interest for ProgressEvent notification.
protected  void fireProgressEvent(StateType state, String message, TargetImpl aTarget)
          Notifies all listeners that have registered interest for ProgressEvent notification.
 ClientConfiguration getClientConfiguration(TargetModuleID id)
          Return the ClientConfiguration object associated with the TargetModuleID.
 DFDeploymentStatus getCompletedStatus()
          Retrieve the final deployment status which has complete details for each stage
 DeploymentStatus getDeploymentStatus()
          Retrieve the status of this activity.
 ModuleType getModuleType()
           
 TargetModuleID[] getResultTargetModuleIDs()
          Retrieve the list of TargetModuleIDs successfully processed or created by the associated DeploymentManager operation.
protected  String getThrowableString(Throwable t)
          Since DeploymentStatus only provides the ability to pass a String to the ProgressListener, the following is a convenience method for allowing the stack-trace from a Throwable to be converted to a String to send to the ProgressListeners.
protected  void initializeTargetModuleIDs(String moduleID)
          initialize the target module IDs with the passed application moduleID and the descriptors
 boolean isCancelSupported()
          Tests whether the vendor supports a cancel opertation for deployment activities.
 boolean isStopSupported()
          Tests whether the vendor supports a stop opertation for deployment activities.
 void removeProgressListener(ProgressListener pol)
          Remove a ProgressObject listener.
 void setCommand(CommandType commandType, Object[] args)
           
 void setModuleID(String id)
           
 void setModuleType(ModuleType moduleType)
          Sets the module type for this deployed module
 void setupForAbnormalExit(String errorMsg, TargetImpl aTarget)
           
 void setupForNormalExit(String message, TargetImpl aTarget, TargetModuleIDImpl[] tmids)
           
 void stop()
          (optional) A stop request on an in-process operation allows the operation on the current TargetModuleID to run to completion but does not process any of the remaining unprocessed TargetModuleID objects.
static TargetImpl toTargetImpl(Target target)
           
static TargetImpl[] toTargetImpl(Target[] targets)
           
 
Methods inherited from class org.glassfish.deployment.client.DFProgressObject
waitFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandType

protected CommandType commandType

args

protected Object[] args

target

protected TargetImpl target

targetsList

protected TargetImpl[] targetsList

moduleID

protected String moduleID

moduleType

protected ModuleType moduleType

deploymentStatus

protected DeploymentStatusImpl deploymentStatus

targetModuleIDs

protected TargetModuleID[] targetModuleIDs

deliveredEvents

protected Vector deliveredEvents

finalDeploymentStatus

protected DFDeploymentStatus finalDeploymentStatus

deployActionCompleted

protected boolean deployActionCompleted

warningMessages

protected String warningMessages
Constructor Detail

ProgressObjectImpl

public ProgressObjectImpl(TargetImpl target)
Creates a new instance of ProgressObjectImpl


ProgressObjectImpl

public ProgressObjectImpl(TargetImpl[] targets)

ProgressObjectImpl

public ProgressObjectImpl(Target[] targets)

ProgressObjectImpl

public ProgressObjectImpl(Target target)
Method Detail

toTargetImpl

public static TargetImpl toTargetImpl(Target target)

toTargetImpl

public static TargetImpl[] toTargetImpl(Target[] targets)

addProgressListener

public void addProgressListener(ProgressListener pol)
Add a listener to receive Progress events on deployment actions.

Parameters:
The - listener to receive events
See Also:
ProgressEvent

cancel

public void cancel()
            throws OperationUnsupportedException
(optional) A cancel request on an in-process operation stops all further processing of the operation and returns the environment to it original state before the operation was executed. An operation that has run to completion cannot be cancelled.

Throws:
OperationUnsupportedException - this optional command is not supported by this implementation.

getClientConfiguration

public ClientConfiguration getClientConfiguration(TargetModuleID id)
Return the ClientConfiguration object associated with the TargetModuleID.

Returns:
ClientConfiguration for a given TargetModuleID or null if none exists.

getDeploymentStatus

public DeploymentStatus getDeploymentStatus()
Retrieve the status of this activity.

Returns:
An object containing the status information.

getCompletedStatus

public DFDeploymentStatus getCompletedStatus()
Retrieve the final deployment status which has complete details for each stage

Specified by:
getCompletedStatus in class DFProgressObject
Returns:
the deployment status

getResultTargetModuleIDs

public TargetModuleID[] getResultTargetModuleIDs()
Retrieve the list of TargetModuleIDs successfully processed or created by the associated DeploymentManager operation.

Returns:
a list of TargetModuleIDs.

setModuleID

public void setModuleID(String id)

initializeTargetModuleIDs

protected void initializeTargetModuleIDs(String moduleID)
initialize the target module IDs with the passed application moduleID and the descriptors


isCancelSupported

public boolean isCancelSupported()
Tests whether the vendor supports a cancel opertation for deployment activities.

Returns:
true if canceling an activity is supported by this platform.

isStopSupported

public boolean isStopSupported()
Tests whether the vendor supports a stop opertation for deployment activities.

Returns:
true if canceling an activity is supported by this platform.

removeProgressListener

public void removeProgressListener(ProgressListener pol)
Remove a ProgressObject listener.

Parameters:
The - listener being removed
See Also:
ProgressEvent

stop

public void stop()
          throws OperationUnsupportedException
(optional) A stop request on an in-process operation allows the operation on the current TargetModuleID to run to completion but does not process any of the remaining unprocessed TargetModuleID objects. The processed TargetModuleIDs must be returned by the method getResultTargetModuleIDs.

Throws:
OperationUnsupportedException - this optional command is not supported by this implementation.

setCommand

public void setCommand(CommandType commandType,
                       Object[] args)

fireProgressEvent

protected void fireProgressEvent(ProgressEvent progressEvent)
Notifies all listeners that have registered interest for ProgressEvent notification.


fireProgressEvent

protected void fireProgressEvent(StateType state,
                                 String message)
Notifies all listeners that have registered interest for ProgressEvent notification.


fireProgressEvent

protected void fireProgressEvent(StateType state,
                                 String message,
                                 TargetImpl aTarget)
Notifies all listeners that have registered interest for ProgressEvent notification.


setModuleType

public void setModuleType(ModuleType moduleType)
Sets the module type for this deployed module

Parameters:
the - module type

getModuleType

public ModuleType getModuleType()
Returns:
the module type of this deployed module

getThrowableString

protected String getThrowableString(Throwable t)
Since DeploymentStatus only provides the ability to pass a String to the ProgressListener, the following is a convenience method for allowing the stack-trace from a Throwable to be converted to a String to send to the ProgressListeners.


setupForNormalExit

public void setupForNormalExit(String message,
                               TargetImpl aTarget,
                               TargetModuleIDImpl[] tmids)

setupForAbnormalExit

public void setupForAbnormalExit(String errorMsg,
                                 TargetImpl aTarget)

checkStatusAndAddStage

public boolean checkStatusAndAddStage(TargetImpl aTarget,
                                      String action,
                                      DFDeploymentStatus currentStatus)
Given a Deployment status, this checks if the status is success



Copyright © 2012. All Rights Reserved.