Class InstanceEvent
java.lang.Object
com.aquima.interactions.profile.events.InstanceEvent
- All Implemented Interfaces:
IEvent
,IInstanceEvent
The instance event class holds the information about an instance related event.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Method Summary
Modifier and TypeMethodDescriptionstatic IEvent
create
(IEntityInstance instance) Constructs a create event for the specified instance.static IEvent
delete
(IEntityInstance instance) Constructs a delete event for the specified instance.This method returns the instance that triggered the event.int
getType()
This method will return the type of the event.void
invokeEventHook
(IEventListener listener) The invoke event hook method will be triggered for every listener that is registered to receive events.
-
Method Details
-
create
Constructs a create event for the specified instance.- Parameters:
instance
- The instance for which the event should be created.- Returns:
- The create event for the specified instance.
-
delete
Constructs a delete event for the specified instance.- Parameters:
instance
- The instance for which the event should be created.- Returns:
- The delete event for the specified instance.
-
getType
public int getType()Description copied from interface:IEvent
This method will return the type of the event. The type of the event is used to determine which event listeners should be invoked. -
getInstance
Description copied from interface:IInstanceEvent
This method returns the instance that triggered the event.- Specified by:
getInstance
in interfaceIInstanceEvent
- Returns:
- the instance that triggered the event.
-
invokeEventHook
Description copied from interface:IEvent
The invoke event hook method will be triggered for every listener that is registered to receive events. The event class that implements this interface should check if the listener that is passed as argument supports this event, and invoke the correct method of the listener to notify the listener.
For example: A context switch event can check if the listener contains a method 'onContextSwitch' and invoke that method when found.- Specified by:
invokeEventHook
in interfaceIEvent
- Parameters:
listener
- IEventListener that should be notified of the event.
-