FileDocCategorySizeDatePackage
SimpleProgressObjectImpl.javaAPI DocGlassfish v2 API5732Fri May 04 22:34:28 BST 2007com.sun.enterprise.deployapi

SimpleProgressObjectImpl

public class SimpleProgressObjectImpl extends Object implements javax.enterprise.deploy.spi.status.ProgressObject
Implements a progress object primarily intended to report an error during a DeploymentManager method invocation.
author
tjquinn

Fields Summary
private Vector
listeners
Records registered listeners
protected Vector
deliveredEvents
Records all events delivered so late-registering listeners will be informed of all past events as well as future ones.
private javax.enterprise.deploy.spi.status.DeploymentStatus
deploymentStatus
Records the deployment status. Normally of type DeploymentStatusWithError
Constructors Summary
public SimpleProgressObjectImpl(javax.enterprise.deploy.spi.status.DeploymentStatus deploymentStatus)
Creates a new instance of ProgressObjectIimplWithError

    
           
       
        this.deploymentStatus = deploymentStatus;
    
Methods Summary
public voidaddProgressListener(javax.enterprise.deploy.spi.status.ProgressListener progressListener)
Registers a listener for progress events.

param
new progress listener

	synchronized (listeners) {
            listeners.add(progressListener);
	    if (deliveredEvents.size() > 0) {
	        for (Iterator i = deliveredEvents.iterator(); i.hasNext();) {
		    progressListener.handleProgressEvent((ProgressEvent)i.next());
	        }
	    }
	}
    
public voidcancel()

        throw new OperationUnsupportedException("cancel not supported");
    
protected voidfireProgressEvent(javax.enterprise.deploy.spi.status.ProgressEvent progressEvent)
Notifies all listeners that have registered interest for ProgressEvent notification.

	Vector currentListeners = null;
        synchronized (listeners) {
            currentListeners = (Vector) listeners.clone();
            deliveredEvents.add(progressEvent);
        }

        for (Iterator listenersItr = currentListeners.iterator(); listenersItr.hasNext();) {
            ((ProgressListener)listenersItr.next()).handleProgressEvent(progressEvent);
        }
        currentListeners = null;
    
public javax.enterprise.deploy.spi.status.ClientConfigurationgetClientConfiguration(javax.enterprise.deploy.spi.TargetModuleID targetModuleID)

        return null;
    
public javax.enterprise.deploy.spi.status.DeploymentStatusgetDeploymentStatus()

        return deploymentStatus;
    
public javax.enterprise.deploy.spi.TargetModuleID[]getResultTargetModuleIDs()

        return new javax.enterprise.deploy.spi.TargetModuleID[0];
    
public booleanisCancelSupported()

        return false;
    
public booleanisStopSupported()

        return false;
    
public voidremoveProgressListener(javax.enterprise.deploy.spi.status.ProgressListener progressListener)
Unregister a previously-registered event listener.

param
the listener to unregister

	synchronized (listeners) {
            listeners.remove(progressListener);
	}
    
public voidstop()

        throw new OperationUnsupportedException("stop not supported");