|
Action Request System Java API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.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 publich 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 onto 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.
| Constructor Summary | |
ProxyManager()
|
|
| Method Summary | |
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,
int maxTotal)
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,
int maxTotal)
public static void setUseConnectionPooling(boolean usePooling)
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.
public abstract void releaseProxy(Proxy proxy,
ARServerUser context,
boolean usingContextProxy)
|
Action Request System Java API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||