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

EjbTimerEvent

public class EjbTimerEvent extends AdminEvent implements CommandEvent
EjbTimerEvent - emitted by DAS to send requests to Ejb Timer Service Attibutes: actionType, from, servers

Fields Summary
public static final String
EJB_TIMER_CALL_RESULT_ATTRNAME
Attribute name in EventResult to return results of calls to timer service
public static final int
ACTION_MIGRATETIMER
Constant denoting action code
public static final int
ACTION_LISTTIMERS
static final String
eventType
Event type
private int
actionType
Attributes ()
private String
from
private String[]
servers
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
public EjbTimerEvent(String instance, int action, String serverFrom, String[] serverNames)
Create a new EjbTimerEvent.

param
instance name of the instance to which the event applies
param
realm name of the AuthRealm on which event happened.
param
action type of action - one of EjbTimerEvent.ACTION_MIGRATETIMER, EjbTimerEvent.ACTION_LISTTIMERS
param
serverFrom name of server instance (for ACTION_MIGRATETIMER)
param
serverNames names of server instances (for ACTION_LISTTIMERS)
throws
IllegalArgumentException if specified action is not valid


                                                                             
             
        this(eventType, instance, action, serverFrom, serverNames);
    
public EjbTimerEvent(String type, String instance, int action, String serverFrom, String[] serverNames)
Create a new EjbTimerEvent.

param
type event type, a string representation for the event
param
action type of action - one of EjbTimerEvent.ACTION_MIGRATETIMER, EjbTimerEvent.ACTION_LISTTIMERS
param
serverFrom name of server instance (for ACTION_MIGRATETIMER)
param
serverNames names of server instances (for ACTION_LISTTIMERS)
throws
IllegalArgumentException if specified action is not valid

        super(type, instance);
        from = serverFrom;
        servers  = serverNames;
        setAction(action);
    
Methods Summary
public intgetActionType()
Get action type for this event.

        return actionType;
    
public java.lang.StringgetFromServerName()
Get from param

        return from;
    
public java.lang.String[]getServerNames()
Get servers param

        return servers;
    
private voidsetAction(int action)
Set action to specified value. If action is not one of allowed, then IllegalArgumentException is thrown.

throws
IllegalArgumentException if action is invalid

        boolean valid = false;
        if (action==ACTION_MIGRATETIMER      ||
            action==ACTION_LISTTIMERS )
            valid = true;
        if (!valid) {
			String msg = localStrings.getString( "admin.event.invalid_action", ""+action );
            throw new IllegalArgumentException( msg );
        }
        this.actionType = action;