Apama 10.3.1 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Order Management | Risk firewall | Creating risk firewalls | Sample code for creating risk firewall and specifying a callback
 
Sample code for creating risk firewall and specifying a callback
The following code executes the RiskFirewallFactory.createCb() action to create a risk firewall in the main context. The createCb() action executes the callback you specify when the new risk firewall is fully constructed.
using com.apama.firewall.RiskFirewallFactory;
using com.apama.firewall.RiskFirewall;
 
monitor RiskFirewallExample3 {
context mainContext := context.current();
 
action onload() {
// Use a risk firewall factory to create a new risk firewall
// instance called "MyFirewall" in the current context.
// This example uses default configuration options.
RiskFirewall rfw := (new RiskFirewallFactory).
createCb( mainContext, "MyFirewall", onFirewallCreated );
 
// Use the risk firewall to perform any needed operations.
// Some operations may pend until the risk firewall has been
// fully constructed.
}
 
action onFirewallCreated( RiskFirewall myFirewall ) {
log "The RiskFirewall is now fully constructed";
...
}
}

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.