com.sap.mdm.session
Class ConnectionManager

java.lang.Object
  extended bycom.sap.mdm.session.ConnectionManager

public class ConnectionManager
extends Object

This class is responsible for supplying users with connection to MDM server There are three way for creating the connection: (1) Local (non-JCA) pool connection - is created on the local VM as instance of ConnectionPool (2) Local (non-JCA) simple connection - is created on the local VM as instance of SimpleConnection (3) JCA connection - is created by JCA connection adapter and stored in WAS connection pool. This connection is represented by JcaConnectionAccessor that includes inside the SimpleConnection obtained through JCA Connector adapter.

See Also:
SessionManager

Method Summary
static ConnectionAccessor getConnectionAccessor(MdmSessionContext ctx)
          Return instance of ConnectionAccessor depending on connection type specified in the context: 1) if connectionType = AUTO_DEFINE_CONNECTION then type of connection will be defined by type of application: standalone or J2EE 1) if connectionType = LOCAL_POOL_CONNECTION then instance of ConnectionPool class will be returned 2) if connectionType = LOCAL_SIMPLE_CONNECTION then instance of SimpleConnection class will be returned 3) if connectionType = JCA_CONNECTION then instance of JcaConnectionAcessor class will be returned.
static ConnectionAccessor getConnectionAccessor(MdmSessionContext ctx, String connectionSource)
          Return instance of ConnectionAccessor depending on connection type specified in the context: 1) if connectionType = AUTO_DEFINE_CONNECTION then type of connection will be defined by type of application: standalone or J2EE 1) if connectionType = LOCAL_POOL_CONNECTION then instance of ConnectionPool class will be returned 2) if connectionType = LOCAL_SIMPLE_CONNECTION then instance of SimpleConnection class will be returned 3) if connectionType = JCA_CONNECTION then instance of JcaConnectionAcessor class will be returned.
static int getConnectionPoolTimeout()
          Returns the SO_TIMEOUT for the ConnectionPoolFactory
static int getMaxConnections()
          Returns the default value for the maximum number of connections that connection pools may open.
static int getMinConnections()
          Returns the default value for the minimum number of connections that connection pools will open upon initialization.
static SessionConnection getSessionConnection(MdmSessionContext ctx, int sessionType)
          Returns Session connection to MDM server for the specified session
static int getSimpleConnectionTimeout()
          Returns the SO_TIMEOUT for the SimpleConnectionFactory
static void setConnectionPoolTimeout(int timeout)
          Sets the SO_TIMEOUT for the ConnectionPoolFactory
static void setMaxConnections(int maxConnections)
          Sets the default value for the maximum number of connections that connection pools may open.
static void setMinConnections(int minConnections)
          Sets the default value for the minimum number of connections that connection pools will open upon initialization.
static void setSimpleConnectionTimeout(int timeout)
          Sets the SO_TIMEOUT for the SimpleConnectionFactory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConnectionAccessor

public static ConnectionAccessor getConnectionAccessor(MdmSessionContext ctx,
                                                       String connectionSource)
                                                throws ConnectionException
Return instance of ConnectionAccessor depending on connection type specified in the context: 1) if connectionType = AUTO_DEFINE_CONNECTION then type of connection will be defined by type of application: standalone or J2EE 1) if connectionType = LOCAL_POOL_CONNECTION then instance of ConnectionPool class will be returned 2) if connectionType = LOCAL_SIMPLE_CONNECTION then instance of SimpleConnection class will be returned 3) if connectionType = JCA_CONNECTION then instance of JcaConnectionAcessor class will be returned. This JcaConnectionAcessor contains SimpleConnection obtained through JCA Connector

Parameters:
ctx - MdmSessionContext including all MDM server parameters
connectionSource - the connection source used while creating a connection
Returns:
ConnectionAccessor instance
Throws:
ConnectionException
See Also:
JcaConnectionUtil

getConnectionAccessor

public static ConnectionAccessor getConnectionAccessor(MdmSessionContext ctx)
                                                throws ConnectionException
Return instance of ConnectionAccessor depending on connection type specified in the context: 1) if connectionType = AUTO_DEFINE_CONNECTION then type of connection will be defined by type of application: standalone or J2EE 1) if connectionType = LOCAL_POOL_CONNECTION then instance of ConnectionPool class will be returned 2) if connectionType = LOCAL_SIMPLE_CONNECTION then instance of SimpleConnection class will be returned 3) if connectionType = JCA_CONNECTION then instance of JcaConnectionAcessor class will be returned. This JcaConnectionAcessor contains SimpleConnection obtained through JCA Connector

Parameters:
ctx - MdmSessionContext including all MDM server parameters
Returns:
ConnectionAccessor instance
Throws:
ConnectionException
See Also:
JcaConnectionUtil

getSessionConnection

public static SessionConnection getSessionConnection(MdmSessionContext ctx,
                                                     int sessionType)
                                              throws ConnectionException,
                                                     SessionException
Returns Session connection to MDM server for the specified session

Parameters:
ctx - session context
sessionType - session type
Returns:
session connection
Throws:
ConnectionException
SessionException

getMinConnections

public static int getMinConnections()
Returns the default value for the minimum number of connections that connection pools will open upon initialization. Relevant only for ConnectionTypes.LOCAL_POOL_CONNECTION

Returns:
the minimum number of connections

setMinConnections

public static void setMinConnections(int minConnections)
Sets the default value for the minimum number of connections that connection pools will open upon initialization. This setting may be overridden on the connection pool itself. Relevant only for ConnectionTypes.LOCAL_POOL_CONNECTION

Parameters:
minConnections - the minimum number of connections

getMaxConnections

public static int getMaxConnections()
Returns the default value for the maximum number of connections that connection pools may open. Relevant only for ConnectionTypes.LOCAL_POOL_CONNECTION

Returns:
the maximum number of connections

setMaxConnections

public static void setMaxConnections(int maxConnections)
Sets the default value for the maximum number of connections that connection pools may open. Relevant only for ConnectionTypes.LOCAL_POOL_CONNECTION

Parameters:
maxConnections - the maximum number of connections

setConnectionPoolTimeout

public static void setConnectionPoolTimeout(int timeout)
Sets the SO_TIMEOUT for the ConnectionPoolFactory

Parameters:
timeout - the timeout in milliseconds
See Also:
Socket

getConnectionPoolTimeout

public static int getConnectionPoolTimeout()
Returns the SO_TIMEOUT for the ConnectionPoolFactory

Returns:
the timeout

setSimpleConnectionTimeout

public static void setSimpleConnectionTimeout(int timeout)
Sets the SO_TIMEOUT for the SimpleConnectionFactory.

Parameters:
timeout - the timeout in milliseconds
See Also:
Socket

getSimpleConnectionTimeout

public static int getSimpleConnectionTimeout()
Returns the SO_TIMEOUT for the SimpleConnectionFactory

Returns:
the timeout


Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.