Apama Capital Markets Foundation Documentation : Capital Markets Foundation : Order Management : Risk firewall : Configuring risk firewall instances : Setting risk firewall lock callbacks
Setting risk firewall lock callbacks
A risk firewall instance can be locked so that it cannot accept incoming orders for evaluation. This can be useful to immediately prevent any more trading from taking place. For example, to prevent a runaway trading algorithm.
By default, when you create a risk firewall instance it is locked until you explicitly unlock it. This ensures that no orders can enter the risk firewall before all required rule classes have been registered and rule class instances have been added. Consequently, it can be important to indicate to parts of your application when the lock state (locked or unlocked) of a risk firewall changes.
To set a lock state changed callback, execute com.apama.firewall.RiskFirewall.addLockStateChangedCallback(). This action registers a callback with the risk firewall instance it is executed on. The registered callback is executed whenever the lock status of the risk firewall instance changes. For example, this can be useful for delaying certain risk firewall operations until the risk firewall is unlocked. This action is not asynchronous and is always available.
When you execute the addLockStateChangedCallback() action you specify the callback action you want to be executed. The addLockStateChangedCallback() action returns a unique integer reference Id that you can use to remove the callback at a later date if required.
To remove a previously-added lock state changed callback, execute RiskFirewall.removeLockStateChangedCallback() and specify the integer reference Id that was returned when you added the callback. To remove all previously-added lock state changed callbacks, execute the RiskFirewall.clearLockStateChangedCallback() action.
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback