|
AR System Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bmc.arsys.apitransport.connection.ApiProxyManager com.bmc.arsys.api.ProxyManager
public abstract class ProxyManager
ProxyManager
is a factory class that provides clients with Proxy
instances. It is an abstract class that provides the interface used by clients.
It is implemented by two concrete subclasses, DefaultProxyManager and
PoolingProxyManager. Neither subclass has a public constructor (they are
package-scoped), so clients cannot access their services directly. For that, they must
call the public static method getProxyManager
of
ProxyManager
.
Proxies represent connections to AR System servers and provide access to their server via the native AR System API. Proxies are optionally pooled by a server. A client calling the server does not know whether proxies are being pooled or not, so it must release its connection when done and not hold on to a reference to it. If proxies are being pooled, this will return the proxy to the pool without terminating its connection. Otherwise, returning it will automatically terminate its connection and make the proxy available for garbage collection.
By default, the ProxyManager returned by getProxyManager
pools connections. Pooling can be stopped at any time by calling this method
with the argument false
. When pooling is stopped, all connections
in the pool are terminated. To restart pooling, call
setUseConnectionPooling
with the argument true
.
Nested Class Summary | |
---|---|
static class |
ProxyManager.PoolInfo
|
Method Summary | |
---|---|
static void |
adjustConnectionPoolVariables(ProxyManager.PoolInfo poolsetting)
Dynamically adjusts proxy connection pool sizes for each server when connection pooling is used. |
com.bmc.arsys.apitransport.ApiProxyI |
createProxy(com.bmc.arsys.apitransport.ApiUserContextI context)
Internal use only |
static com.bmc.arsys.apitransport.session.ARServerContext |
getARServerContext(String serverName,
int port)
|
static long |
getConnectionLifespan(ARTimeUnit toUnit)
get current connectionLifespan into given ARTimeUnit |
static ProxyManager.PoolInfo[] |
getPoolInformation()
|
static com.bmc.arsys.apitransport.connection.ApiProxyManagerI |
getProxyManager()
Internal use only Get the current ProxyManager instance. |
static Map<String,com.bmc.arsys.apitransport.session.ARServerContext> |
getServerContextMap()
|
static boolean |
isUseConnectionPooling()
|
static void |
setConnectionLifespan(long newConnectionLifespan,
ARTimeUnit unit)
Set number of ARTimeUnit interval that |
static void |
setConnectionLimits(int maxPerServer)
Configure limits on proxy pool sizes per server when connection pooling is used before pool is established. |
static void |
setUseConnectionPooling(boolean usePooling)
Whether proxies are pooled or not is dynamically configurable. |
Methods inherited from class com.bmc.arsys.apitransport.connection.ApiProxyManager |
---|
addCMTProxyInCMTPool, adjustProxyPoolVariables, checkCleanUpTimer, clear, deRecodeProxy, deRecodeProxy, deRegisterARServerUser, getConnectionLifespanMilliSec, getConnectionTimeoutMilliSec, getIdleConnectionsPerServer, getKeyForServer, getMaxConnectedServerCMTAllowed, getMaxProxiesPerServer, getProxy, getProxy, getProxy, getServerCmtTimeout, registerARServerUserCheck, releaseProxy, releaseProxy, releaseProxy, removeCMTProxyFromCMTPool, setMaxConnectedServerCMTAllowed, setServerCmtTimeout |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static com.bmc.arsys.apitransport.connection.ApiProxyManagerI getProxyManager()
public static void setConnectionLimits(int maxPerServer)
maxPerServer
parameter decides the number of connections per server
that the program can talk to.
Calling this method overwrites the configured value. This method will not affect the pool which is already established.
As of AR System 7.6, recommend use of #adjustConnectionVariables
maxPerServer
- Maximum number of proxy connections per serverpublic static void adjustConnectionPoolVariables(ProxyManager.PoolInfo poolsetting)
poolsetting
- requires the following values:
maxProxyPerServer
specifies the maximum number of
proxy connections per server that the program can interact with.
idleConnectionsPerServer
specifies the number of
idle connections per server that are not subject to the
connectionTimeout
limit. These connections can be idle
indefinitely.
connectionTimeout
and ARTimeUnit
specify the amount of
time in ARTimeUnits that
-- connections that exceed idleConnectionsPerServer
can be idle before being terminated. This timeout triggers active pools
to clean up their excess idle connections.
-- If the value of idleConnectionsPerServer
is set to 0, then the connection pool will be closed
when all connections are closed.
public static long getConnectionLifespan(ARTimeUnit toUnit)
ARTimeUnit
toUnit;
- if null, return in MILLISECONDS
public static void setConnectionLifespan(long newConnectionLifespan, ARTimeUnit unit)
ARTimeUnit
interval that
-- connection, with or without pool, will be load balanced since it established.
newConnectionLifespan
- Number of ARTimeUnit
intervalunit
- ARTimeUnit
public static void setUseConnectionPooling(boolean usePooling)
usePooling
- default value is truepublic static boolean isUseConnectionPooling()
public static ProxyManager.PoolInfo[] getPoolInformation()
public static Map<String,com.bmc.arsys.apitransport.session.ARServerContext> getServerContextMap()
public static com.bmc.arsys.apitransport.session.ARServerContext getARServerContext(String serverName, int port)
public com.bmc.arsys.apitransport.ApiProxyI createProxy(com.bmc.arsys.apitransport.ApiUserContextI context) throws ARException
createProxy
in interface com.bmc.arsys.apitransport.connection.ApiProxyManagerI
createProxy
in class com.bmc.arsys.apitransport.connection.ApiProxyManager
ARException
|
AR System Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |