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
Base class to help simplify implementation of OSGi
EventHandler
.- Author:
- hengsin
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
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) Sub class should override this method to handle event.protected <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
Sub class should 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 Details
-
eventManager
-
-
Constructor Details
-
AbstractEventHandler
public AbstractEventHandler()
-
-
Method Details
-
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
- Parameters:
eventManager
-
-
unbindEventManager
- Parameters:
eventManager
-
-
doHandleEvent
protected abstract void doHandleEvent(org.osgi.service.event.Event event) Sub class should override this method to handle event.- Parameters:
event
-
-
initialize
protected abstract void initialize()Sub class should override this method to register event that the class want to listen to -
registerEvent
- Parameters:
eventTopic
-
-
registerEvent
- Parameters:
topic
-filter
-
-
registerTableEvent
- Parameters:
topic
-tableName
-
-
registerProcessEvent
- Parameters:
topic
-classOrUUID
- className or ProcessUUID
-
getPO
- Parameters:
event
-- Returns:
- PO
-
getProcessInfo
- Parameters:
event
-- Returns:
- ProcessInfo
-
getEventData
protected <T> T getEventData(org.osgi.service.event.Event event) - Type Parameters:
T
-- Parameters:
event
-
-
getEventProperty
- Type Parameters:
T
-- Parameters:
event
-property
-
-
addError
- Parameters:
event
-e
-
-
addErrorMessage
- Parameters:
event
-errorMessage
-
-