public class EngineImpl extends AbstractEngine
Engine
Modifier and Type | Method and Description |
---|---|
void |
addClosePositionCallback(long securityId,
java.util.function.Consumer<PositionMutationVO> consumer)
Adds a
Consumer to the given Engine that will be invoked as soon as a Position
on the given Security has been closed. |
void |
addEventType(java.lang.String eventTypeName,
java.lang.String eventClassName)
Adds the given Event Type to the specified Engine.
|
void |
addFirstTickCallback(java.util.Collection<java.lang.Long> securityIds,
java.util.function.BiConsumer<java.lang.String,java.util.List<TickVO>> consumer)
Adds a
BiConsumer to the given Engine that will be invoked as soon as at least one Tick has arrived
for each of the specified securities |
void |
addFullExecutionCallback(java.util.Collection<java.lang.String> orderIntIds)
Adds a callback to the given Engine that will throw an exception unless all
orders have been fully
executed. |
void |
addOpenPositionCallback(long securityId,
java.util.function.Consumer<PositionMutationVO> consumer)
Adds a
Consumer to the given Engine that will be invoked as soon as a new Position
on the given Security has been opened or modified. |
void |
addTimerCallback(java.util.Date dateTime,
java.lang.String name,
java.util.function.Consumer<java.util.Date> consumer)
Adds a
Consumer to the given Engine that will be invoked at the give time. |
void |
addTradeCallback(java.util.Collection<java.lang.String> orderIntIds,
java.util.function.BiConsumer<java.lang.String,java.util.List<OrderStatusVO>> consumer)
Adds a
BiConsumer to the given Engine that will be invoked as soon as all orders have been
fully executed, rejected or cancelled. |
void |
addTradePersistedCallback(java.util.Collection<java.lang.String> orderIntIds,
java.util.function.Consumer<java.util.List<OrderCompletionVO>> consumer)
Adds a
Consumer to the given Engine that will be invoked as soon as all orders
have been fully executed or cancelled and fully persisted. |
void |
coordinate(com.espertech.esperio.CoordinatedAdapter inputAdapter)
Coordinates the given InputAdapter.
|
void |
deployAllModules()
Deploys all modules defined for given Strategy
|
void |
deployInitModules()
Deploys all init-modules defined for given Strategy
|
void |
deployModule(java.lang.String moduleName)
Deploys the specified module into the specified Engine.
|
void |
deployRunModules()
Deploys all run-modules defined for given Strategy
|
void |
deployStatement(java.lang.String statementExpression)
Deploys the statement from the given
statementExpression into the specified Engine. |
void |
deployStatement(java.lang.String moduleName,
java.lang.String statementName)
Deploys the statement from the given
moduleName with the given statementName into the specified Engine. |
void |
deployStatement(java.lang.String moduleName,
java.lang.String statementName,
java.lang.String alias,
java.lang.Object[] params)
Deploys the statement from the given
moduleName with the given statementName into the specified Engine. |
void |
deployStatement(java.lang.String moduleName,
java.lang.String statementName,
java.lang.String alias,
java.lang.Object[] params,
java.lang.Object callback)
Deploys the statement from the given
moduleName with the given statementName into the specified Engine. |
void |
deployStatement(java.lang.String moduleName,
java.lang.String statementName,
java.lang.String alias,
java.lang.Object[] params,
java.lang.Object callback,
boolean force)
Deploys the statement from the given
moduleName with the given statementName into the specified Engine. |
void |
destroy()
Destroys the specified Engine.
|
java.util.List |
executeQuery(java.lang.String query)
Executes an arbitrary EPL query on the Engine.
|
java.lang.Object |
executeSingelObjectQuery(java.lang.String query)
Executes an arbitrary EPL query that is supposed to return one single object on the Engine.
|
java.lang.Object |
executeSingelObjectQuery(java.lang.String query,
java.lang.String attributeName)
Executes an arbitrary EPL query that is supposed to return one single object on the Engine.
|
java.util.List |
getAllEvents(java.lang.String statementName)
Retrieves all events currently held by the given statement.
|
java.util.List |
getAllEventsProperty(java.lang.String statementName,
java.lang.String property)
Retrieves all events currently held by the given statement and returns the property by the
propertyName for all events. |
java.util.Date |
getCurrentTime()
Returns the current time of the given Engine
|
long |
getCurrentTimeInMillis()
Returns the current time of the given Engine
|
java.lang.Object |
getLastEvent(java.lang.String statementName)
Retrieves the last event currently held by the given statement.
|
java.lang.Object |
getLastEventProperty(java.lang.String statementName,
java.lang.String propertyName)
Retrieves the last event currently held by the given statement and returns the property by the
propertyName |
java.lang.Object |
getVariableValue(java.lang.String variableName)
Returns the value of the specified Variable
|
void |
initCoordination()
Prepares the given Engine for coordinated input of CSV-Files
|
void |
initialize()
Initializes the specified Engine.
|
void |
initServices()
Makes services available via variables
|
boolean |
isDeployed(java.lang.String statementNameRegex)
Returns true if the statement by the given
statementNameRegex is deployed. |
boolean |
isDestroyed()
returns true if the Engine is destroyed.
|
void |
restartStatement(java.lang.String statementName)
Restarts the given Statement
|
void |
sendEvent(java.lang.Object obj)
Sends an Event into this Engine.
|
void |
setInternalClock(boolean internalClock)
Sets the internal clock of the specified Engine
|
void |
setVariableValue(java.lang.String variableName,
java.lang.Object value)
sets the value of the specified Variable
|
void |
setVariableValueFromString(java.lang.String variableName,
java.lang.String value)
sets the value of the specified Variable by parsing the given String value.
|
void |
startCoordination()
Starts coordination for the given Engine.
|
void |
undeployAllStatements()
Undeploys all statements from the specified Engine.
|
void |
undeployModule(java.lang.String moduleName)
Undeploys the specified module from the specified Engine.
|
void |
undeployStatement(java.lang.String statementName)
Undeploys the specified statement from the specified Engine.
|
getStrategyName, isInternalClock, toString
public boolean isDestroyed()
Engine
isDestroyed
in interface Engine
isDestroyed
in class AbstractEngine
public void destroy()
Engine
destroy
in interface Engine
destroy
in class AbstractEngine
public void initialize()
Engine
initialize
in interface Engine
initialize
in class AbstractEngine
public void initServices()
Engine
initServices
in interface Engine
initServices
in class AbstractEngine
public void deployStatement(java.lang.String statementExpression)
Engine
statementExpression
into the specified Engine.deployStatement
in interface Engine
deployStatement
in class AbstractEngine
public void deployStatement(java.lang.String moduleName, java.lang.String statementName)
Engine
moduleName
with the given statementName
into the specified Engine.deployStatement
in interface Engine
deployStatement
in class AbstractEngine
public void deployStatement(java.lang.String moduleName, java.lang.String statementName, java.lang.String alias, java.lang.Object[] params)
Engine
moduleName
with the given statementName
into the specified Engine.
In addition the given alias
and Prepared Statement params
are set on the statementdeployStatement
in interface Engine
deployStatement
in class AbstractEngine
public void deployStatement(java.lang.String moduleName, java.lang.String statementName, java.lang.String alias, java.lang.Object[] params, java.lang.Object callback)
Engine
moduleName
with the given statementName
into the specified Engine.
In addition the given alias
, Prepared Statement params
and callback
are set on the statement. If
the a statement with the same name exists the command is aborteddeployStatement
in interface Engine
deployStatement
in class AbstractEngine
public void deployStatement(java.lang.String moduleName, java.lang.String statementName, java.lang.String alias, java.lang.Object[] params, java.lang.Object callback, boolean force)
Engine
moduleName
with the given statementName
into the specified Engine.
In addition the given alias
, Prepared Statement params
and callback
are set on the statement. If
force
is true the statement will be deployed even if a statement with the same name already exsists.deployStatement
in interface Engine
deployStatement
in class AbstractEngine
public void deployAllModules()
Engine
deployAllModules
in interface Engine
deployAllModules
in class AbstractEngine
public void deployInitModules()
Engine
deployInitModules
in interface Engine
deployInitModules
in class AbstractEngine
public void deployRunModules()
Engine
deployRunModules
in interface Engine
deployRunModules
in class AbstractEngine
public void deployModule(java.lang.String moduleName)
Engine
deployModule
in interface Engine
deployModule
in class AbstractEngine
public boolean isDeployed(java.lang.String statementNameRegex)
Engine
statementNameRegex
is deployed.isDeployed
in interface Engine
isDeployed
in class AbstractEngine
statementNameRegex
- statement name regular expressionpublic void undeployAllStatements()
Engine
undeployAllStatements
in interface Engine
undeployAllStatements
in class AbstractEngine
public void undeployStatement(java.lang.String statementName)
Engine
undeployStatement
in interface Engine
undeployStatement
in class AbstractEngine
public void restartStatement(java.lang.String statementName)
Engine
restartStatement
in interface Engine
restartStatement
in class AbstractEngine
public void undeployModule(java.lang.String moduleName)
Engine
undeployModule
in interface Engine
undeployModule
in class AbstractEngine
public void addEventType(java.lang.String eventTypeName, java.lang.String eventClassName)
Engine
esper-xxx.cfg.xml
fileaddEventType
in interface Engine
addEventType
in class AbstractEngine
public void sendEvent(java.lang.Object obj)
Engine
sendEvent
in interface Engine
sendEvent
in class AbstractEngine
public java.util.List executeQuery(java.lang.String query)
Engine
executeQuery
in interface Engine
executeQuery
in class AbstractEngine
public java.lang.Object executeSingelObjectQuery(java.lang.String query, java.lang.String attributeName)
Engine
executeSingelObjectQuery
in interface Engine
executeSingelObjectQuery
in class AbstractEngine
query
- EPL expressionattributeName
- name of the attribute if the query produces a result
represented by a map of attributes.public java.lang.Object executeSingelObjectQuery(java.lang.String query)
Engine
executeSingelObjectQuery
in interface Engine
executeSingelObjectQuery
in class AbstractEngine
public java.lang.Object getLastEvent(java.lang.String statementName)
Engine
getLastEvent
in interface Engine
getLastEvent
in class AbstractEngine
public java.lang.Object getLastEventProperty(java.lang.String statementName, java.lang.String propertyName)
Engine
propertyName
getLastEventProperty
in interface Engine
getLastEventProperty
in class AbstractEngine
public java.util.List getAllEvents(java.lang.String statementName)
Engine
getAllEvents
in interface Engine
getAllEvents
in class AbstractEngine
public java.util.List getAllEventsProperty(java.lang.String statementName, java.lang.String property)
Engine
propertyName
for all events.getAllEventsProperty
in interface Engine
getAllEventsProperty
in class AbstractEngine
public void setInternalClock(boolean internalClock)
Engine
setInternalClock
in interface Engine
setInternalClock
in class AbstractEngine
public long getCurrentTimeInMillis()
Engine
getCurrentTimeInMillis
in interface Engine
getCurrentTimeInMillis
in class AbstractEngine
public java.util.Date getCurrentTime()
Engine
getCurrentTime
in interface Engine
getCurrentTime
in class AbstractEngine
public void initCoordination()
Engine
initCoordination
in interface Engine
initCoordination
in class AbstractEngine
public void coordinate(com.espertech.esperio.CoordinatedAdapter inputAdapter)
Engine
coordinate
in interface Engine
coordinate
in class AbstractEngine
public void startCoordination()
Engine
startCoordination
in interface Engine
startCoordination
in class AbstractEngine
public void setVariableValue(java.lang.String variableName, java.lang.Object value)
Engine
setVariableValue
in interface Engine
setVariableValue
in class AbstractEngine
public void setVariableValueFromString(java.lang.String variableName, java.lang.String value)
Engine
setVariableValueFromString
in interface Engine
setVariableValueFromString
in class AbstractEngine
public java.lang.Object getVariableValue(java.lang.String variableName)
Engine
getVariableValue
in interface Engine
getVariableValue
in class AbstractEngine
public void addTradeCallback(java.util.Collection<java.lang.String> orderIntIds, java.util.function.BiConsumer<java.lang.String,java.util.List<OrderStatusVO>> consumer)
Engine
BiConsumer
to the given Engine that will be invoked as soon as all orders
have been
fully executed, rejected or cancelled.addTradeCallback
in interface Engine
addTradeCallback
in class AbstractEngine
public void addFullExecutionCallback(java.util.Collection<java.lang.String> orderIntIds)
Engine
orders
have been fully
executed.addFullExecutionCallback
in interface Engine
addFullExecutionCallback
in class AbstractEngine
public void addTradePersistedCallback(java.util.Collection<java.lang.String> orderIntIds, java.util.function.Consumer<java.util.List<OrderCompletionVO>> consumer)
Engine
Consumer
to the given Engine that will be invoked as soon as all orders
have been fully executed or cancelled and fully persisted.addTradePersistedCallback
in interface Engine
addTradePersistedCallback
in class AbstractEngine
public void addFirstTickCallback(java.util.Collection<java.lang.Long> securityIds, java.util.function.BiConsumer<java.lang.String,java.util.List<TickVO>> consumer)
Engine
BiConsumer
to the given Engine that will be invoked as soon as at least one Tick has arrived
for each of the specified securities
addFirstTickCallback
in interface Engine
addFirstTickCallback
in class AbstractEngine
public void addOpenPositionCallback(long securityId, java.util.function.Consumer<PositionMutationVO> consumer)
Engine
Consumer
to the given Engine that will be invoked as soon as a new Position
on the given Security has been opened or modified.addOpenPositionCallback
in interface Engine
addOpenPositionCallback
in class AbstractEngine
public void addClosePositionCallback(long securityId, java.util.function.Consumer<PositionMutationVO> consumer)
Engine
Consumer
to the given Engine that will be invoked as soon as a Position
on the given Security has been closed.addClosePositionCallback
in interface Engine
addClosePositionCallback
in class AbstractEngine
public void addTimerCallback(java.util.Date dateTime, java.lang.String name, java.util.function.Consumer<java.util.Date> consumer)
Engine
Consumer
to the given Engine that will be invoked at the give time.
An optional name can be added which will be appended to the statement name.addTimerCallback
in interface Engine
addTimerCallback
in class AbstractEngine