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

BaseDeployEvent

public class BaseDeployEvent extends com.sun.enterprise.admin.event.AdminEvent implements Cloneable
Base deployment event. A deployment event is one of - deployed, undeployed, redeployed, enabled or disabled on J2ee application, standalone J2EE module or application server resource. The word deploy is used in two meanings here - one to denote the group of actions that are related to deployment and another to denote the specific action of initial deployment of application, module or resource.

Fields Summary
public static final String
APPLICATION
Constant denoting J2EE application.
public static final String
MODULE
Constant denoting standalone J2EE module.
public static final String
RESOURCE
Constant denoting application server resource.
public static final String
DEPLOY
Constant denoting deployment action
public static final String
UNDEPLOY
Constant denoting undeployment action
public static final String
REDEPLOY
Constant denoting redeployment action
public static final String
ENABLE
Constant denoting enable action
public static final String
DISABLE
Constant denoting disable action
public static final String
ADD_REFERENCE
Constant denoting add reference action
public static final String
REMOVE_REFERENCE
Constant denoting remove reference action
public static final int
APPLICATION_DEPLOYED
Application deploy event
public static final int
APPLICATION_UNDEPLOYED
Application undeploy event
public static final int
APPLICATION_REDEPLOYED
Application redeploy event
public static final int
MODULE_DEPLOYED
Module deploy event
public static final int
MODULE_UNDEPLOYED
Module undeploy event
public static final int
MODULE_REDEPLOYED
Module redeploy event
public static final int
MODULE_ENABLE
Module enable event
public static final int
MODULE_DISABLE
Module disable event
public static final int
APPLICATION_ENABLE
Application enable event
public static final int
APPLICATION_DISABLE
Application disable event
public static final int
APPLICATION_REFERENCED
Application reference event
public static final int
APPLICATION_UNREFERENCED
static final String
eventType
Event type
protected String
j2eeComponentType
protected String
j2eeComponentName
protected String
actionName
protected boolean
cascade
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
public BaseDeployEvent(String instance, String componentType, String componentName, String action)
Create a new BaseDeployEvent.

param
instance name of the instance to which the deployment event applies
param
componentType type of the component on which event happened. One of BaseDeployEvent.APPLICATION, BaseDeployEvent.MODULE or BaseDeployEvent.RESOURCE
param
componentName name of the component on which event happened, this is either a J2EE application name or a standalone J2EE module name or an application server resource.
param
action deployment action - one of BaseDeployEvent.DEPLOY, BaseDeployEvent.UNDEPLOY, BaseDeployEvent.REDEPLOY, BaseDeployEvent.ENABLE, BaseDeployEvent.DISABLE
throws
IllegalArgumentException if specified action is not valid


                                                                                                                                          
        
                
        this(eventType, instance, componentType, componentName, action);
    
public BaseDeployEvent(String type, String instance, String componentType, String componentName, String action)
Create a new BaseDeployEvent.

param
type event type, a string representation for the event
param
instance name of the instance to which the deployment event applies
param
componentType type of the component on which event happened. One of BaseDeployEvent.APPLICATION, BaseDeployEvent.MODULE or BaseDeployEvent.RESOURCE
param
componentName name of the component on which event happened, this is either a J2EE application name or a standalone J2EE module name or an application server resource.
param
action deployment action - one of BaseDeployEvent.DEPLOY, BaseDeployEvent.UNDEPLOY, BaseDeployEvent.REDEPLOY, BaseDeployEvent.ENABLE, BaseDeployEvent.DISABLE
throws
IllegalArgumentException if specified action is not valid

        this(type, instance, componentType, componentName, action, false);
    
public BaseDeployEvent(String type, String instance, String componentType, String componentName, String action, boolean cascade)

        super(type, instance);
        j2eeComponentType = componentType;
        j2eeComponentName = componentName;
        setAction(action);
        setCascade(cascade);
    
public BaseDeployEvent(String type, Object source, long seqNumber, long time)

        super(type, source, seqNumber, time);
    
Methods Summary
public java.lang.Objectclone()

        return super.clone();
    
public java.lang.StringgetAction()
Get deployment action for this event.

        return actionName;
    
public booleangetCascade()

        return cascade;
    
public java.lang.StringgetJ2EEComponentName()
Get name of the component on which this event happened. This is either application name, module name or resource name.

        return j2eeComponentName;
    
public java.lang.StringgetJ2EEComponentType()
Get type of component on which this event happened.

return
one of BaseDeployEvent.APPLICATION, BaseDeployEvent.MODULE or BaseDeployEvent.RESOURCE

        return j2eeComponentType;
    
protected voidsetAction(java.lang.String action)
Set action to specified value. If action is not one of DEPLOY, UNDEPLOY, REDEPLOY, ENABLE or DISABLE then IllegalArgumentException is thrown.

throws
IllegalArgumentException if action is invalid

        boolean valid = false;
        if (DEPLOY.equals(action) || UNDEPLOY.equals(action)
                || REDEPLOY.equals(action) || ENABLE.equals(action)
                || DISABLE.equals(action) || ADD_REFERENCE.equals(action) 
                || REMOVE_REFERENCE.equals(action)) {
            valid = true;
        }
        if (!valid) {
			String msg = localStrings.getString( "admin.event.invalid_action", action );
            throw new IllegalArgumentException( msg );
        }
        this.actionName = action;
    
public voidsetCascade(boolean cascade)

        this.cascade = cascade;