com.sap.mdm.net
Class ConnectionPoolFactory

java.lang.Object
  extended bycom.sap.mdm.net.ConnectionPoolFactory

public class ConnectionPoolFactory
extends java.lang.Object

This class manages the creation and the access to all connection pools. Each connection pool is tied to a particular MDM server and is identified by a connection tag which encodes its host name and port number.

The factory's static properties are used to set defaults for the connection pools. These defaults may be overridden by modifying each connection pool instance's settings.

The factory maintains a list of connection pool instances. A call to getInstance for the same connection tag will return a previous instance.

Examples of connection tags:
localhost
The MDM server is on the local machine and the default port number of 20005.

MyMachine;40000
The MDM server is on the "MyMachine" and the port number is 40000.

See Also:
SimpleConnectionFactory

Field Summary
static int DEFAULT_MAX_CONNECTIONS
          The default maximum number of connections for the connection pool.
static int DEFAULT_MIN_CONNECTIONS
          The default minimum number of connections for the connection pool.
static int NO_TIMEOUT
          A constant for specifying no timeout.
 
Method Summary
static ConnectionPool getInstance(java.lang.String connectionTag)
          Returns a connection pool instance associated with the MDM server specified by the connection tag.
static ConnectionPool getInstance(java.lang.String connectionTag, java.lang.String connectionSource)
          Returns a connection pool instance associated with the MDM server specified by the connection tag.
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 int getTimeout()
          Returns the SO_TIMEOUT
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 setTimeout(int timeout)
          Sets the SO_TIMEOUT.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_TIMEOUT

public static final int NO_TIMEOUT
A constant for specifying no timeout.

See Also:
Constant Field Values

DEFAULT_MIN_CONNECTIONS

public static final int DEFAULT_MIN_CONNECTIONS
The default minimum number of connections for the connection pool.

See Also:
Constant Field Values

DEFAULT_MAX_CONNECTIONS

public static final int DEFAULT_MAX_CONNECTIONS
The default maximum number of connections for the connection pool.

See Also:
Constant Field Values
Method Detail

getInstance

public static ConnectionPool getInstance(java.lang.String connectionTag)
                                  throws ConnectionException
Returns a connection pool instance associated with the MDM server specified by the connection tag.

Parameters:
connectionTag - the connection tag encoding the host name and the port number
Returns:
the connection pool
Throws:
ConnectionException - if not able to create a connection to the MDM server

getInstance

public static ConnectionPool getInstance(java.lang.String connectionTag,
                                         java.lang.String connectionSource)
                                  throws ConnectionException
Returns a connection pool instance associated with the MDM server specified by the connection tag. A set of connections can be logically grouped by giving it the same connect source identifier.

Parameters:
connectionTag - the connection tag encoding the host name and the port number
connectionSource - the connection source identifier
Returns:
the connection pool
Throws:
ConnectionException - if not able to create a connection to the MDM server

getMinConnections

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

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.

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.

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.

Parameters:
maxConnections - the maximum number of connections

setTimeout

public static void setTimeout(int timeout)
Sets the SO_TIMEOUT.

Parameters:
timeout - the timeout in milliseconds
See Also:
java.net.Socket

getTimeout

public static int getTimeout()
Returns the SO_TIMEOUT

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.