Apama 10.3 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Market Data Management | Using low-level MDA interfaces | Starting a session
 
Starting a session
First, obtain a SessionManager object, which can then be used to query and connect to a specific session.

// Create a new Session Manager
(new com.apama.session.SessionManagerFactory).createSessionManager(
context.current(),
onCreated);
Once the Session Manager has been created, query about the available sessions using one of the following actions:
*getAllSessionInfo() - returns a dictionary containing information about all the sessions that are currently registered with the Session Manager.
*getSessionInfo() - returns information about a specific session that has been registered with the Session Manager. See the ApamaDoc for information on parameters.
A session must be started before an application can use it. If the session requires configuration parameters, specify them as part of the start action. The configuration schema object returned in the session information object contains the configuration parameters. In the following example, the sessionID parameter comes from the SessionInfo object that is returned from getAllSessionInfo() or getSessionInfo().
// This action is called when the Session Manager is created
action onCreated( com.apama.session.SessionManagerInterface sessionIFace ) {

// Now start the session
com.apama.session.SessionConfigParams config :=
new com.apama.session.SessionConfigParams;
sessionIFace.startSession(sessionId,
config,
onSessionStartSuccess,
onSessionStartFailure);
}
If you need to reconfigure the session after it has been started, call the following action with the new configuration parameters:
// Reconfigure the session
sessionIFace.reconfigureSession(sessionId,
newConfig,
onSessionReconfigSuccess,
onSessionReconfigFailure);

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.