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 void
addProgressListener(javax.enterprise.deploy.spi.status.ProgressListener listener)
void
cancel()
Always throwsOperationUnsupportedException
boolean
checkStatusAndAddStage(TargetImpl aTarget, String action, DFDeploymentStatus currentStatus)
Given a Deployment status, this checks if the status is success.protected void
fireProgressEvent(javax.enterprise.deploy.spi.status.ProgressEvent progressEvent)
Notifies all listeners that have registered interest for ProgressEvent notification.javax.enterprise.deploy.spi.status.ClientConfiguration
getClientConfiguration(javax.enterprise.deploy.spi.TargetModuleID id)
javax.enterprise.deploy.shared.CommandType
getCommandType()
DFDeploymentStatus
getCompletedStatus()
Returns null until final deployment status available.javax.enterprise.deploy.spi.status.DeploymentStatus
getDeploymentStatus()
javax.enterprise.deploy.shared.ModuleType
getModuleType()
javax.enterprise.deploy.spi.TargetModuleID[]
getResultTargetModuleIDs()
boolean
isCancelSupported()
Always returns falseboolean
isStopSupported()
Always returns truevoid
removeProgressListener(javax.enterprise.deploy.spi.status.ProgressListener listener)
Remove a ProgressObject listener.void
setCommand(javax.enterprise.deploy.shared.CommandType commandType)
Sets the command type.void
setModuleID(String moduleId)
Sets the ID of the module.void
setModuleType(javax.enterprise.deploy.shared.ModuleType moduleType)
Sets the module type for this deployed modulevoid
setupForAbnormalExit(String errorMsg, TargetImpl aTarget)
Notifies listeners about the action failure.void
setupForNormalExit(String message, TargetImpl aTarget, TargetModuleIDImpl[] tmids)
Notifies listeners about an action success (even with warning).void
stop()
Always throws OperationUnsupportedExceptionstatic TargetImpl
toTargetImpl(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.OperationUnsupportedException
Always 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:
getCompletedStatus
in 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.OperationUnsupportedException
Always 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
-
-