|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.routing.EventGroup
public class EventGroup
EventGroup is a holder over events grouped by a common group Id.
This can be used by components such as routers to managed related events.
| Field Summary | |
|---|---|
static MuleEvent[] |
EMPTY_EVENTS_ARRAY
|
| Constructor Summary | |
|---|---|
EventGroup(Object groupId)
|
|
EventGroup(Object groupId,
int expectedSize)
|
|
| Method Summary | |
|---|---|
void |
addEvent(MuleEvent event)
Add the given event to this group. |
void |
clear()
Removes all events from this group. |
int |
compareTo(EventGroup other)
Compare this EventGroup to another one. |
boolean |
equals(Object obj)
Compares two EventGroups for equality. |
int |
expectedSize()
Returns the number of events that this EventGroup is expecting before correlation can proceed. |
long |
getCreated()
Return the creation timestamp of the current group in nanoseconds. |
Object |
getGroupId()
Returns an identifier for this EventGroup. |
MuleEvent |
getMessageCollectionEvent()
|
int |
hashCode()
The hashCode of an EventGroup is derived from the object returned by getGroupId(). |
Iterator<MuleEvent> |
iterator()
Returns an iterator over a snapshot copy of this group's collected events. |
void |
removeEvent(MuleEvent event)
Remove the given event from the group. |
int |
size()
Returns the number of events collected so far. |
MuleEvent[] |
toArray()
Returns a snapshot of collected events in this group. |
MuleMessageCollection |
toMessageCollection()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final MuleEvent[] EMPTY_EVENTS_ARRAY
| Constructor Detail |
|---|
public EventGroup(Object groupId)
public EventGroup(Object groupId,
int expectedSize)
| Method Detail |
|---|
public int compareTo(EventGroup other)
Comparable, they are used for the comparison;
otherwise - since the id can be any object - the group creation time stamp is
used as fallback. Older groups are considered "smaller".
compareTo in interface Comparable<EventGroup>Comparable.compareTo(java.lang.Object)public boolean equals(Object obj)
getGroupId()) are equal.
equals in class ObjectObject.equals(Object)public int hashCode()
getGroupId().
hashCode in class ObjectObject.hashCode()public Object getGroupId()
Comparable e.g. a UUID.
public Iterator<MuleEvent> iterator()
removeEvent(MuleEvent). If you need to do so atomically in order to
prevent e.g. concurrent reception/aggregation of the group during iteration,
wrap the iteration in a synchronized block on the group instance.
MuleEvents.public MuleEvent[] toArray()
MuleEvents.public void addEvent(MuleEvent event)
event - the event to addpublic void removeEvent(MuleEvent event)
event - the evnt to removepublic long getCreated()
public int size()
public int expectedSize()
public void clear()
public String toString()
toString in class Objectpublic MuleMessageCollection toMessageCollection()
public MuleEvent getMessageCollectionEvent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||