|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jgroup.util.log.Event
public class Event
A general event that can be logged. This class is designed to be
subclassed, and it should be noted that subclassing requires that
the subclass be serializable to be written to disk. Since this class
does implement Serializable
the subclasses do not need
to do that.
Field Summary | |
---|---|
protected java.lang.String |
description
|
protected java.net.InetAddress |
eventHost
|
protected long |
time
|
protected EventType |
type
|
Constructor Summary | |
---|---|
Event()
Super constructor for sub events with late initialization |
|
Event(EventType type,
java.lang.String description)
|
|
Event(long time,
EventType type,
java.lang.String description)
|
Method Summary | |
---|---|
protected java.lang.StringBuilder |
commonToString(boolean includeDescription)
|
int |
compareTo(Event event)
Allows the system to compare two events to determine which are first in some ordering; hence making it simple to sort the events. |
java.lang.String |
getDescription()
|
java.net.InetAddress |
getHost()
|
java.lang.String |
getHostname()
|
long |
getTime()
|
EventType |
getType()
|
boolean |
isLastEvent()
This method must be overriden by the event type which will be used to indicate that it is the last event. |
boolean |
isType(EventType theType)
Returns true if the given type is the same as the type of this instance. |
static void |
setRelativeTo(Event relativeEvent)
Set the event whose time will be the used to compute relative time of consecutive events. |
void |
setTime(long time)
Set the time value of this event; used to adjust the time for events that was logged on machines with incorrect clock. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected long time
protected EventType type
protected java.lang.String description
protected java.net.InetAddress eventHost
Constructor Detail |
---|
public Event()
public Event(EventType type, java.lang.String description)
public Event(long time, EventType type, java.lang.String description)
Method Detail |
---|
public long getTime()
public void setTime(long time)
time
- the occurrance time of this eventpublic EventType getType()
public java.lang.String getDescription()
public java.lang.String getHostname()
public java.net.InetAddress getHost()
public boolean isType(EventType theType)
public boolean isLastEvent()
public static void setRelativeTo(Event relativeEvent)
relativeEvent
- public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.StringBuilder commonToString(boolean includeDescription)
public int compareTo(Event event)
compareTo
in interface java.lang.Comparable<Event>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |