|
7.0 Action Request System Java API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.remedy.arsys.api.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 server. A client calling getProxy does not know
whether proxies are being pooled or not, so it must return it to the
ProxyManager when done by calling releaseProxy
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 terminiate its
connection and make the proxy available for garbage collection.
The default ProxyManager returned by getProxyManager does
not pool connections. Pooling can be initiated by by calling
setUseConnectionPooling with argument true.
Pooling can be stopped at any time by calling this method with argument
false. When pooling is stopped, all connections in the
pool will be terminated.
| Nested Class Summary | |
static class |
ProxyManager.PoolInfo
|
| Constructor Summary | |
ProxyManager()
|
|
| Method Summary | |
static ProxyManager.PoolInfo[] |
getPoolInformation()
|
abstract Proxy |
getProxy(ARServerUser context,
boolean usingContextProxy)
Get proxy for the AR Server specified by the context. |
static ProxyManager |
getProxyManager()
Get the current ProxyManager instance. |
abstract void |
releaseProxy(Proxy proxy,
ARServerUser context,
boolean usingContextProxy)
Return a proxy for possible later reuse. |
static void |
setConnectionLimits(int maxPerServer)
Configure limits on proxy pool sizes when connection pooling is used. |
static void |
setUseConnectionPooling(boolean usePooling)
Whether proxies are pooled or not is dynamically configurable. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ProxyManager()
| Method Detail |
public static ProxyManager getProxyManager()
public static void setConnectionLimits(int maxPerServer)
maxPerServer and maxTotal parameters decide the number of connections per server
and the total number of servers that the program can talk to.
So if maxPerServer is 5 and maxTotal is 40, then it means that you can have
a max of 8 servers and each can have 5 connections.
But because the proxy pool defined in the maxPerServer setting
must be filled per server (in our example, 5) before going to the next proxy
pool (the next 5), and so on, in order to spread the connections around,
you cannot then have 40 servers with 1 connection each.
maxPerServer - Maximum number of proxy connections per serverpublic static void setUseConnectionPooling(boolean usePooling)
public static ProxyManager.PoolInfo[] getPoolInformation()
public abstract Proxy getProxy(ARServerUser context,
boolean usingContextProxy)
throws ARException
returnProxy. 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.
In nested Java API calls, only the first call requests proxy from the pool and
stores that proxy in ServerUser. All the following calls use the proxy from ServerUser.
ARException - if proxy not returned
public abstract void releaseProxy(Proxy proxy,
ARServerUser context,
boolean usingContextProxy)
|
7.0 Action Request System Java API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||