Package org.glassfish.deployapi
Class ProgressObjectSink
- java.lang.Object
-
- org.glassfish.deployment.client.DFProgressObject
-
- org.glassfish.deployapi.ProgressObjectSink
-
- All Implemented Interfaces:
EventListener
,javax.enterprise.deploy.spi.status.ProgressListener
,javax.enterprise.deploy.spi.status.ProgressObject
public class ProgressObjectSink extends DFProgressObject implements javax.enterprise.deploy.spi.status.ProgressListener
This class acts as a sink for ProgressObject. It registers itself as ProgressObject listener for multiple deployment actions and tunnel all events to registered ProgressObject listener.Whenever this class receives a progress event from one of its sources (one of the deploymentFacility actions) it forwards that event on to the sink's listeners, changing the state of the event to "running." Then, after the sink receives the completion or failure event from the last source, it forwards that event as running (as it had all earlier events) and then sends one final aggregate completion or failure event.
The sink always follows this pattern, even if it encapsulates only a single source. JSR88 clients should be aware of this behavior.
- Author:
- Jerome Dochez
-
-
Constructor Summary
Constructors Constructor Description ProgressObjectSink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProgressListener(javax.enterprise.deploy.spi.status.ProgressListener progressListener)
Register a new ProgressListenervoid
cancel()
javax.enterprise.deploy.spi.status.ClientConfiguration
getClientConfiguration(javax.enterprise.deploy.spi.TargetModuleID targetModuleID)
DFDeploymentStatus
getCompletedStatus()
Report completed status for deploytool.javax.enterprise.deploy.spi.status.DeploymentStatus
getDeploymentStatus()
javax.enterprise.deploy.spi.TargetModuleID[]
getResultTargetModuleIDs()
void
handleProgressEvent(javax.enterprise.deploy.spi.status.ProgressEvent progressEvent)
receives notification of a progress event from one of our registered interface.boolean
isCancelSupported()
boolean
isStopSupported()
void
removeProgressListener(javax.enterprise.deploy.spi.status.ProgressListener progressListener)
removes a ProgressListener from our list of listenersvoid
sinkProgressObject(javax.enterprise.deploy.spi.status.ProgressObject source)
register to a new ProgressObject for ProgressEvent notificationsvoid
stop()
-
Methods inherited from class org.glassfish.deployment.client.DFProgressObject
waitFor
-
-
-
-
Method Detail
-
sinkProgressObject
public void sinkProgressObject(javax.enterprise.deploy.spi.status.ProgressObject source)
register to a new ProgressObject for ProgressEvent notifications
-
handleProgressEvent
public void handleProgressEvent(javax.enterprise.deploy.spi.status.ProgressEvent progressEvent)
receives notification of a progress event from one of our registered interface.- Specified by:
handleProgressEvent
in interfacejavax.enterprise.deploy.spi.status.ProgressListener
-
addProgressListener
public void addProgressListener(javax.enterprise.deploy.spi.status.ProgressListener progressListener)
Register a new ProgressListener- Specified by:
addProgressListener
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
- Parameters:
the
- new listener instance
-
removeProgressListener
public void removeProgressListener(javax.enterprise.deploy.spi.status.ProgressListener progressListener)
removes a ProgressListener from our list of listeners- Specified by:
removeProgressListener
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
- Parameters:
the
- ProgressListener to remove
-
getClientConfiguration
public javax.enterprise.deploy.spi.status.ClientConfiguration getClientConfiguration(javax.enterprise.deploy.spi.TargetModuleID targetModuleID)
- Specified by:
getClientConfiguration
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
-
getDeploymentStatus
public javax.enterprise.deploy.spi.status.DeploymentStatus getDeploymentStatus()
- Specified by:
getDeploymentStatus
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
-
getResultTargetModuleIDs
public javax.enterprise.deploy.spi.TargetModuleID[] getResultTargetModuleIDs()
- Specified by:
getResultTargetModuleIDs
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
-
isCancelSupported
public boolean isCancelSupported()
- Specified by:
isCancelSupported
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
-
isStopSupported
public boolean isStopSupported()
- Specified by:
isStopSupported
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
-
cancel
public void cancel() throws javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
- Specified by:
cancel
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
- Throws:
javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
-
stop
public void stop() throws javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
- Specified by:
stop
in interfacejavax.enterprise.deploy.spi.status.ProgressObject
- Throws:
javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
-
getCompletedStatus
public DFDeploymentStatus getCompletedStatus()
Report completed status for deploytool.- Specified by:
getCompletedStatus
in classDFProgressObject
- Returns:
- null if not completed, or the DFDeploymentStatus set to reflect the completion
-
-