org.glassfish.deployapi
Class ProgressObjectSink

java.lang.Object
  extended by org.glassfish.deployment.client.DFProgressObject
      extended by org.glassfish.deployapi.ProgressObjectSink
All Implemented Interfaces:
EventListener, ProgressListener, ProgressObject

public class ProgressObjectSink
extends DFProgressObject
implements 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
ProgressObjectSink()
           
 
Method Summary
 void addProgressListener(ProgressListener progressListener)
          Register a new ProgressListener
 void cancel()
           
 ClientConfiguration getClientConfiguration(TargetModuleID targetModuleID)
           
 DFDeploymentStatus getCompletedStatus()
          Report completed status for deploytool.
 DeploymentStatus getDeploymentStatus()
           
 TargetModuleID[] getResultTargetModuleIDs()
           
 void handleProgressEvent(ProgressEvent progressEvent)
          receives notification of a progress event from one of our registered interface.
 boolean isCancelSupported()
           
 boolean isStopSupported()
           
 void removeProgressListener(ProgressListener progressListener)
          removes a ProgressListener from our list of listeners
 void sinkProgressObject(ProgressObject source)
          register to a new ProgressObject for ProgressEvent notifications
 void stop()
           
 
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
 

Constructor Detail

ProgressObjectSink

public ProgressObjectSink()
Method Detail

sinkProgressObject

public void sinkProgressObject(ProgressObject source)
register to a new ProgressObject for ProgressEvent notifications


handleProgressEvent

public void handleProgressEvent(ProgressEvent progressEvent)
receives notification of a progress event from one of our registered interface.

Specified by:
handleProgressEvent in interface ProgressListener

addProgressListener

public void addProgressListener(ProgressListener progressListener)
Register a new ProgressListener

Specified by:
addProgressListener in interface ProgressObject
Parameters:
the - new listener instance

removeProgressListener

public void removeProgressListener(ProgressListener progressListener)
removes a ProgressListener from our list of listeners

Specified by:
removeProgressListener in interface ProgressObject
Parameters:
the - ProgressListener to remove

getClientConfiguration

public ClientConfiguration getClientConfiguration(TargetModuleID targetModuleID)
Specified by:
getClientConfiguration in interface ProgressObject

getDeploymentStatus

public DeploymentStatus getDeploymentStatus()
Specified by:
getDeploymentStatus in interface ProgressObject

getResultTargetModuleIDs

public TargetModuleID[] getResultTargetModuleIDs()
Specified by:
getResultTargetModuleIDs in interface ProgressObject

isCancelSupported

public boolean isCancelSupported()
Specified by:
isCancelSupported in interface ProgressObject

isStopSupported

public boolean isStopSupported()
Specified by:
isStopSupported in interface ProgressObject

cancel

public void cancel()
            throws OperationUnsupportedException
Specified by:
cancel in interface ProgressObject
Throws:
OperationUnsupportedException

stop

public void stop()
          throws OperationUnsupportedException
Specified by:
stop in interface ProgressObject
Throws:
OperationUnsupportedException

getCompletedStatus

public DFDeploymentStatus getCompletedStatus()
Report completed status for deploytool.

Specified by:
getCompletedStatus in class DFProgressObject
Returns:
null if not completed, or the DFDeploymentStatus set to reflect the completion


Copyright © 2012. All Rights Reserved.