public class DefaultEventService extends DefaultComponent implements CoreEventListenerService
Constructor and Description |
---|
DefaultEventService() |
DefaultEventService(boolean activatePostCommit) |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(EventListener listener)
Adds a repository event listener.
|
void |
fireEvent(CoreEvent event) |
void |
fireOperationStarted(Operation<?> command)
Fires a command starting event.
|
void |
fireOperationTerminated(Operation<?> command)
Fires a command termination event.
|
EventListener |
getEventListenerByName(String name)
Returns an event listener given its name.
|
Collection<EventListener> |
getEventListeners()
Returns the collection of event listeners.
|
boolean |
isPostCommitEnabled() |
void |
notifyEventListeners(CoreEvent coreEvent)
Notifies a core event.
|
void |
removeEventListener(EventListener listener)
Removes a repository event listener.
|
void |
transactionCommited()
Notify post commit listeners about all events raised in the current transaction.
|
void |
transactionRollbacked()
Called by the core session after the current transaction was rollbacked.
|
void |
transactionStarted()
A new transaction started.
|
activate, applicationStarted, deactivate, getAdapter, registerContribution, registerExtension, unregisterContribution, unregisterExtension
public DefaultEventService()
public DefaultEventService(boolean activatePostCommit)
public void addEventListener(EventListener listener)
CoreEventListenerService
addEventListener
in interface CoreEventListenerService
listener
- the event listener to addpublic void removeEventListener(EventListener listener)
CoreEventListenerService
removeEventListener
in interface CoreEventListenerService
listener
- the event listener to removepublic EventListener getEventListenerByName(String name)
CoreEventListenerService
getEventListenerByName
in interface CoreEventListenerService
name
- the name of the event listener used a registration timepublic Collection<EventListener> getEventListeners()
CoreEventListenerService
getEventListeners
in interface CoreEventListenerService
public void notifyEventListeners(CoreEvent coreEvent)
CoreEventListenerService
Event listeners are notified if they are configured to process the given event type. They are notified in the order defined in their settings.
notifyEventListeners
in interface CoreEventListenerService
coreEvent
- a coreEvent instancepublic void fireEvent(CoreEvent event)
public void fireOperationStarted(Operation<?> command)
CoreEventListenerService
fireOperationStarted
in interface CoreEventListenerService
command
- the commandpublic void fireOperationTerminated(Operation<?> command)
CoreEventListenerService
fireOperationTerminated
in interface CoreEventListenerService
command
- the command that terminatedpublic void transactionCommited()
CoreEventListenerService
transactionCommited
in interface CoreEventListenerService
public void transactionRollbacked()
CoreEventListenerService
transactionRollbacked
in interface CoreEventListenerService
public void transactionStarted()
CoreEventListenerService
transactionStarted
in interface CoreEventListenerService
public boolean isPostCommitEnabled()
Copyright © 2011 Nuxeo SA. All Rights Reserved.