Class BaseEventHandler
java.lang.Object
org.adempiere.base.event.annotations.BaseEventHandler
- All Implemented Interfaces:
org.osgi.service.event.EventHandler
- Direct Known Subclasses:
ImportEventHandler
,ModelEventHandler
,ProcessEventHandler
,SimpleEventHandler
public abstract class BaseEventHandler
extends Object
implements org.osgi.service.event.EventHandler
Base class for event handler that works with annotation driven event delegate (
EventTopicDelegate
).
The implementation of event delegate doesn't have to be thread safe as a new instance of delegate is created for each event call.- Author:
- hengsin
-
Field Summary
Modifier and TypeFieldDescriptionevent topic:method -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
createTopicMap
(Class<?> delegateClass) create event topic to method mapping from annotationsClass<? extends EventDelegate>
String[]
void
handleEvent
(org.osgi.service.event.Event event) protected abstract EventDelegate
newEventDelegate
(org.osgi.service.event.Event event) create new instance of event delegatevoid
setEventPropertyFilter
(String propertyName, String value) void
set event filter
-
Field Details
-
eventTopicMap
event topic:method
-
-
Constructor Details
-
BaseEventHandler
- Parameters:
delegateClass
-
-
-
Method Details
-
createTopicMap
create event topic to method mapping from annotations- Parameters:
delegateClass
-
-
getTopics
- Returns:
- arrays of event topic
-
getFilter
- Returns:
- event filter
-
setFilter
set event filter- Parameters:
filter
-
-
setEventPropertyFilter
- Parameters:
propertyName
-value
-
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
newEventDelegate
create new instance of event delegate- Parameters:
event
-- Returns:
- new
EventDelegate
instance
-
getDelegateClass
- Returns:
- event delegate class
-