FileDocCategorySizeDatePackage
ModuleDeployEvent.javaAPI DocGlassfish v2 API7825Fri May 04 22:33:34 BST 2007com.sun.enterprise.admin.event

ModuleDeployEvent

public class ModuleDeployEvent extends com.sun.enterprise.admin.event.BaseDeployEvent
Module deployment event. This event is generated whenever a J2EE module is deployed, undeployed, redeployed, enabled or disabled.

Fields Summary
public static final String
TYPE_WEBMODULE
Constant to denote standalone web module
public static final String
TYPE_EJBMODULE
Constant to denote standalone ejb module
public static final String
TYPE_CONNECTOR
Constant to denote connector module
public static final String
TYPE_APPCLIENT
Constant to denote appclient module
public static final int
TYPE_WEBMODULE_CODE
Int constant to denote standalone web module
public static final int
TYPE_EJBMODULE_CODE
Int constant to denote standalone ejb module
public static final int
TYPE_CONNECTOR_CODE
Int constant to denote connector module
public static final int
TYPE_APPCLIENT_CODE
Int constant to denote appclient module
static final String
eventType
Event type
private String
moduleType
Module type.
private int
moduleTypeCode
Module type code.
private boolean
forceDeploy
Indicates whether the ModuleDeployEvent was forced
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
public ModuleDeployEvent(String instance, String moduleName, String moduleType, String actionCode)
Create a new ModuleDeployEvent for the specified instance, module (name and type) and action code.

param
instance name of the server instance to which module has been deployed, undeployed or redployed.
param
moduleName name of the module that has been deployed, undeployed, redeployed, enabled or disabled
param
moduleType type of the module - one of TYPE_WEBMODULE, TYPE_EJBMODULE, TYPE_CONNECTOR
param
actionCode what happened to the module, the valid values are BaseDeployEvent.DEPLOY, BaseDeployEvent.REDEPLOY, BaseDeployEvent.UNDEPLOY, BaseDeployEvent.ENABLE or BaseDeployEvent.DISABLE
throws
IllegalArgumentException if moduleType or actionCode is invalid


                                                                                                                                      
        
                
        super(eventType, instance, BaseDeployEvent.MODULE, moduleName, actionCode);
        setModuleType(moduleType);
    
public ModuleDeployEvent(String instance, String moduleName, String moduleType, String actionCode, boolean cascade)
Creates a new ModuleDeployEvent for the provided instance, moduleName, moduleType, actionCode and cascade

        super(eventType, instance, BaseDeployEvent.MODULE, moduleName, actionCode, cascade);
        setModuleType(moduleType);
    
public ModuleDeployEvent(String instance, String moduleName, String moduleType, String actionCode, boolean cascade, boolean forceDeploy)
Creates a new ModuleDeployEvent for the provided instance, moduleName, moduleType, actionCode, cascade and forceDeploy values

        super(eventType, instance, BaseDeployEvent.MODULE, moduleName, actionCode, cascade);
        setModuleType(moduleType);
        setForceDeploy(forceDeploy);
    
Methods Summary
public booleangetForceDeploy()

        return this.forceDeploy;
    
public java.lang.StringgetModuleName()
Get name of the module that was affected by deployment action.

        return getJ2EEComponentName();
    
public java.lang.StringgetModuleType()
Get type of the module. Possible values are TYPE_WEBMODULE, TYPE_EJBMODULE and TYPE_CONNECTOR.

        return moduleType;
    
public intgetModuleTypeCode()
Get module type code. Possible values are TYPE_WEBMODULE_CODE, TYPE_EJBMODULE_CODE and TYPE_CONNECTOR_CODE.

        return moduleTypeCode;
    
public voidsetForceDeploy(boolean forceDeploy)

        this.forceDeploy = forceDeploy;
    
private voidsetModuleType(java.lang.String modType)
Helper method to validate and set module type

        boolean valid = true;
        int modTypeCode = 0;
        if (TYPE_WEBMODULE.equals(modType)) {
            modTypeCode = TYPE_WEBMODULE_CODE;
        } else if (TYPE_EJBMODULE.equals(modType)) {
            modTypeCode = TYPE_EJBMODULE_CODE;
        } else if (TYPE_CONNECTOR.equals(modType)) {
            modTypeCode = TYPE_CONNECTOR_CODE;
        } else if (TYPE_APPCLIENT.equals(modType)) {
            modTypeCode = TYPE_APPCLIENT_CODE;
        } else {
            valid = false;
        }
        if (!valid) {
			String msg = localStrings.getString( "admin.event.invalid_module_type", modType );
            throw new IllegalArgumentException( msg );
        }
        this.moduleType = modType;
        this.moduleTypeCode = modTypeCode;
    
public java.lang.StringtoString()
Return a useful string representation.

        return "ModuleDeployEvent -- " + getAction() + " " + moduleType + "/" + getModuleName();