com.apama.ccyconverter
Event CurrencyConverterFactory
The Currency Converter Factory allows applications to create new instances of a Currency Converter.
The Currency Converter is designed to allow an application to get a value it can use to convert a price or value of an instrument from one currency to another.
The factory also provides the ability to connect to existing Currency Converters that have previously been created within the application. This allows applications to get values from a Currency Converter from either another context or a different monitor (IE out of scope) from the one that the Currency Converter was originally created in. While still allowing a simple, and consistent, interface to it. Some functionality is purposefully removed from the interface that is returned when applications connect to existing Currency Converter. This is to prevent mis-use by other parts of the application, such as modifying the configuration of the Currency Converter.
-
See Also:
-
com.apama.ccyconverter.CurrencyConverter - The Currency Converter object that is constructed by the Currency Converter Factory
addErrorCallback
integer addErrorCallback(action<com.apama.ccyconverter.CurrencyConverter, com.apama.utils.Error > cbError)
This action allows applications to override the default error handling action used by the Currency Converter Interface to report any errors that occur from actions called on the interface.
For example, errors on creating the Currency Converter, getting values for unknown symbols, etc
This action will have no effect on the Currency Converter once it has been created/connected. Instead the addErrorCallback() action on the Currency Converter interface object should be called.
-
Parameters:
-
cbError - The Error callback.
-
Returns:
- A reference Id that can be used to remove the callback at a later date
-
See Also:
-
com.apama.ccyconverter.ErrorConsts - The set of constants that define the types of error that may be received.
-
com.apama.ccyconverter.CurrencyConverterFactory#clearErrorCallbacks() - This action clears all the error callbacks that were registered with the Currency Converter
clearErrorCallbacks
void clearErrorCallbacks()
This action allows the application to remove all error callbacks that were added by the addErrorCallback() action.
Note that this action only affects those error callbacks that have been added on the Currency Converter Factory. This action will have no effect on the Currency Converter once it has been created/connected. Instead the clearErrorCallback() action on the Currency Converter interface object should be called.
-
See Also:
-
com.apama.ccyconverter.CurrencyConverterFactory#addErrorCallback() - This action adds an error callback to the set of callbacks that will be called when an error occurs
-
com.apama.ccyconverter.CurrencyConverterFactory#removeErrorCallback() - This action removes an existing error callback using the reference identifier provided
connect
com.apama.ccyconverter.CurrencyConverter connect(context serviceManagerCtx, string name)
This action allows applications to connect to an existing instance of a Currency Converter from the current context.
The application must provide the context that the Service Framework manager has been created on (currently this is always the main context) and the name of the Currency Converter to connect to.
As the connection to an existing Currency Converter is asynchronous, the Currency Converter interface object that is returned may pend some operations made on it until such a time as it has been fully connected. If the application requires notification when the Currency Converter has been fully connected, the alternate connection action 'connectCb()' should be called instead.
The Currency Converter instance that is being connected to does not have to be created at the time of calling this action. However, it must be created before the configurable timeout period has expired, otherwise an error will be returned.
Any error callbacks that were set prior to calling this action will be used in the connection of the Currency Converter. However, any subsequent modifications to the set of error callbacks must be made through the Currency Converter interface itself. Any further modifications of the error callbacks via the Currency Converter Factory will only affect new instances of the Currency Converter that are created/connected.
Connections to existing Currency Converters cannot modify the configuration of that Currency Converter. So any configuration set in the Currency Converter prior to the connection will be ignored. If the application needs to modify the configuration of the Currency Converter, they must do so via the Currency Converter interface that was originally created.
-
Parameters:
-
serviceManagerCtx - The context that the Service Framework manager has been created on (typically this is the main context)
-
name - The name of the existing Currency Converter to connect to.
-
Returns:
- A new interface to communicate with an existing Currency Converter instance
-
See Also:
-
com.apama.ccyconverter.CurrencyConverterFactory#connectCb() - This alternate action can be used to connect to an existing Currency Converter, and also allows an application to specify an action callback to notify them when the connection to it has completed
connectCb
com.apama.ccyconverter.CurrencyConverter connectCb(context serviceManagerCtx, string name, action<com.apama.ccyconverter.CurrencyConverter > cbOnCreated)
This action allows applications to connect to an existing instance of a Currency Converter from the current context.
The application must provide the context that the Service Framework manager has been created on (currently this is always the main context) and the name of the Currency Converter to connect to.
As the connection to an existing Currency Converter is asynchronous, the Currency Converter interface object that is returned may pend some operations made on it until such a time as it has been fully connected. The action callback that is passed in will we called to notify the application when the Currency Converter has been fully connected.
The Currency Converter instance that is being connected to does not have to be created at the time of calling this action. However, it must be created before the configurable timeout period has expired, otherwise an error will be returned.
Any error callbacks that were set prior to calling this action will be used in the connection of the Currency Converter. However, any subsequent modifications to the set of error callbacks must be made through the Currency Converter interface itself. Any further modifications of the error callbacks via the Currency Converter Factory will only affect new instances of the Currency Converter that are created/connected.
Connections to existing Currency Converters cannot modify the configuration of that Currency Converter. So any configuration set in the Currency Converter prior to the connection will be ignored. If the application needs to modify the configuration of the Currency Converter, they must do so via the Currency Converter interface that was originally created.
-
Parameters:
-
serviceManagerCtx - The context that the Service Framework manager has been created on (typically this is the main context)
-
name - The name of the existing Currency Converter to connect to.
-
cbOnCreated - The user defined action callback that will be called once the Currency Converter has been fully connected
-
Returns:
- A new interface to communicate with an existing Currency Converter instance
-
See Also:
-
com.apama.ccyconverter.CurrencyConverterFactory#connect() - This alternate action can be used to connect to an existing instance of the Currency Converter in cases where an application does not need to be notified when the Currency Converter is fully connected.
create
com.apama.ccyconverter.CurrencyConverter create(context serviceManagerCtx, string name, com.apama.ccyconverter.CalculationExtension extension)
This action allows applications to create a new instance of a Currency Converter in the current context.
The application must provide the context that the Service Framework manager has been created on (currently this is always the main context) and the name of the Currency Converter, which must be unique within the application.
As the creation of the Currency Converter is asynchronous, the Currency Converter interface object that is returned may pend some operations made on it until such a time as it has been fully constructed. If the application requires notification when the Currency Converter has been fully constructed, the alternate creation action 'createCb()' should be called instead.
Any configuration and/or error callbacks that were set prior to calling this action will be used in the construction of the Currency Converter. However, any subsequent additions/modifications to the configuration or error callbacks must be made through the Currency Converter interface itself. Any further modifications via the Currency Converter Factory will only affect new instances of the Currency Converter that are created/connected.
-
Parameters:
-
serviceManagerCtx - The context that the Service Framework manager has been created on (typically this is the main context)
-
name - The name of the Currency Converter to create. This must be unique within the application.
-
extension - The Extension interface the Currency Converter will use to obtain values.
-
Returns:
- A new instance of the Currency Converter
-
See Also:
-
com.apama.ccyconverter.CurrencyConverterFactory#createCb() - This alternate action can be used to create a new instance of the Currency Converter, also allows an application to specify an action callback to notify them when the Currency Converter is fully constructed.
createCb
com.apama.ccyconverter.CurrencyConverter createCb(context serviceManagerCtx, string name, com.apama.ccyconverter.CalculationExtension extension, action<com.apama.ccyconverter.CurrencyConverter > cbOnCreated)
This action allows applications to create a new instance of a Currency Converter in the current context.
The application must provide the context that the Service Framework manager has been created on (currently this is always the main context) and the name of the Currency Converter, which must be unique within the application.
As the creation of the Currency Converter is asynchronous, the Currency Converter interface object that is returned immediately from the call may pend some operations made on it until such a time as it has been fully constructed. The action callback that is passed in will we called to notify the application when the Currency Converter has been fully constructed.
Any configuration and/or error callbacks that were set prior to calling this action will be used in the construction of the Currency Converter. However, any subsequent additions/modifications to the configuration or error callbacks must be made through the Currency Converter interface itself. Any further modifications via the Currency Converter Factory will only affect new instances of the Currency Converter that are created/connected.
-
Parameters:
-
serviceManagerCtx - The context that the Service Framework manager has been created on (typically this is the main context)
-
name - The name of the Currency Converter to create. This must be unique within the application.
-
extension - The Extension interface the Currency Converter will use to obtain values.
-
cbOnCreated - The user defined action callback that will be called once the Currency Converter has been fully constructed
-
Returns:
- A new instance of the Currency Converter
-
See Also:
-
com.apama.ccyconverter.CurrencyConverterFactory#create() - This alternate action can be used to create a new instance of the Currency Converter in cases where an application does not need to be notified when the Currency Converter is fully constructed.
getParams
com.apama.utils.Params getParams()
This action allows applications to get the configuration for that has been set on the Currency Converter Factory.
Once the Currency Converter instance has been created the configuration for that instance must be queried by the 'getParams()' action on the Currency Converter interface that is returned. The configuration of the Currency Converter is only modifiable by the created instance of the Currency Converter, and is ignored from a remotely connected interface.
-
Returns:
- The configuration that this Currency Converter should be created with
removeErrorCallback
void removeErrorCallback(integer refId)
This action allows the application to remove error callback that was added by the addErrorCallback() action using the reference Id provided.
Note that this action only affects those error callbacks that have been added on the Currency Converter Factory. This action will have no effect on the Currency Converter once it has been created/connected. Instead the removeErrorCallback() action on the Currency Converter interface object should be called.
-
Parameters:
-
refId - The reference ID as returned from the call to the addErrorCallback() action
-
See Also:
-
com.apama.ccyconverter.CurrencyConverterFactory#addErrorCallback() - This action adds an error callback to the set of callbacks that will be called when an error occurs
-
com.apama.ccyconverter.CurrencyConverterFactory#clearErrorCallbacks() - This action clears all the error callbacks that were registered with the Currency Converter
setParams
void setParams(com.apama.utils.Params config)
This action allows applications to modify any configuration for this instance of Currency Converter Interface.
Once the Currency Converter instance has been created, the configuration for that instance can only be modified by the 'setParams()' action on the Currency Converter interface that is returned. The configuration of the Currency Converter is only modifiable by the created instance of the Currency Converter, and is ignored from a remotely connected interface.
-
Parameters:
-
config - The configuration that this Currency Converter should be created with