Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.listener.impl
Class DefaultEventService

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.core.listener.impl.DefaultEventService
All Implemented Interfaces:
CoreEventListenerService, Adaptable, Component, Extensible

public class DefaultEventService
extends DefaultComponent
implements CoreEventListenerService

Default implementation of the repository listener

Author:
Bogdan Stefanescu

Constructor Summary
DefaultEventService()
           
DefaultEventService(boolean activatePostCommit)
           
 
Method Summary
 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.
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, deactivate, getAdapter, registerContribution, registerExtension, unregisterContribution, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEventService

public DefaultEventService()

DefaultEventService

public DefaultEventService(boolean activatePostCommit)
Method Detail

addEventListener

public void addEventListener(EventListener listener)
Description copied from interface: CoreEventListenerService
Adds a repository event listener.

Specified by:
addEventListener in interface CoreEventListenerService
Parameters:
listener - the event listener to add

removeEventListener

public void removeEventListener(EventListener listener)
Description copied from interface: CoreEventListenerService
Removes a repository event listener.

Specified by:
removeEventListener in interface CoreEventListenerService
Parameters:
listener - the event listener to remove

getEventListenerByName

public EventListener getEventListenerByName(String name)
Description copied from interface: CoreEventListenerService
Returns an event listener given its name.

Specified by:
getEventListenerByName in interface CoreEventListenerService
Parameters:
name - the name of the event listener used a registration time
Returns:
the EventListener instance, or null if none found.

getEventListeners

public Collection<EventListener> getEventListeners()
Description copied from interface: CoreEventListenerService
Returns the collection of event listeners.

Specified by:
getEventListeners in interface CoreEventListenerService
Returns:
the collection of event listeners

notifyEventListeners

public void notifyEventListeners(CoreEvent coreEvent)
Description copied from interface: CoreEventListenerService
Notifies a core event.

Event listeners are notified if they are configured to process the given event type. They are notified in the order defined in their settings.

Specified by:
notifyEventListeners in interface CoreEventListenerService
Parameters:
coreEvent - a coreEvent instance

fireEvent

public void fireEvent(CoreEvent event)

fireOperationStarted

public void fireOperationStarted(Operation<?> command)
Description copied from interface: CoreEventListenerService
Fires a command starting event.

Specified by:
fireOperationStarted in interface CoreEventListenerService
Parameters:
command - the command

fireOperationTerminated

public void fireOperationTerminated(Operation<?> command)
Description copied from interface: CoreEventListenerService
Fires a command termination event.

Specified by:
fireOperationTerminated in interface CoreEventListenerService
Parameters:
command - the command that terminated

transactionCommited

public void transactionCommited()
Description copied from interface: CoreEventListenerService
Notify post commit listeners about all events raised in the current transaction. Called by the core session after the current transaction was committed

Specified by:
transactionCommited in interface CoreEventListenerService

transactionRollbacked

public void transactionRollbacked()
Description copied from interface: CoreEventListenerService
Called by the core session after the current transaction was rollbacked. Post commit events will be removed

Specified by:
transactionRollbacked in interface CoreEventListenerService

transactionStarted

public void transactionStarted()
Description copied from interface: CoreEventListenerService
A new transaction started. This will start a new post commit session

Specified by:
transactionStarted in interface CoreEventListenerService

isPostCommitEnabled

public boolean isPostCommitEnabled()

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.