@ConfigurationDescription(properties={@Property(name="IsCritical",type=BOOLEAN,defaultValue="true",description="Whether the event handler is critical and problems handling the event should abort all handling of the current event."),}) public class FileEventActivityHandler extends AbstractActivityEventHandler
This implementation is robust with respect to invalid parameter configurations and conversions, that is a parameter configuration referring to an unknown field of the file is just logged. The activity will be terminated normally but in case of a mandatory output parameter this will fail the activity.
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CONF_IS_CRITICAL
Configuration key: Whether the event handler is critical and problems
handling the event should abort all handling of the current event.
|
static long |
HANDLER_FILE_IO_EXCEPTION_CODE
Code for creating UDT values based on the file fails.
|
static java.lang.String |
HANDLER_FILE_IO_EXCEPTION_STATE
State for creating UDT values based on the file fails.
|
static java.lang.String |
PARAM_AC_PREFIX
Prefix for our configuration values in the parameter's activity
configuration.
|
static java.lang.String |
PARAM_FILE
Process parameter name for the file.
|
static java.lang.String |
PARAM_FILENAME
Process parameter name for the file name.
|
static java.lang.String |
PARAM_MODIFIED_DATE
Process parameter name for the file name.
|
contexts, eventManagerconsuming, critical, exclusive, id, interruptible, logger| Constructor and Description |
|---|
FileEventActivityHandler(Configuration conf,
ActivityEventManager eventManager,
Registry registry)
Creates a new handler for file events that starts or resumes activities and
stores data from the file in their output data context.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canHandle(Event event,
boolean consumed)
Gets whether the designated event can be handled by this (sub-)class.
|
protected boolean |
processEvent(Event event,
ActivityInstance activity,
DataContext dataContext)
Processes the designated event for the designated activity instance.
|
close, handleEvent, init, kill, remove, reset, signal, suspendgetID, isConsuming, isCritical, isExclusive, isInterruptibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetID, isConsuming, isExclusive, isInterruptibleprotected static final java.lang.String CONF_IS_CRITICAL
public static final java.lang.String HANDLER_FILE_IO_EXCEPTION_STATE
public static final long HANDLER_FILE_IO_EXCEPTION_CODE
public static final java.lang.String PARAM_AC_PREFIX
public static final java.lang.String PARAM_FILENAME
public static final java.lang.String PARAM_MODIFIED_DATE
public static final java.lang.String PARAM_FILE
public FileEventActivityHandler(Configuration conf, ActivityEventManager eventManager, Registry registry)
conf - The configuration for this plugin instance.eventManager - The event manager for communicating with the runtime
service.registry - The registry for retrieving the plugin instance name
(handler ID).protected boolean canHandle(Event event, boolean consumed)
AbstractActivityEventHandlercanHandle in class AbstractActivityEventHandlerevent - The event which is about to be handled.consumed - Whether the event has been consumed by a previous event
handler.true).protected boolean processEvent(Event event, ActivityInstance activity, DataContext dataContext)
AbstractActivityEventHandlerprocessEvent in class AbstractActivityEventHandlerevent - The event to be processed.activity - The activity for which to process event. This also provides
the configuration of the activity and also the defined output
parameters.dataContext - The data context to write the values of the output
parameters to.true).ApplicationFailedException - If
ApplicationFailedException will be thrown.