Apama 10.3.1 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Session Management | Connecting to sessions | Sample code for using factory to connect
 
Sample code for using factory to connect
The simplest way to connect to a session is to execute com.apama.session.SessionHandlerFactory.connect(). This action uses the session ID and transport ID that you specify, as well as a reference to the main context, to create a session and connect to that session. For example:
monitor SessionExample1 {
 
context mainContext := context.current();
 
action onload() {
com.apama.session.SessionHandler sessionHandler :=
(new com.apama.session.SessionHandlerFactory).connect(
mainContext, "MySession", "MyTransport");
}
...
}

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.