Nuxeo ECM Projects 5.4.3-SNAPSHOT

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

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

public class CoreEventListenerServiceImpl
extends DefaultComponent
implements CoreEventListenerService

Repository listener service.

Service dedicated to the processing of repository events. This service exists for evident performance reasons.

Author:
Julien Anguenot

Field Summary
static ComponentName NAME
           
 
Constructor Summary
CoreEventListenerServiceImpl()
           
 
Method Summary
 void addEventListener(EventListener listener)
          Adds a repository event listener.
 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.
 void notifyEventListeners(CoreEvent coreEvent)
          Notifies a core event.
 void registerExtension(Extension extension)
          Registers the given extension.
 void removeEventListener(EventListener listener)
          Removes a repository event listener.
 void transactionAboutToCommit()
           
 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.
 void unregisterExtension(Extension extension)
          Unregisters the given extension.
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, deactivate, getAdapter, registerContribution, unregisterContribution
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final ComponentName NAME
Constructor Detail

CoreEventListenerServiceImpl

public CoreEventListenerServiceImpl()
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

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

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

registerExtension

public void registerExtension(Extension extension)
                       throws Exception
Description copied from interface: Extensible
Registers the given extension.

Specified by:
registerExtension in interface Extensible
Overrides:
registerExtension in class DefaultComponent
Parameters:
extension - the extension to register
Throws:
Exception - if any error occurs

unregisterExtension

public void unregisterExtension(Extension extension)
                         throws Exception
Description copied from interface: Extensible
Unregisters the given extension.

Specified by:
unregisterExtension in interface Extensible
Overrides:
unregisterExtension in class DefaultComponent
Parameters:
extension - the extension to unregister
Throws:
Exception - if any error occurs

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

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

transactionAboutToCommit

public void transactionAboutToCommit()

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.