Apama 10.3 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Session Management | Connecting to sessions
 
Connecting to sessions
 
Sample code for using factory to connect
Sample code for using handler to connect
The two simplest alternatives for connecting to a session are as follows:
*Execute SessionHandlerFactory.connect() to create a session handler and connect to the specified session without notification upon success. See Sample code for using factory to connect.
*Execute SessionHandlerFactory.create() to obtain a session handler. Then execute SessionHandler.connect() to connect to the specified session. There is no notification upon success unless you added one or more connection callbacks before you called the connect() action. See Sample code for using handler to connect.
When you execute SessionHandlerFactory.connect() or SessionHandler.connect()if the action is successful then your application is connected to the specified session. If the action is not successful the default behavior is that CMF logs an error message in the correlator log file. This is the result of the default error callback that is common to all session handlers. The default error callback logs at the ERROR level. To add or change error behavior, see Overriding default error handling for sessions.
To be notified of a successful connection, you can call SessionHandler.connectCb(), which specifies a connection callback that you provide. See Setting session callbacks.

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.