Package com.attivio.client.exposedapi
Class JmxApiServiceFactory<T>
- java.lang.Object
-
- com.attivio.service.AbstractClientApiFactory<T>
-
- com.attivio.client.exposedapi.JmxApiServiceFactory<T>
-
- Type Parameters:
T
- The type of the interface being exposed.
- All Implemented Interfaces:
ClientApiFactory<T>
,RemoteClientApiFactory<T>
public class JmxApiServiceFactory<T> extends AbstractClientApiFactory<T>
A factory class for returning objects that implement the interfaceT
. Upon construction, this class will attempt to instantiate a class of typecom.attivio.platform.service.exposed.LocalExposedApiServiceFactory
. If this class can be loaded then the factory is assumed to be running within an AIE node and will attempt to return objects from the AIE Spring application context. However, "singletons" can be registered via the static#registerSingleton(Object)
method. WhengetApi(Class)
is called, the singleton map is first checked. If present, the singleton is returned. If not, theLocalExposedApiServiceFactory
is used if the service has been marked aslocal
capable when it was registered.Otherwise a JMX remote proxy interface is created for the service. A JMX connection will be created for each unique host and port combination. This connection is reused for each proxy interface needed.
Upon first use, this class will register a callback with the ServiceFactory via
ServiceFactory.addCloseable(java.io.Closeable)
. This callback is used to close JMX connections created for proxies created by this factory.
-
-
Field Summary
-
Fields inherited from class com.attivio.service.AbstractClientApiFactory
address, description, local, params, port, ssl
-
-
Constructor Summary
Constructors Constructor Description JmxApiServiceFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getApi(java.lang.Class<T> clazz)
static void
registerSingleton(java.lang.Class<?> api, java.lang.Object singleton)
static void
reset()
void
setJmxAuthParams(JmxAuthParams params)
-
Methods inherited from class com.attivio.service.AbstractClientApiFactory
setAddress, setDescription, setFactoryParameters, setLocal, setPort, setSslPort
-
-
-
-
Method Detail
-
registerSingleton
public static void registerSingleton(java.lang.Class<?> api, java.lang.Object singleton)
-
reset
public static void reset()
-
setJmxAuthParams
public void setJmxAuthParams(JmxAuthParams params)
-
-