Class ThreadEvent
- java.lang.Object
-
- org.nuxeo.runtime.services.event.Event
-
- org.nuxeo.runtime.trackers.concurrent.ThreadEvent
-
- Direct Known Subclasses:
ThreadEvent.EnterEvent
,ThreadEvent.LeaveEvent
public abstract class ThreadEvent extends Event
Runtime events that be fired once a thread is about to enter in the nuxeo runtime or leave it. Could be used for cleaning resource such as theFileEventTracker
. Producers should use the staticonEnter(Object, boolean)
andonLeave(Object)
factory methods and fire events by invoking the event'ssend()
method. Consumers should implements theThreadEventHandler
interface and register it in theEventService
using theThreadEventListener
wrapper.- Since:
- 6.0
- Author:
- Stephane Lacoin at Nuxeo (aka matic)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ThreadEvent.EnterEvent
protected static class
ThreadEvent.LeaveEvent
-
Constructor Summary
Constructors Constructor Description ThreadEvent(Class<? extends ThreadEvent> type, Object source, Object data)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
handle(ThreadEventHandler handler)
static void
ignore(ThreadEventListener aListener)
static void
listen(ThreadEventListener aListener)
static ThreadEvent
onEnter(Object source, boolean isLongRunning)
static ThreadEvent
onLeave(Object source)
void
send()
-
-
-
Constructor Detail
-
ThreadEvent
public ThreadEvent(Class<? extends ThreadEvent> type, Object source, Object data)
-
-
Method Detail
-
handle
public abstract void handle(ThreadEventHandler handler)
-
send
public void send()
-
onEnter
public static ThreadEvent onEnter(Object source, boolean isLongRunning)
-
onLeave
public static ThreadEvent onLeave(Object source)
-
listen
public static void listen(ThreadEventListener aListener)
-
ignore
public static void ignore(ThreadEventListener aListener)
-
-