public interface EventActionHandler
GetContentEvent
, the
RetrievalEventActionHandler
interface must be used.
When implementing an event action handler, consider the following points:
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.
Therefore, you need only a single OnEvent
method for a JavaScript event handler to work with both
ObjectChangeEvent
and GetContentEvent
.
Modifier and Type | Method and Description |
---|---|
void |
onEvent(ObjectChangeEvent event,
Id subscriptionId)
Invoked when an operation on an object triggers a subscribed event,
or when a publish or republish operation is configured to
trigger an event action.
|
void onEvent(ObjectChangeEvent event, Id subscriptionId) throws EngineRuntimeException
event
- An event of type ObjectChangeEvent
.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.
For a publish or republish operation, the Id value is null
.EngineRuntimeException
© Copyright IBM Corporation 2006, 2015. All rights reserved.