Apama Capital Markets Foundation Documentation : Capital Markets Foundation : Analytics : Creating and configuring a currency converter : Configuring currency converter instances : Overriding default error handling for currency converters
Overriding default error handling for currency converters
The default error handler is invoked if there is an error related to a currency converter instance. For example, if any of the following happen:
*There is an attempt to execute CurrencyConverter.setParams() on a currency converter that is connected to a remote currency converter instance.
*You try to remove an error callback or an update callback and specify an incorrect callback reference identifier.
*You try to set a parameter and specify an invalid parameter name.
The default error handler sends a message to the correlator log file at the ERROR level. To change this behavior, execute com.apama.ccyconverter.CurrencyConverter.addErrorCallback(), which adds the specified callback to the set of callbacks executed if there is an error related to that currency converter instance.
You can execute the addErrorCallback() action multiple times on the same currency converter instance to implement multiple error handling callbacks for that currency converter instance. If you add one or more error callbacks to a currency converter instance then the default error callback is not executed for that currency converter instance. However, you can call the default error callback from your own error callback by using the CurrencyConverter.defaultErrorCallback() action and providing the parameters. The default error callback will send a message to the correlator log file at the ERROR level.
The parameters of a user-defined error callback include the currency converter instance and also a com.apama.utils.Error event. An Error event has fields for a message, a dictionary of parameters, and an error type code. The addErrorCallback() action adds the specified callback to the set of callbacks executed if there is an error in the operation of the specified currency converter instance.
The com.apama.ccyconverter.ErrorConstants event defines the error type codes that can apply to currency converter instances. See the ApamaDoc for details.
When you add an error callback the return value is an integer reference ID that you can specify if you execute CurrencyConverter.removeErrorCallback() to discontinue execution of that error callback. To remove all error callbacks, execute the CurrencyConverter.clearErrorCallbacks() action. If you remove all previously set error callbacks then error handling behavior reverts to calling the default error callback.
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback