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 String
className
The event listener class.protected Set<String>
events
protected EventListener
inLineListener
protected Boolean
isAsync
Applies only for post commit listenerprotected boolean
isEnabled
protected boolean
isPostCommit
Applies only for scripts.static Log
log
protected String
name
protected PostCommitEventListener
postCommitEventListener
protected Integer
priority
The priority to be used to order listeners.protected RuntimeContext
rc
protected Integer
retryCount
protected String
script
A script reference: URL, file path, or bundle entry.protected boolean
singleThreaded
protected Integer
transactionTimeOut
-
Constructor Summary
Constructors Constructor Description EventListenerDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptBundle(EventBundle bundle)
Checks if there's at least one event of interest in the bundle.boolean
acceptEvent(String eventName)
EventListener
asEventListener()
PostCommitEventListener
asPostCommitListener()
EventBundle
filterBundle(EventBundle bundle)
Filters the event bundle to only keep events of interest to this listener.Set<String>
getEvents()
boolean
getIsAsync()
String
getName()
int
getPriority()
Integer
getRetryCount()
RuntimeContext
getRuntimeContext()
Script
getScript()
Integer
getTransactionTimeout()
void
initListener()
boolean
isEnabled()
boolean
isSingleThreaded()
void
merge(EventListenerDescriptor other)
void
setEnabled(boolean isEnabled)
void
setEvents(Set<String> events)
void
setIsAsync(Boolean isAsync)
void
setRetryCount(Integer retryCount)
void
setRuntimeContext(RuntimeContext rc)
String
toString()
-
-
-
Field Detail
-
log
public static final Log log
-
name
protected String name
-
className
protected String className
The event listener class.
-
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.
-
isAsync
protected Boolean isAsync
Applies only for post commit listener
-
transactionTimeOut
protected Integer transactionTimeOut
-
priority
protected Integer priority
The priority to be used to order listeners.
-
isEnabled
protected boolean isEnabled
-
retryCount
protected Integer retryCount
-
singleThreaded
protected boolean singleThreaded
-
rc
protected RuntimeContext rc
-
inLineListener
protected EventListener inLineListener
-
postCommitEventListener
protected PostCommitEventListener postCommitEventListener
-
-
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
-
getName
public String getName()
-
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
-
-