public class EventImpl extends Object implements Event
FLAG_CANCEL, FLAG_COMMIT, FLAG_IMMEDIATE, FLAG_INLINE, FLAG_LOCAL, FLAG_NONE, FLAG_ROLLBACK
Constructor and Description |
---|
EventImpl(String name,
EventContext ctx) |
EventImpl(String name,
EventContext ctx,
int flags) |
EventImpl(String name,
EventContext ctx,
int flags,
long creationTime) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels this event.
|
EventContext |
getContext()
Gets the event context.
|
int |
getFlags()
Gets the set of event flags
|
String |
getName()
Gets the event name.
|
long |
getTime()
The time stamp when the event was raised.
|
boolean |
isCanceled()
Checks whether the event was canceled.
|
boolean |
isCommitEvent()
Tests whether or not this is a commit event.
|
boolean |
isImmediate()
Tests if event is Immediate
|
boolean |
isInline()
Whether this event must not be added to a bundle.
|
boolean |
isLocal()
Tests if this event is local.
|
boolean |
isMarkedForRollBack()
Checks whether the event was marked for RollBack
|
boolean |
isPublic()
Tests if this event is public.
|
void |
markRollBack()
Marks transaction for RollBack
|
void |
setImmediate(boolean immediate)
Sets the immediate flag.
|
void |
setInline(boolean isInline)
Set the inline flag.
|
void |
setIsCommitEvent(boolean isCommit)
Set the commit flag.
|
void |
setLocal(boolean isLocal)
Sets the local flag.
|
void |
setPublic(boolean isPublic)
Set the public flag.
|
public EventImpl(String name, EventContext ctx, int flags, long creationTime)
public EventImpl(String name, EventContext ctx, int flags)
public EventImpl(String name, EventContext ctx)
public int getFlags()
Event
public EventContext getContext()
Event
Event contexts give access to the context in which the the event was raised. Event contexts are usually identifying the operation that raised the event. The context is exposing data objects linked to the event like documents and also may give access to the operation that raised the event allowing thus to canceling the operation, to record time spent to set the result status etc.
getContext
in interface Event
public String getName()
Event
The name must be unique. It is recommended to use prefixes in the style of java package names to differentiate between similar events that are sent by different components.
public long getTime()
Event
getTime
in interface Event
System.currentTimeMillis()
public void cancel()
Event
This can be used by event listeners to exit the event notification. Remaining event listeners will no more be notified. Note that this is not canceling the underlying operation if any.
public void markRollBack()
Event
This will exit the event listeners loop and throw a RuntimeException In JTA container, this will make the global transaction rollback.
markRollBack
in interface Event
public boolean isMarkedForRollBack()
Event
isMarkedForRollBack
in interface Event
public boolean isCanceled()
Event
isCanceled
in interface Event
public boolean isInline()
Event
public void setInline(boolean isInline)
Event
setInline
in interface Event
isInline
- true if the event must not be recorded as part of the
transactionEvent.isInline()
public boolean isCommitEvent()
Event
isCommitEvent
in interface Event
public void setIsCommitEvent(boolean isCommit)
Event
setIsCommitEvent
in interface Event
Event.isCommitEvent()
public boolean isLocal()
Event
Local events events are of interest only on the local machine.
public void setLocal(boolean isLocal)
Event
setLocal
in interface Event
Event.isLocal()
public boolean isPublic()
Event
Public events are of interest to everyone.
public void setPublic(boolean isPublic)
Event
setPublic
in interface Event
Event.isPublic()
public boolean isImmediate()
Event
Immediate events are sent in bundle without waiting for a commit
isImmediate
in interface Event
public void setImmediate(boolean immediate)
Event
setImmediate
in interface Event
Copyright © 2011 Nuxeo SA. All Rights Reserved.