Fields Summary |
---|
private EventKey | eKey |
private static long | eventCounter |
private String | targetDestunresolved/abstract target destination |
private String | effectiveDestResolved destination based on target destination. This is
where the notification event is delivered. Target destination
always refers to concrete server end point. |
private int | hopsNumber of times this event is forwarded from one server instance
to another server. |
private static final int | MAX_HOPSmaximum number of times an event is allowed to be forwarded |
static final String | eventTypeEvent type is required for all sub-classes of Notification. It is a
string representation for the event using dotted notation (for example -
network.alarm.router) |
private transient com.sun.enterprise.config.ConfigContext | configContextConfig context. This object provides access to a snapshot of config
updated with all changes in this event at the time event processing
starts on the instance to which the event applies. |
private transient com.sun.enterprise.config.ConfigContext | oldConfigContextOld config context. The object provides access to config context before
applying changes from this event. |
private static com.sun.enterprise.util.i18n.StringManager | localStrings |
ArrayList | configChangeListList of config changes. |
List | dependentChangeListList of dependent config changes. |
Methods Summary |
---|
synchronized void | addConfigChange(com.sun.enterprise.config.ConfigChange change)Add specified change to the event.
assertNotNull(change);
if (configChangeList == null) {
configChangeList = new ArrayList();
}
configChangeList.add(change);
|
public synchronized void | addConfigChange(java.util.ArrayList changeList)Add specified changes to the event.
if (changeList == null) {
String msg = localStrings.getString( "admin.event.null_configchangelist" );
throw new IllegalArgumentException( msg );
}
if (configChangeList == null) {
configChangeList = new ArrayList();
}
configChangeList.addAll(changeList);
|
public synchronized void | addDependentConfigChange(java.util.List list)
if (list == null) {
String msg = localStrings.getString( "admin.event.null_configchangelist" );
throw new IllegalArgumentException( msg );
}
if (dependentChangeList == null) {
dependentChangeList = new ArrayList();
}
dependentChangeList.addAll(list);
|
private void | assertNotNull(com.sun.enterprise.config.ConfigChange change)Assert that specified ConfigChange is not null.
if (change == null) {
String msg = localStrings.getString( "admin.event.null_configchange" );
throw new IllegalArgumentException( msg );
}
|
public java.lang.Object | clone()Returns a top level clone of this object.
return super.clone();
|
public int | getActionType()Get action type for this event.
return 0;
|
public java.lang.String | getConfigChangeInfo()Get config change info. This method returns a string that lists config
changes associated to this event. Returns an empty string if no changes
are associated to this event.
StringBuffer buf = new StringBuffer();
if (configChangeList != null) {
Iterator iter = configChangeList.iterator();
while (iter.hasNext()) {
ConfigChange change = (ConfigChange)iter.next();
buf.append(change.toString());
}
}
return buf.toString();
|
public java.util.ArrayList | getConfigChangeList()
return configChangeList;
|
public com.sun.enterprise.config.ConfigContext | getConfigContext()Get config context. This returns a snapshot of config context with all
changes in this event at the time event processing started on the
receiving server instance. Event listeners should use this object to get
a consistent view of context instead of system wide context because that
can be updated during event processing. This method will return null if
called before the event processing has started. So, it is intended for
use by event listeners only.
return configContext;
|
public java.util.List | getDependentChangeList()
return dependentChangeList;
|
public java.lang.String | getEffectiveDestination()Gets the effective destination for this event
return effectiveDest;
|
public EventKey | getEventId()Get event key information
return eKey;
|
public java.lang.String | getEventInfo()Get detailed event information. Unless overidden in sub classes, this
method returns exactly same value as concatenation of toString() and
getConfigChangeInfo() methods. The intent of this method is to return a
detailed string representation of the event that can be used for
debugging.
return toString() + getConfigChangeInfo();
|
public int | getHopCount()Returns the current hop count (number of times this event has been
forwarded) of this event.
return hops;
|
public java.lang.String | getInstanceName()Return name of the instance to which this event applies. The difference
from getSource() is that this returns a String object, so there is no
need to cast the return value.
return (String)getSource();
|
public com.sun.enterprise.config.ConfigContext | getOldConfigContext()Get old config context. This returns a reference of config context prior
to applying any changes from this event. This method will return null if
called before event processing has started. This is just a reference to
global config context at the time event processing started. Even though
this is not a snapshot of config context (i.e. cloned copy), it is still
sufficient for the usage in getting old config values, because once a
context has been made global it is immutable.
return oldConfigContext;
|
public java.lang.Object | getSource()Return name of the instance to which this event applies. (This
interpretation is slightly different from EventObject.getSource()
where it is expected to return the object on which event happened -
so instead of the instance object it returns the name of the instance.)
return super.getSource();
|
public java.lang.String | getTargetDestination()Each event will have 2 destinations, target and effective destination
target destination would be for example cluster1. effective destination
would be endpoints of target destination.
return targetDest;
|
public int | incrementHopCount()Increments the current hop count.
return ++hops;
|
boolean | isNoOp()Is this event a no-op. The default implementation always returns false.
However, the sub-classes can override and provide a more intelligent
implementation.
return false;
|
public boolean | isValidHopCount()Returns true if current hop count is less than or equal to maximum
hop allowed for this event.
return (hops <= MAX_HOPS) ? true : false;
|
synchronized void | removeConfigChange(com.sun.enterprise.config.ConfigChange change)Remove specified config change from the event.
assertNotNull(change);
if (configChangeList != null) {
int ndx = configChangeList.indexOf(change);
if (ndx != -1) {
configChangeList.remove(ndx);
}
}
|
private void | setAction(int action)Set action to specified value. If action is not one of allowed,
return;
|
void | setContext(com.sun.enterprise.config.ConfigContext ctx)Set config context to specified value. Event listeners can use this
to get a consistent view of config. This config context should contain
all changes from this event.
configContext = ctx;
|
public void | setEffectiveDestination(java.lang.String eDest)Sets the effective destination
effectiveDest = eDest;
|
public void | setEventId(EventKey ek)Set event key information
eKey = ek;
|
void | setOldContext(com.sun.enterprise.config.ConfigContext ctx)Set old config context to specified value. This context will not have
changes from this event.
oldConfigContext = ctx;
|
public void | setTargetDestination(java.lang.String tarDest)Sets the target destination
targetDest = tarDest;
|
public java.lang.String | toString()Return a String representation.
int numChg = (configChangeList == null) ? 0 : configChangeList.size();
return this.getClass().getName() + " -- " + this.getInstanceName()
+ " [" + numChg + " Change(s), Id:" + this.getSequenceNumber()
+ ", ts:" + this.getTimeStamp() + "]";
|