Search in sources :

Example 1 with StateType

use of javax.enterprise.deploy.shared.StateType in project Payara by payara.

the class ProgressObjectImpl method fireProgressEvent.

/**
 * Notifies all listeners that have registered interest for ProgressEvent notification.
 */
protected void fireProgressEvent(StateType state, String message, TargetImpl aTarget) {
    StateType stateToBroadcast = (state != null) ? state : deploymentStatus.getState();
    /* new copy of DeploymentStatus */
    DeploymentStatusImpl depStatus = new DeploymentStatusImpl(this);
    depStatus.setState(stateToBroadcast);
    depStatus.setMessage(message);
    /*
         *Update this progress object's status before notifying listeners.
         */
    if (state != null) {
        deploymentStatus.setMessage(message);
        // retain current state
        deploymentStatus.setState(state);
    }
    /* send notification */
    TargetModuleIDImpl tmi = new TargetModuleIDImpl(aTarget, moduleID);
    fireProgressEvent(new ProgressEvent(this, tmi, depStatus));
}
Also used : StateType(javax.enterprise.deploy.shared.StateType) ProgressEvent(javax.enterprise.deploy.spi.status.ProgressEvent)

Aggregations

StateType (javax.enterprise.deploy.shared.StateType)1 ProgressEvent (javax.enterprise.deploy.spi.status.ProgressEvent)1