Package org.nuxeo.ecm.core.event.impl
Class PostCommitEventExecutor
- java.lang.Object
-
- org.nuxeo.ecm.core.event.impl.PostCommitEventExecutor
-
public class PostCommitEventExecutor extends Object
Executor that passes an event bundle to post-commit asynchronous listeners (in a separated thread in order to manage transactions).Allows a bulk mode where transaction management is not per-listener done once for the whole set of listeners.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classPostCommitEventExecutor.EventBundleBulkRunnerLets the listeners process the event bundle in bulk mode.protected static classPostCommitEventExecutor.EventBundleRunnerLets the listeners process the event bundle.
-
Field Summary
Fields Modifier and Type Field Description static StringBULK_TIMEOUT_PROPstatic StringDEFAULT_BULK_TIMEOUT_Sstatic intDEFAULT_TIMEOUT_MSstatic intDEFAULT_TIMEOUT_TEST_MSprotected ExecutorServiceexecutorstatic StringTIMEOUT_MS_PROP
-
Constructor Summary
Constructors Constructor Description PostCommitEventExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetDefaultTimeoutMs()voidrun(List<EventListenerDescriptor> listeners, EventBundle event)voidrun(List<EventListenerDescriptor> listeners, EventBundle bundle, long timeoutMillis, boolean bulk)voidrunBulk(List<EventListenerDescriptor> listeners, EventBundle event)voidshutdown(long timeoutMillis)
-
-
-
Field Detail
-
TIMEOUT_MS_PROP
public static final String TIMEOUT_MS_PROP
- See Also:
- Constant Field Values
-
DEFAULT_TIMEOUT_MS
public static final int DEFAULT_TIMEOUT_MS
- See Also:
- Constant Field Values
-
DEFAULT_TIMEOUT_TEST_MS
public static final int DEFAULT_TIMEOUT_TEST_MS
- See Also:
- Constant Field Values
-
DEFAULT_BULK_TIMEOUT_S
public static final String DEFAULT_BULK_TIMEOUT_S
- See Also:
- Constant Field Values
-
BULK_TIMEOUT_PROP
public static final String BULK_TIMEOUT_PROP
- See Also:
- Constant Field Values
-
executor
protected final ExecutorService executor
-
-
Method Detail
-
getDefaultTimeoutMs
protected int getDefaultTimeoutMs()
-
shutdown
public void shutdown(long timeoutMillis) throws InterruptedException- Throws:
InterruptedException
-
run
public void run(List<EventListenerDescriptor> listeners, EventBundle event)
-
runBulk
public void runBulk(List<EventListenerDescriptor> listeners, EventBundle event)
-
run
public void run(List<EventListenerDescriptor> listeners, EventBundle bundle, long timeoutMillis, boolean bulk)
-
-