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";
...
}
}