public class SimpleStreamProcessingContext extends Object implements StreamProcessingContext
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleStreamProcessingContext.Builder |
StreamProcessingContext.NoSuitableObjectException| Modifier and Type | Method and Description |
|---|---|
StreamProcessingContext |
addNamedObject(String name,
Object o)
Add a named object of any type.
|
static SimpleStreamProcessingContext.Builder |
builder() |
boolean |
checkFlag(String flagName)
Get the value of a given flag.
|
boolean |
clearFlag(String flagName)
Clear a flag
|
String |
evalExpression(String expression)
Evaluate a ${} expression in the context of this stream processor
|
void |
fail(String warningText)
Report that the stream processing has failed.
|
boolean |
failed()
Returns true if fail() has been called
|
MetricsCatalog |
getMetrics()
Get the metrics catalog into which this processing context reports.
|
Object |
getNamedObject(String name)
Get a raw object reference for the instance with the given name
|
<T> T |
getNamedObject(String name,
Class<T> clazz)
Get a typed object with the given name.
|
Identity |
getOperator()
Get the identity of the operator running this process.
|
<T> T |
getReqdNamedObject(String name,
Class<T> clazz)
Get a typed object with the given name and throw an exception if it's not available.
|
Source |
getSource()
Get this stream's source
|
StreamProcessingContext |
removeNamedObject(String name)
Remove a named object from this context, if it exists
|
void |
requeue(MessageAndRouting mr)
Requeue a message
|
boolean |
setFlag(String flagName)
Set a boolean flag
|
void |
warn(String warningText)
report a warning about processing the stream
|
public static SimpleStreamProcessingContext.Builder builder()
public Source getSource()
StreamProcessingContextgetSource in interface StreamProcessingContextpublic void warn(String warningText)
StreamProcessingContextwarn in interface StreamProcessingContextpublic void fail(String warningText)
StreamProcessingContextfail in interface StreamProcessingContextpublic boolean failed()
StreamProcessingContextfailed in interface StreamProcessingContextpublic StreamProcessingContext addNamedObject(String name, Object o)
StreamProcessingContextaddNamedObject in interface StreamProcessingContextpublic Object getNamedObject(String name)
StreamProcessingContextgetNamedObject in interface StreamProcessingContextpublic <T> T getNamedObject(String name, Class<T> clazz) throws ClassCastException
StreamProcessingContextgetNamedObject in interface StreamProcessingContextClassCastExceptionpublic <T> T getReqdNamedObject(String name, Class<T> clazz) throws StreamProcessingContext.NoSuitableObjectException
StreamProcessingContextgetReqdNamedObject in interface StreamProcessingContextStreamProcessingContext.NoSuitableObjectExceptionpublic StreamProcessingContext removeNamedObject(String name)
StreamProcessingContextremoveNamedObject in interface StreamProcessingContextpublic boolean setFlag(String flagName)
StreamProcessingContextsetFlag in interface StreamProcessingContextpublic boolean checkFlag(String flagName)
StreamProcessingContextcheckFlag in interface StreamProcessingContextpublic boolean clearFlag(String flagName)
StreamProcessingContextclearFlag in interface StreamProcessingContextpublic void requeue(MessageAndRouting mr)
StreamProcessingContextrequeue in interface StreamProcessingContextpublic String evalExpression(String expression)
StreamProcessingContextevalExpression in interface StreamProcessingContextpublic MetricsCatalog getMetrics()
StreamProcessingContextgetMetrics in interface StreamProcessingContextpublic Identity getOperator()
StreamProcessingContextgetOperator in interface StreamProcessingContextCopyright © 2022 continual.io. All rights reserved.