Apama Capital Markets Foundation Documentation : Capital Markets Foundation : Order Management : Risk firewall : Receiving approved orders from a risk firewall
Receiving approved orders from a risk firewall
 
Setting accepted-order callbacks
Setting accepted-amended-order callbacks
Setting accepted-cancelled-order callbacks
You use a com.apama.firewall.OrderReceiver object to receive approved orders from a risk firewall and to set callbacks that handle the approved orders according to your application requirements. Callbacks on order receiver components are the only way to process risk firewall approved orders.
To obtain an order receiver object, call the RiskFirewall.getOrderReceiver() action on the risk firewall you want to receive orders from. This can be a local risk firewall or a remotely connected risk firewall. The getOrderReceiver() action returns an OrderReceiver object that you can use with only the risk firewall that supplied it.
An order receiver receives NewOrder, AmendOrder, and CancelOrder objects that have been approved by the risk firewall. The callbacks that you add to an order receiver determine what happens to each received event. For example, you can add callbacks that send orders to an adapter, a trading algorithm, or a smart order router.
An order receiver also receives order updates from the external components that fill orders, for example, a particular market provider. The order receiver passes these order updates back into the risk firewall so the registered rule classes can increment any cumulative values and perform any housekeeping. The order update is then passed to the risk firewall order sender that originated the order. This completes the order.
An order receiver object provides actions for
*Adding callbacks that the risk firewall executes after it approves an order. You can add different callbacks according to whether the approved order is new, amended, or cancelled. See:
*Setting accepted-order callbacks
*Setting accepted-amended-order callbacks
*Setting accepted-cancelled-order callbacks
*Sending order updates into the risk firewall. The order updates must be for an order that the risk firewall is currently handling. See Processing order updates.
Typically, you use only one order receiver. However, you can obtain multiple OrderReceiver instances from a risk firewall. For example, you might want to create more than one order receiver in the case where you want to monitor approved orders that are going to an exchange. You could have one order receiver connected to your adapter and another order receiver connected to a user interface. All OrderReceiver objects receive all approved OMS events from the risk firewall.
If you spawn to a new context you cannot use the order receiver in the new context.
For an example of using an OrderReceiver object, see Sample code for using OrderSender, which shows how to use both components.
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback