public interface VariableService
See implementation class for further details.
Modifier and Type | Method and Description |
---|---|
void |
allocateVariableState(String variableName,
int agentInstanceId,
StatementExtensionSvcContext extensionServicesContext,
boolean isRecoveringResilient) |
void |
checkAndWrite(String variableName,
int agentInstanceId,
Object newValue)
Check type of the value supplied and writes the new variable value.
|
void |
commit()
Commits the variable outstanding changes.
|
void |
createNewVariable(String optionalContextName,
String variableName,
String type,
boolean constant,
boolean array,
boolean arrayOfPrimitive,
Object value,
EngineImportService engineImportService) |
void |
deallocateVariableState(String variableName,
int agentInstanceId) |
void |
destroy() |
VariableReader |
getReader(String variableName,
int agentInstanceIdAccessor)
Returns a reader that provides access to variable values.
|
ConcurrentHashMap<Integer,VariableReader> |
getReadersPerCP(String variableName) |
ReadWriteLock |
getReadWriteLock()
Lock for use in atomic writes to the variable space.
|
VariableMetaData |
getVariableMetaData(String variableName) |
Map<String,VariableReader> |
getVariableReadersNonCP()
Returns a map of variable name and reader, for thread-safe iteration.
|
String |
isContextVariable(String propertyName) |
void |
registerCallback(String variableName,
int agentInstanceId,
VariableChangeCallback variableChangeCallback)
Registers a callback invoked when the variable is written with a new value.
|
void |
removeVariableIfFound(String name)
Removes a variable.
|
void |
rollback()
Rolls back the variable outstanding changes.
|
void |
setLocalVersion()
Sets the variable version that subsequent reads consider.
|
void |
unregisterCallback(String variableName,
int agentInstanceId,
VariableChangeCallback variableChangeCallback)
Removes a callback.
|
void |
write(int variableNumber,
int agentInstanceId,
Object newValue)
Writes a new variable value.
|
void setLocalVersion()
ReadWriteLock getReadWriteLock()
void createNewVariable(String optionalContextName, String variableName, String type, boolean constant, boolean array, boolean arrayOfPrimitive, Object value, EngineImportService engineImportService) throws VariableExistsException, VariableTypeException
VariableReader getReader(String variableName, int agentInstanceIdAccessor)
variableName
- the variable that the reader should readagentInstanceIdAccessor
- agent instance id of accessorvoid registerCallback(String variableName, int agentInstanceId, VariableChangeCallback variableChangeCallback)
variableName
- variable nameagentInstanceId
- agent instance idvariableChangeCallback
- a callbackvoid unregisterCallback(String variableName, int agentInstanceId, VariableChangeCallback variableChangeCallback)
variableName
- variable nameagentInstanceId
- agent instance idvariableChangeCallback
- a callbackvoid write(int variableNumber, int agentInstanceId, Object newValue)
Must be followed by either a commit or rollback.
variableNumber
- the index number of the variable to write (from VariableReader)newValue
- the new valueagentInstanceId
- agent instance idvoid checkAndWrite(String variableName, int agentInstanceId, Object newValue)
Must be followed by either a commit or rollback.
variableName
- variable nameagentInstanceId
- agent instance idnewValue
- the new valuevoid commit()
void rollback()
Map<String,VariableReader> getVariableReadersNonCP()
VariableMetaData getVariableMetaData(String variableName)
void removeVariableIfFound(String name)
name
- to removevoid destroy()
void allocateVariableState(String variableName, int agentInstanceId, StatementExtensionSvcContext extensionServicesContext, boolean isRecoveringResilient)
void deallocateVariableState(String variableName, int agentInstanceId)
ConcurrentHashMap<Integer,VariableReader> getReadersPerCP(String variableName)