|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.p13n.property.AbstractConfigurableEntity com.bea.p13n.events.Event
public class Event
An event object. An event is characterized by having a type (some name) and a timestamp (when the event occurred). Once the event is created, it can not change type or time stamp.
An Event also has named attributes (as in a Map). The attribute names are strings, but the values can be any serializable object.
Event mimics ConfigurableEntity by implementing only one method - getProperty. Other methods of ConfigurableEntity are not supported and will throw UnsupportedOperationException if used.
Field Summary |
---|
Fields inherited from class com.bea.p13n.property.AbstractConfigurableEntity |
---|
CE_METHOD_CACHE, instanceClass, PREFIX_GET, PREFIX_SET, propertyCache, textFormatter |
Fields inherited from interface com.bea.p13n.property.ConfigurableEntity |
---|
RESERVED_PROPERTY_SET |
Fields inherited from interface com.bea.p13n.events.EventConstants |
---|
TYPE_ALL |
Constructor Summary | |
---|---|
Event(String theType)
Construct a new Event. |
|
Event(String theType,
long theTimeStamp)
Construct a new Event. |
Method Summary | |
---|---|
String |
getApplication()
Get the application name that dispatched this event. |
Object |
getAttribute(String theKey)
Get named event attribute. |
Iterator |
getAttributeNames()
Return the attribute names that have been set on this event. |
Object |
getProperty(String propertySet,
String propertyName)
Mimics the getProperty method on thr
ConfigurableEntity interface. |
long |
getTimeStamp()
Get the time stamp of this event (usually system time when the Event was constructed). |
String |
getType()
Get the type of this event. |
Object |
removeAttribute(String theKey)
Remove the attribute. |
void |
setApplication(String appName)
Set the application name for this event. |
void |
setAttribute(String theKey,
Serializable theValue)
Set a named event attribute. |
String |
toString()
Return a string representation of the Event. |
Methods inherited from class com.bea.p13n.property.AbstractConfigurableEntity |
---|
createMapKey, getCachedProperty, getExplicitProperty, getExplicitSetter, getImplicitProperty, getJndiName, getPkString, getPropertyAsString, getPropertyCache, getPropertyNoDefault, getUniqueId, hasExplicitGetter, hasExplicitSetter, removeExplicitProperty, removeProperty, setExplicitProperty, setProperty, upcaseFirst |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.bea.p13n.property.ConfigurableEntity |
---|
getJndiName, getPkString, getPropertyAsString, getPropertyNoDefault, getUniqueId, removeProperty, setProperty |
Constructor Detail |
---|
public Event(String theType)
theType
- the event type.
IllegalArgumentException
- if theType is null or an
empty string.public Event(String theType, long theTimeStamp)
This constructor is provided so that an Event can be created when the time of the "event trigger" is not the same as the time when this object (that represents that trigger) is created. This constructor would not normally be used - normal applications should use the Event(String theType) constructor.
theType
- the event type.theTimeStamp
- the timestamp for the event, in milliseconds since
midnight, January 1, 1970 UTC.
IllegalArgumentException
- if theType is null or an
empty string.Method Detail |
---|
public void setApplication(String appName)
appName
- the name of application from where the event is dispatched.public String getApplication()
public String getType()
public long getTimeStamp()
public void setAttribute(String theKey, Serializable theValue)
theKey
- the attribute name. Can not be null.theValue
- the value of the attribute.
NullPointerException
- if theKey is null.public Object removeAttribute(String theKey)
theKey
- the attribute name.
public Object getAttribute(String theKey)
public Iterator getAttributeNames()
public String toString()
Event [type @ timeStamp] { attributeKey=attributeValue, ... }The time stamp is formated using java.util.Date.toString(). The attribute values are converted to string using String.valueOf().
toString
in class Object
public Object getProperty(String propertySet, String propertyName)
getProperty
method on thr
ConfigurableEntity
interface.
getAttribute
, passing
the propertyName
parameter as the key
argument. It is assumed that the propertySet
parameter is the same as the event type.
getProperty
in interface ConfigurableEntity
getProperty
in class AbstractConfigurableEntity
propertySet
- The name of the property set to look inpropertyName
- The name of the property to retrieve.
|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |