public interface RetrievalEventActionHandler
GetContentEvent
,
use the EventActionHandler
interface instead.
When implementing an event action handler, consider the following points:
RetrievalEventActionHandler
implementation works only with an an event of type GetContentEvent
.
If a handler written exclusively for GetContentEvent
inadvertently has other events included in the subscribed event list for a subscription,
a runtime exception will be thrown because the first event passed to the handler will be an ObjectChangeEvent
.Subscription
object) to run synchronously or asynchronously.If an asynchronous event action handler fails, an exception will be logged to the server,
and the asynchronous action will remain in the QueueItem
and retried as often as set in the RetryCount property.
A synchronous event action handler cannot update a source object. It is not supported.
You can check in a Java event action handler as a CodeModule
object,
or you can specify a Java event action handler in the classpath of the application server where the Content Engine is running.
If a Java event handler is intended to work with both ObjectChangeEvent
and GetContentEvent
,
it must implement both interfaces. For example:
public class NewEventHandler implements EventActionHandler, RetrievalEventActionHandler
.
Because JavaScript is loosely typed, you do not specify the event type in the onEvent
method signature.
OnEvent
method for a JavaScript event handler to work with both
ObjectChangeEvent
and GetContentEvent
.
Modifier and Type | Method and Description |
---|---|
void |
onEvent(RetrievalEvent event,
Id subscriptionId)
Invoked when an operation on an object triggers a subscribed event.
|
void onEvent(RetrievalEvent event, Id subscriptionId) throws EngineRuntimeException
GetContentEvent
is triggered.event
- An event of type RetrievalEvent
.
Of the RetrievalEvent
subclasses, only GetContentEvent
is subscribable.
so only a GetContentEvent
object can be passed to this method.subscriptionId
- An Id value that represents the GUID of the subscription that defines the triggered event.
You can use this value to retrieve the Subscription
object with which this handler is associated.EngineRuntimeException
© Copyright IBM Corporation 2006, 2015. All rights reserved.