Apama 10.3.1 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Analytics | Creating and configuring a currency converter | Configuring a currency converter factory | Overriding default error handling for currency converter factories
 
Overriding default error handling for currency converter factories
The default error handler is invoked if there is an error related to currency converter factories. For example, if any of the following happen:
*Currency converter creation or connection fails.
*You try to remove an error callback and specify an incorrect error 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.CurrencyConverterFactory.addErrorCallback(), which adds the specified callback to the set of callbacks executed if there is an error related to that currency converter factory instance.
You can execute the addErrorCallback() action multiple times on the same factory instance to implement multiple error handling callbacks for that factory instance. If you add one or more error callbacks to a factory instance then the default error callback is not executed for that factory instance.
The parameters of a user-defined error callback include the currency converter factory 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 factory instance.
The com.apama.ccyconverter.ErrorConstants event defines the error type codes, which can apply to currency converter factory 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 CurrencyConverterFactory.removeErrorCallback() to discontinue execution of that error callback. To remove all error callbacks, execute the CurrencyConverterFactory.clearErrorCallbacks() action. If you remove all previously set error callbacks then error handling behavior reverts to calling the default error callback.
Suppose you add one or more error callbacks to a currency converter factory instance. A currency converter instance created by that factory has the same error callbacks as that factory. Also, if you use that factory to connect to a remote currency converter instance, the returned currency converter uses the same error handling as the factory that was used to connect.

Copyright © 2013-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.