Class CachingProxyConnectionFactory

    • Field Detail

      • log

        public static final org.slf4j.Logger log
        The log.
    • Constructor Detail

      • CachingProxyConnectionFactory

        public CachingProxyConnectionFactory​(JMXProxyConnectionFactory wrappedFactory)
        Registers the factory to wrap and initializes connection cache.
        Parameters:
        wrappedFactory - The factory to add caching to.
    • Method Detail

      • getConnection

        public JMXProxyConnection getConnection​(String server,
                                                int port,
                                                int rmiPort,
                                                String userName,
                                                String password)
        If (server,port,userName) has been seen before, looks up the cached connection associated with these values. Otherwise passes the request on the the wrapped factory, caching the result for future reuse.
        Specified by:
        getConnection in interface JMXProxyConnectionFactory
        Parameters:
        server - The name of remote server to connect to.
        port - The port to connect to on the remote server.
        rmiPort - The RMI-port to use in this connection.
        userName - The user name to log in as.
        password - The password for the specified user.
        Returns:
        a connection object that can be used for accessing MBeans on the remote server.
        See Also:
        JMXProxyConnectionFactory.getConnection(String, int, int, String, String)