public class DroolsEventProcessor extends EventProcessor
| Modifier and Type | Field and Description |
|---|---|
static String |
EVENT_PROCESSING_MODE_CLOUD
Event processing mode: cloud (default).
|
static String |
EVENT_PROCESSING_MODE_STREAM
Event processing mode: stream.
|
| Constructor and Description |
|---|
DroolsEventProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This method closes the event processor.
|
String |
getClockType()
This method returns the clock type (default
is realtime).
|
String |
getEventProcessingMode()
This method returns the event processing mode (default
is cloud mode).
|
String |
getRuleName()
This method returns the rule name.
|
void |
init()
This method initializes the event processor.
|
protected boolean |
isStreamEventProcessingMode()
This method determines whether stream processing is being used.
|
Serializable |
process(String source,
Serializable event,
int retriesLeft)
This method processes the supplied event, and optionally
returns a transformed representation to be forwarded to
other processors.
|
void |
setClockType(String clockType)
This method sets the clock type (default
is realtime).
|
void |
setEventProcessingMode(String eventProcessingMode)
This method sets the event processing mode (default
is cloud mode).
|
void |
setResultHandler(ResultHandler handler)
This method sets the result handler, informed of a result if the event
processor is operating in an asynchronous mode.
|
void |
setRuleName(String ruleName)
This method sets the rule name.
|
getAsynchronous, getParameters, getResultHandler, getServices, setAsynchronous, setParameters, setServicespublic static final String EVENT_PROCESSING_MODE_STREAM
public static final String EVENT_PROCESSING_MODE_CLOUD
public void init()
throws Exception
init in class EventProcessorException - Failed to initializepublic void setResultHandler(ResultHandler handler)
setResultHandler in class EventProcessorhandler - The result handler
NOTE: This mechanism is experimental, so may change in the future.public String getRuleName()
public void setRuleName(String ruleName)
ruleName - The rule namepublic String getEventProcessingMode()
public void setEventProcessingMode(String eventProcessingMode)
eventProcessingMode - The event processing modeprotected boolean isStreamEventProcessingMode()
public String getClockType()
public void setClockType(String clockType)
clockType - The clock typepublic Serializable process(String source, Serializable event, int retriesLeft) throws Exception
If the event cannot be processed at this time, then an exception should be thrown to initiate a retry. The number of remaining retries is supplied, to enable the processor to take appropriate error reporting action.
process in class EventProcessorsource - The source event processor name that generated the eventevent - The event to processretriesLeft - The number of retries leftException - Failed to process event, requesting retrypublic void close()
throws Exception
close in class EventProcessorException - Failed to closeCopyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.