Class ModelEventHandler<T extends PO>
java.lang.Object
org.adempiere.base.event.annotations.BaseEventHandler
org.adempiere.base.event.annotations.ModelEventHandler<T>
- All Implemented Interfaces:
org.osgi.service.event.EventHandler
Event handler for PO related events.
Developers usually don't have to use this class directly; instead, the recommended approach is to subclass
Developers usually don't have to use this class directly; instead, the recommended approach is to subclass
ModelEventDelegate
and use model event topic annotations.- Author:
- hengsin
-
Field Summary
Fields inherited from class org.adempiere.base.event.annotations.BaseEventHandler
eventTopicMap
-
Constructor Summary
ConstructorDescriptionModelEventHandler
(Class<T> modelClassType, Class<? extends ModelEventDelegate<T>> delegateClass, BiFunction<T, org.osgi.service.event.Event, ? extends ModelEventDelegate<T>> supplier) -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleEvent
(org.osgi.service.event.Event event) protected EventDelegate
newEventDelegate
(org.osgi.service.event.Event event) create new instance of event delegateMethods inherited from class org.adempiere.base.event.annotations.BaseEventHandler
createTopicMap, getDelegateClass, getFilter, getTopics, setEventPropertyFilter, setFilter
-
Constructor Details
-
ModelEventHandler
public ModelEventHandler(Class<T> modelClassType, Class<? extends ModelEventDelegate<T>> delegateClass, BiFunction<T, org.osgi.service.event.Event, ? extends ModelEventDelegate<T>> supplier) - Parameters:
modelClassType
-delegateClass
-supplier
-
-
-
Method Details
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
- Overrides:
handleEvent
in classBaseEventHandler
-
newEventDelegate
Description copied from class:BaseEventHandler
create new instance of event delegate- Specified by:
newEventDelegate
in classBaseEventHandler
- Returns:
- new
EventDelegate
instance
-