Apama 10.3 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Order Management | Risk firewall | Connecting to risk firewalls | Sample code for connecting to risk firewall and specifying callback
 
Sample code for connecting to risk firewall and specifying callback
The following code provides an example of connecting to a risk firewall by executing the connectCb() action. After connecting to the remote risk firewall instance, the onFirewallConnected() callback is executed.
using com.apama.firewall.RiskFirewallFactory;
using com.apama.firewall.RiskFirewall;
 
monitor RiskFirewallExample5 {
context mainContext := context.current();
 
action onload() {
// Use a risk firewall factory to connect to
// a remote risk firewall instance called "MyFirewall"
// and specify a callback to be executed upon connection.
RiskFirewall rfwRemote := (new RiskFirewallFactory).
connectCb( mainContext, "MyFirewall", onFirewallConnected );
 
// Use the remotely connected risk firewall to
// perform any needed operations.
// Some operations may pend until the remotely connected
// risk firewall has been fully constructed and connected.
}
 
action onFirewallConnected(
RiskFirewall rfwRemote ) {
log "The RiskFirewall is now fully connected";

// Use the remote risk firewall to perform
// any required operations.
}
}

Copyright © 2013-2018 | 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.