Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.listener
Class AbstractEventListener

java.lang.Object
  extended by org.nuxeo.ecm.core.listener.AbstractEventListener
All Implemented Interfaces:
EventListener
Direct Known Subclasses:
NXRuntimeEventListener, TestTransactedListener

public abstract class AbstractEventListener
extends Object
implements EventListener

Abstract event listener.

Author:
Julien Anguenot

Constructor Summary
AbstractEventListener()
           
 
Method Summary
 boolean accepts(String eventId)
          Returns true if listener processes given event id.
 void addEventId(String eventId)
          Adds an event id for this listener to process.
 String getName()
          Returns the name of the event listener.
 Integer getOrder()
          Returns the int order of the event listener.
 void handleEvent(CoreEvent coreEvent)
          Deprecated. 
 void notifyEvent(CoreEvent coreEvent)
          Deprecated. use handleEvent instead - notifyEvent is a bad name This method is preserved for compatibility - remove it when all event listeners will be refactored
 void operationStarted(Operation<?> cmd)
           
 void operationTerminated(Operation<?> cmd)
           
 void removeEventId(String eventId)
          Removes an event id for this listener to process.
 void setName(String name)
          Sets the name of the event listener.
 void setOrder(Integer order)
          Sets the int order of the event listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEventListener

public AbstractEventListener()
Method Detail

getName

public String getName()
Description copied from interface: EventListener
Returns the name of the event listener.

Specified by:
getName in interface EventListener
Returns:
the name of the event listener

setName

public void setName(String name)
Description copied from interface: EventListener
Sets the name of the event listener.

Specified by:
setName in interface EventListener
Parameters:
name - of the event listener

getOrder

public Integer getOrder()
Description copied from interface: EventListener
Returns the int order of the event listener.

Specified by:
getOrder in interface EventListener
Returns:
the int order of the event listener.

setOrder

public void setOrder(Integer order)
Description copied from interface: EventListener
Sets the int order of the event listener.

Specified by:
setOrder in interface EventListener
Parameters:
order - the Integer order of the event listener.

addEventId

public void addEventId(String eventId)
Description copied from interface: EventListener
Adds an event id for this listener to process.

Specified by:
addEventId in interface EventListener

removeEventId

public void removeEventId(String eventId)
Description copied from interface: EventListener
Removes an event id for this listener to process.

Specified by:
removeEventId in interface EventListener

accepts

public boolean accepts(String eventId)
Description copied from interface: EventListener
Returns true if listener processes given event id.

If no event ids are set for this listener, returns true.

Specified by:
accepts in interface EventListener

operationStarted

public void operationStarted(Operation<?> cmd)
                      throws Exception
Specified by:
operationStarted in interface EventListener
Throws:
Exception

operationTerminated

public void operationTerminated(Operation<?> cmd)
                         throws Exception
Specified by:
operationTerminated in interface EventListener
Throws:
Exception

notifyEvent

@Deprecated
public void notifyEvent(CoreEvent coreEvent)
                 throws Exception
Deprecated. use handleEvent instead - notifyEvent is a bad name This method is preserved for compatibility - remove it when all event listeners will be refactored

Handles a core event.

Parameters:
coreEvent - the core event to notify
Throws:
Exception

handleEvent

@Deprecated
public void handleEvent(CoreEvent coreEvent)
                 throws Exception
Deprecated. 

A default implementation required for compatibility with notifyEvent When notifyEvent will be removed remove this default implementation too

Specified by:
handleEvent in interface EventListener
Throws:
Exception

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.