Class 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 Detail

      • ProgressObjectSink

        public ProgressObjectSink()
    • 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 interface javax.enterprise.deploy.spi.status.ProgressListener
      • addProgressListener

        public void addProgressListener​(javax.enterprise.deploy.spi.status.ProgressListener progressListener)
        Register a new ProgressListener
        Specified by:
        addProgressListener in interface javax.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 interface javax.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 interface javax.enterprise.deploy.spi.status.ProgressObject
      • getDeploymentStatus

        public javax.enterprise.deploy.spi.status.DeploymentStatus getDeploymentStatus()
        Specified by:
        getDeploymentStatus in interface javax.enterprise.deploy.spi.status.ProgressObject
      • getResultTargetModuleIDs

        public javax.enterprise.deploy.spi.TargetModuleID[] getResultTargetModuleIDs()
        Specified by:
        getResultTargetModuleIDs in interface javax.enterprise.deploy.spi.status.ProgressObject
      • isCancelSupported

        public boolean isCancelSupported()
        Specified by:
        isCancelSupported in interface javax.enterprise.deploy.spi.status.ProgressObject
      • isStopSupported

        public boolean isStopSupported()
        Specified by:
        isStopSupported in interface javax.enterprise.deploy.spi.status.ProgressObject
      • cancel

        public void cancel()
                    throws javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
        Specified by:
        cancel in interface javax.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 interface javax.enterprise.deploy.spi.status.ProgressObject
        Throws:
        javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException