public class DefaultProxyManager extends ApiDefaultProxyAbstractManager
DefaultProxyManager
is a singleton factory class that provides clients with Proxy instances. Proxies
represent connections to AR System servers and provide access to their server via the native AR System API. Proxies
are optionally pooled by server. A client taking a proxy from the pool by calling
getProxy
must return it to the pool when done by calling
releaseProxy
and not hold onto a reference to it.
Here the DefaultProxyManager
simply instantiates Proxy on request and terminates its connection when a
client releases it. Because a connection is maintained until the proxy has been releasd, clients should not hold
references to a proxy for extended times; an AR System server license is also consumed while the connection is
active. Behavior is undefined when holding a reference to a released proxy and calling methods on it. Such practice
will also prevent the proxy from being garbage collected.
The default ProxyManager returned by getProxyManager
does not pool connections.
The system property ProxyManager
class can be set to the name of an alternative class that uses another
policy. Specifically, the API provides PoolingProxyManager if pooling of connections is desired.
Modifier and Type | Method and Description |
---|---|
ApiProxyI |
getProxy(ApiUserContextI context)
Get proxy for the AR System server specified by the context.
|
void |
releaseProxy(ApiProxyI proxy,
ApiUserContextI context)
Return a proxy for possible later reuse.
|
clear, createProxy
addCMTProxyInCMTPool, adjustProxyPoolVariables, checkCleanUpTimer, deRecodeProxy, deRecodeProxy, deRegisterARServerUser, getConnectionLifespan, getConnectionLifespanMilliSec, getConnectionTimeoutMilliSec, getIdleConnectionsPerServer, getKeyForServer, getMaxConnectedServerCMTAllowed, getMaxProxiesPerServer, getProxy, getProxy, getServerCmtTimeout, registerARServerUserCheck, releaseProxy, releaseProxy, removeCMTProxyFromCMTPool, setConnectionLifespan, setGenericUserSessionInfo, setMaxConnectedServerCMTAllowed, setServerCmtTimeout
public ApiProxyI getProxy(ApiUserContextI context) throws ARException
releaseProxy
. The proxy holds one of a limited number of connections to its
associated server. The caller must not hold a reference to the proxy after returning it.getProxy
in interface ApiProxyManagerI
getProxy
in class ApiProxyManager
ARException
- because set server port failed in the serverpublic void releaseProxy(ApiProxyI proxy, ApiUserContextI context)
ProxyManager
being used pools connections or not. The specified context is used to determine which AR
System server (and its connection) is associated with this proxy. The caller must not continue to hold
a reference to the proxy after returning it to the ProxyManager
so that when it expires its
connection can be terminated and it can be garbage collected.releaseProxy
in interface ApiProxyManagerI
releaseProxy
in class ApiProxyManager
? Copyright 2013 BMC Software, Inc.