Package org.nuxeo.ecm.core.event.impl
Class EventListenerDescriptor
- java.lang.Object
-
- org.nuxeo.ecm.core.event.impl.EventListenerDescriptor
-
public class EventListenerDescriptor extends Object
XObject descriptor to declare event listeners
-
-
Field Summary
Fields Modifier and Type Field Description protected StringclassNameThe event listener class.protected Set<String>eventsprotected EventListenerinLineListenerprotected BooleanisAsyncApplies only for post commit listenerprotected booleanisEnabledprotected booleanisPostCommitApplies only for scripts.static Loglogprotected Stringnameprotected PostCommitEventListenerpostCommitEventListenerprotected IntegerpriorityThe priority to be used to order listeners.protected RuntimeContextrcprotected IntegerretryCountprotected StringscriptA script reference: URL, file path, or bundle entry.protected booleansingleThreadedprotected IntegertransactionTimeOut
-
Constructor Summary
Constructors Constructor Description EventListenerDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptBundle(EventBundle bundle)Checks if there's at least one event of interest in the bundle.booleanacceptEvent(String eventName)EventListenerasEventListener()PostCommitEventListenerasPostCommitListener()EventBundlefilterBundle(EventBundle bundle)Filters the event bundle to only keep events of interest to this listener.Set<String>getEvents()booleangetIsAsync()StringgetName()intgetPriority()IntegergetRetryCount()RuntimeContextgetRuntimeContext()ScriptgetScript()IntegergetTransactionTimeout()voidinitListener()booleanisEnabled()booleanisSingleThreaded()voidmerge(EventListenerDescriptor other)voidsetEnabled(boolean isEnabled)voidsetEvents(Set<String> events)voidsetIsAsync(Boolean isAsync)voidsetRetryCount(Integer retryCount)voidsetRuntimeContext(RuntimeContext rc)StringtoString()
-
-
-
Field Detail
-
script
protected String script
A script reference: URL, file path, or bundle entry. Runtime variable are expanded. To specify a bundle entry use the URL schema "bundle:"
-
isPostCommit
protected boolean isPostCommit
Applies only for scripts.
-
transactionTimeOut
protected Integer transactionTimeOut
-
isEnabled
protected boolean isEnabled
-
retryCount
protected Integer retryCount
-
singleThreaded
protected boolean singleThreaded
-
rc
protected RuntimeContext rc
-
inLineListener
protected EventListener inLineListener
-
postCommitEventListener
protected PostCommitEventListener postCommitEventListener
-
-
Constructor Detail
-
EventListenerDescriptor
public EventListenerDescriptor()
-
-
Method Detail
-
getPriority
public int getPriority()
-
setRuntimeContext
public void setRuntimeContext(RuntimeContext rc)
-
getRuntimeContext
public RuntimeContext getRuntimeContext()
-
isEnabled
public boolean isEnabled()
-
getRetryCount
public Integer getRetryCount()
-
setEnabled
public void setEnabled(boolean isEnabled)
-
setRetryCount
public void setRetryCount(Integer retryCount)
-
initListener
public void initListener()
-
asEventListener
public EventListener asEventListener()
-
asPostCommitListener
public PostCommitEventListener asPostCommitListener()
-
getScript
public Script getScript() throws IOException
- Throws:
IOException
-
getTransactionTimeout
public Integer getTransactionTimeout()
-
merge
public void merge(EventListenerDescriptor other)
-
acceptEvent
public final boolean acceptEvent(String eventName)
-
setIsAsync
public void setIsAsync(Boolean isAsync)
-
getIsAsync
public boolean getIsAsync()
-
isSingleThreaded
public boolean isSingleThreaded()
-
filterBundle
public EventBundle filterBundle(EventBundle bundle)
Filters the event bundle to only keep events of interest to this listener.- Since:
- 5.7
-
acceptBundle
public boolean acceptBundle(EventBundle bundle)
Checks if there's at least one event of interest in the bundle.- Since:
- 5.7
-
-