com.sap.conn.jco.server
Class JCoServerFactory

java.lang.Object
  extended by com.sap.conn.jco.server.JCoServerFactory

public abstract class JCoServerFactory
extends java.lang.Object

Factory for creating server instances used by JCo applications.

The factory uses the instance of ServerDataProvider registered at the environment to get the server configuration properties. In each environment a suitable implementation of the ServerDataProvider has to be registered to ensure an appropriate management of server properties. The registration is performed with
com.sap.conn.jco.ext.Environment.registerServerDataProvider(ServerDataProvider).

Note: A server instance may become invalid if the server configuration is changed or removed. In such cases the running operation will be finished, but further usage of the invalidated server instance will be blocked by throwing a JCoException with the key JCO_ERROR_SERVER_DATA_INVALID.
The application may fetch an updated server instance from the JCoServerFactory, if it is suitable for the application scenario.


Method Summary
static JCoServerFactory get()
          Deprecated. Reserved for internal use - visibility might be reduced in future versions without further notice. Use the static methods instead.
static int getNumberOfServerConnections(java.lang.String serverName)
          Queries the number of server connections registered at the SAP gateway.
abstract  int getNumServerConnections(java.lang.String serverName)
          Deprecated. Reserved for internal use - visibility might be reduced in future versions without further notice. Use getNumberOfServerConnections(String) instead.
static JCoServer getServer(java.lang.String serverName)
          Creates a new JCo server instance or returns the one which is already available.
abstract  JCoServer getServerInstance(java.lang.String serverName)
          Deprecated. Reserved for internal use - visibility might be reduced in future versions without further notice. Use getServer(String) instead.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

@Deprecated
public static JCoServerFactory get()
Deprecated. Reserved for internal use - visibility might be reduced in future versions without further notice. Use the static methods instead.

Do not use this method.

Returns:
the server factory instance

getServerInstance

@Deprecated
public abstract JCoServer getServerInstance(java.lang.String serverName)
                                     throws JCoException
Deprecated. Reserved for internal use - visibility might be reduced in future versions without further notice. Use getServer(String) instead.

Do not use this method.

Parameters:
serverName - the name of the server for which a JCoServer instance shall be returned
Returns:
the JCoServer instance for the specified name
Throws:
JCoException - if the server configuration is wrong, e.g. a mandatory parameter is missing

getNumServerConnections

@Deprecated
public abstract int getNumServerConnections(java.lang.String serverName)
                                     throws JCoException
Deprecated. Reserved for internal use - visibility might be reduced in future versions without further notice. Use getNumberOfServerConnections(String) instead.

Do not use this method.

Parameters:
serverName - the name of the server for which the number of registered server connections shall be queried
Returns:
number of registered server connections
Throws:
JCoException - if the gateway cannot be queried

getServer

public static JCoServer getServer(java.lang.String serverName)
                           throws JCoException
Creates a new JCo server instance or returns the one which is already available.

Parameters:
serverName - the name of the server for which we want to get a server instance
Returns:
the JCoServer instance for the specified name
Throws:
JCoException - if the server configuration is wrong, e.g. a mandatory parameter is missing

getNumberOfServerConnections

public static int getNumberOfServerConnections(java.lang.String serverName)
                                        throws JCoException
Queries the number of server connections registered at the SAP gateway.

Parameters:
serverName - the serverName for which the number of registered server connections shall be queried
Returns:
number of registered server connections
Throws:
JCoException - if the gateway cannot be queried


Copyright © 2008-2016 SAP SE. All Rights Reserved.