FileDocCategorySizeDatePackage
DeploymentRequestRegistry.javaAPI DocGlassfish v2 API4432Fri May 04 22:34:32 BST 2007com.sun.enterprise.deployment.backend

DeploymentRequestRegistry

public class DeploymentRequestRegistry extends Object
This registry singleton class will maintain a list of oustanding DeploymentRequest instances keyed by the DeploymentID they are serving.
author
Jerome Dochez

Fields Summary
static DeploymentRequestRegistry
instance
Map
idToRequest
private static com.sun.enterprise.util.i18n.StringManager
localStrings
string manager
Constructors Summary
private DeploymentRequestRegistry()
Creates a new instance of DeploymentRequestRegistry


           
      
    
Methods Summary
public voidaddDeploymentRequest(java.lang.String id, DeploymentRequest request)
add new new request to the registry

param
the module identifier
param
the deployment request

 
        synchronized(DeploymentRequestRegistry.class) {
            // if there is another thread operating on the same module
            // at the same time, we need to abort this deployment
            if (idToRequest.containsKey(id)) {
                String msg = localStrings.getString(
                    "another_thread_access_same_module",
                    new Object[]{ id });
                throw new IASDeploymentException(msg);
            }
            idToRequest.put(id, request);
        }
    
public DeploymentRequestgetDeploymentRequest(java.lang.String id)

return
the deployment request associated with the passed module ID

        return (DeploymentRequest) idToRequest.get(id);
    
public static com.sun.enterprise.deployment.backend.DeploymentRequestRegistrygetRegistry()

return
the singleton instance of this registry

        if (instance==null) {
            synchronized(DeploymentRequestRegistry.class) {
                if (instance==null) {
                    instance = new DeploymentRequestRegistry();
                }
            };
        }
        return instance;
    
public voidremoveDeploymentRequest(java.lang.String id)
remove request from the registry

param
the module identifier

 
        idToRequest.remove(id);