Package org.glassfish.deployapi
Class ProgressObjectImpl
- java.lang.Object
-
- org.glassfish.deployment.client.DFProgressObject
-
- org.glassfish.deployapi.ProgressObjectImpl
-
- All Implemented Interfaces:
javax.enterprise.deploy.spi.status.ProgressObject
public class ProgressObjectImpl extends DFProgressObject
Implementation of the Progress Object- Author:
- dochez, tjquinn, David Matejcek
-
-
Constructor Summary
Constructors Constructor Description ProgressObjectImpl(javax.enterprise.deploy.spi.Target target)ProgressObjectImpl(javax.enterprise.deploy.spi.Target[] targets)ProgressObjectImpl(TargetImpl target)Creates a new instance of ProgressObjectImplProgressObjectImpl(TargetImpl[] targets)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProgressListener(javax.enterprise.deploy.spi.status.ProgressListener listener)voidcancel()Always throwsOperationUnsupportedExceptionbooleancheckStatusAndAddStage(TargetImpl aTarget, String action, DFDeploymentStatus currentStatus)Given a Deployment status, this checks if the status is success.protected voidfireProgressEvent(javax.enterprise.deploy.spi.status.ProgressEvent progressEvent)Notifies all listeners that have registered interest for ProgressEvent notification.javax.enterprise.deploy.spi.status.ClientConfigurationgetClientConfiguration(javax.enterprise.deploy.spi.TargetModuleID id)javax.enterprise.deploy.shared.CommandTypegetCommandType()DFDeploymentStatusgetCompletedStatus()Returns null until final deployment status available.javax.enterprise.deploy.spi.status.DeploymentStatusgetDeploymentStatus()javax.enterprise.deploy.shared.ModuleTypegetModuleType()javax.enterprise.deploy.spi.TargetModuleID[]getResultTargetModuleIDs()booleanisCancelSupported()Always returns falsebooleanisStopSupported()Always returns truevoidremoveProgressListener(javax.enterprise.deploy.spi.status.ProgressListener listener)Remove a ProgressObject listener.voidsetCommand(javax.enterprise.deploy.shared.CommandType commandType)Sets the command type.voidsetModuleID(String moduleId)Sets the ID of the module.voidsetModuleType(javax.enterprise.deploy.shared.ModuleType moduleType)Sets the module type for this deployed modulevoidsetupForAbnormalExit(String errorMsg, TargetImpl aTarget)Notifies listeners about the action failure.voidsetupForNormalExit(String message, TargetImpl aTarget, TargetModuleIDImpl[] tmids)Notifies listeners about an action success (even with warning).voidstop()Always throws OperationUnsupportedExceptionstatic TargetImpltoTargetImpl(javax.enterprise.deploy.spi.Target target)-
Methods inherited from class org.glassfish.deployment.client.DFProgressObject
waitFor
-
-
-
-
Constructor Detail
-
ProgressObjectImpl
public ProgressObjectImpl(TargetImpl target)
Creates a new instance of ProgressObjectImpl
-
ProgressObjectImpl
public ProgressObjectImpl(TargetImpl[] targets)
-
ProgressObjectImpl
public ProgressObjectImpl(javax.enterprise.deploy.spi.Target[] targets)
-
ProgressObjectImpl
public ProgressObjectImpl(javax.enterprise.deploy.spi.Target target)
-
-
Method Detail
-
toTargetImpl
public static TargetImpl toTargetImpl(javax.enterprise.deploy.spi.Target target)
-
addProgressListener
public void addProgressListener(javax.enterprise.deploy.spi.status.ProgressListener listener)
-
getCommandType
public javax.enterprise.deploy.shared.CommandType getCommandType()
- Returns:
CommandType, may be null.
-
setCommand
public void setCommand(javax.enterprise.deploy.shared.CommandType commandType)
Sets the command type.- Parameters:
commandType-- See Also:
CommandType
-
setModuleID
public void setModuleID(String moduleId)
Sets the ID of the module.- Parameters:
moduleId-
-
setModuleType
public void setModuleType(javax.enterprise.deploy.shared.ModuleType moduleType)
Sets the module type for this deployed module- Parameters:
moduleType- the module type
-
getModuleType
public javax.enterprise.deploy.shared.ModuleType getModuleType()
- Returns:
- the module type of this deployed module
-
cancel
public void cancel() throws javax.enterprise.deploy.spi.exceptions.OperationUnsupportedExceptionAlways throwsOperationUnsupportedException- Throws:
javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
-
getClientConfiguration
public javax.enterprise.deploy.spi.status.ClientConfiguration getClientConfiguration(javax.enterprise.deploy.spi.TargetModuleID id)
- Returns:
- always null.
-
getDeploymentStatus
public javax.enterprise.deploy.spi.status.DeploymentStatus getDeploymentStatus()
-
getCompletedStatus
public DFDeploymentStatus getCompletedStatus()
Returns null until final deployment status available.- Specified by:
getCompletedStatusin classDFProgressObject- Returns:
- the deployment status
-
getResultTargetModuleIDs
public javax.enterprise.deploy.spi.TargetModuleID[] getResultTargetModuleIDs()
-
isCancelSupported
public boolean isCancelSupported()
Always returns false- Returns:
false
-
isStopSupported
public boolean isStopSupported()
Always returns true- Returns:
true
-
removeProgressListener
public void removeProgressListener(javax.enterprise.deploy.spi.status.ProgressListener listener)
Remove a ProgressObject listener.- Parameters:
listener- the listener being removed- See Also:
ProgressEvent
-
stop
public void stop() throws javax.enterprise.deploy.spi.exceptions.OperationUnsupportedExceptionAlways throws OperationUnsupportedException- Throws:
javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException- this optional command is not supported by this implementation.
-
fireProgressEvent
protected void fireProgressEvent(javax.enterprise.deploy.spi.status.ProgressEvent progressEvent)
Notifies all listeners that have registered interest for ProgressEvent notification.- Parameters:
progressEvent-ProgressEvent
-
setupForNormalExit
public void setupForNormalExit(String message, TargetImpl aTarget, TargetModuleIDImpl[] tmids)
Notifies listeners about an action success (even with warning).- Parameters:
message-aTarget-tmids-
-
setupForAbnormalExit
public void setupForAbnormalExit(String errorMsg, TargetImpl aTarget)
Notifies listeners about the action failure.- Parameters:
errorMsg-aTarget-
-
checkStatusAndAddStage
public boolean checkStatusAndAddStage(TargetImpl aTarget, String action, DFDeploymentStatus currentStatus)
Given a Deployment status, this checks if the status is success. If not, callssetupForAbnormalExit(String, TargetImpl)- Parameters:
aTarget-action-currentStatus-- Returns:
- true if the currentStatus is success
-
-