Class 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 interface T. Upon construction, this class will attempt to instantiate a class of type com.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. When getApi(Class) is called, the singleton map is first checked. If present, the singleton is returned. If not, the LocalExposedApiServiceFactory is used if the service has been marked as local 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.

    • Constructor Detail

      • JmxApiServiceFactory

        public JmxApiServiceFactory()
    • Method Detail

      • registerSingleton

        public static void registerSingleton​(java.lang.Class<?> api,
                                             java.lang.Object singleton)
      • reset

        public static void reset()
      • getApi

        public T getApi​(java.lang.Class<T> clazz)
      • setJmxAuthParams

        public void setJmxAuthParams​(JmxAuthParams params)