Package dk.netarkivet.monitor.jmx
Class CachingProxyConnectionFactory
- java.lang.Object
-
- dk.netarkivet.monitor.jmx.CachingProxyConnectionFactory
-
- All Implemented Interfaces:
JMXProxyConnectionFactory
public class CachingProxyConnectionFactory extends Object implements JMXProxyConnectionFactory
Adds caching to another JMXProxyFactoryConnectionFactory.
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
log
The log.
-
Constructor Summary
Constructors Constructor Description CachingProxyConnectionFactory(JMXProxyConnectionFactory wrappedFactory)
Registers the factory to wrap and initializes connection cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 interfaceJMXProxyConnectionFactory
- 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)
-
-