Package org.adempiere.base.event
Class AbstractEventHandler
- java.lang.Object
-
- org.adempiere.base.event.AbstractEventHandler
-
- All Implemented Interfaces:
org.osgi.service.event.EventHandler
- Direct Known Subclasses:
RequestEventHandler
public abstract class AbstractEventHandler extends Object implements org.osgi.service.event.EventHandler
- Author:
- hengsin
-
-
Field Summary
Fields Modifier and Type Field Description protected IEventManager
eventManager
-
Constructor Summary
Constructors Constructor Description AbstractEventHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addError(org.osgi.service.event.Event event, Throwable e)
protected void
addErrorMessage(org.osgi.service.event.Event event, String errorMessage)
void
bindEventManager(IEventManager eventManager)
protected abstract void
doHandleEvent(org.osgi.service.event.Event event)
override this method to handle eventprotected <T> T
getEventData(org.osgi.service.event.Event event)
protected <T> T
getEventProperty(org.osgi.service.event.Event event, String property)
protected PO
getPO(org.osgi.service.event.Event event)
protected ProcessInfo
getProcessInfo(org.osgi.service.event.Event event)
void
handleEvent(org.osgi.service.event.Event event)
protected abstract void
initialize()
override this method to register event that the class want to listen toprotected void
registerEvent(String eventTopic)
protected void
registerEvent(String topic, String filter)
protected void
registerProcessEvent(String topic, String classOrUUID)
protected void
registerTableEvent(String topic, String tableName)
void
unbindEventManager(IEventManager eventManager)
-
-
-
Field Detail
-
eventManager
protected IEventManager eventManager
-
-
Method Detail
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event)
- Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
- See Also:
EventHandler.handleEvent(org.osgi.service.event.Event)
-
bindEventManager
public void bindEventManager(IEventManager eventManager)
- Parameters:
eventManager
-
-
unbindEventManager
public void unbindEventManager(IEventManager eventManager)
- Parameters:
eventManager
-
-
doHandleEvent
protected abstract void doHandleEvent(org.osgi.service.event.Event event)
override this method to handle event- Parameters:
event
-
-
initialize
protected abstract void initialize()
override this method to register event that the class want to listen to
-
registerEvent
protected void registerEvent(String eventTopic)
- Parameters:
eventTopic
-
-
registerEvent
protected void registerEvent(String topic, String filter)
- Parameters:
topic
-filter
-
-
registerTableEvent
protected void registerTableEvent(String topic, String tableName)
- Parameters:
topic
-tableName
-
-
registerProcessEvent
protected void registerProcessEvent(String topic, String classOrUUID)
- Parameters:
topic
-classOrUUID
- className or ProcessUUID
-
getPO
protected PO getPO(org.osgi.service.event.Event event)
- Parameters:
event
-- Returns:
- PO
-
getProcessInfo
protected ProcessInfo getProcessInfo(org.osgi.service.event.Event event)
- Parameters:
event
-- Returns:
- ProcessInfo
-
getEventData
protected <T> T getEventData(org.osgi.service.event.Event event)
- Type Parameters:
T
-- Parameters:
event
-
-
getEventProperty
protected <T> T getEventProperty(org.osgi.service.event.Event event, String property)
- Type Parameters:
T
-- Parameters:
event
-property
-
-
addError
protected void addError(org.osgi.service.event.Event event, Throwable e)
- Parameters:
event
-e
-
-
addErrorMessage
protected void addErrorMessage(org.osgi.service.event.Event event, String errorMessage)
- Parameters:
event
-errorMessage
-
-
-