public class MBeanProxyFactory
extends java.lang.Object
The ProxyInfo class provides mapping information between ObjectNames and Interfaces. The underlying connection is obtained from a ConnectionProvider.
| Constructor and Description | 
|---|
MBeanProxyFactory()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
clearCache()  | 
<T> T | 
findOrCreate(java.lang.Class<T> intf)
Returns a proxy object for the specified interface. 
 | 
java.lang.Object | 
findOrCreate(javax.management.ObjectName name)  | 
<T> T | 
findOrCreate(javax.management.ObjectName name,
            java.lang.Class<T> intf)  | 
ObjectCache | 
getCache()  | 
javax.management.MBeanServerConnection | 
getConnection()  | 
static <T> javax.management.ObjectName | 
getObjectName(T proxy)
Find the  
ObjectName associated with a proxy object. | 
Session | 
getSession()  | 
java.lang.Class<? extends java.lang.RuntimeException> | 
getUndeclaredExceptionClass()  | 
static MBeanProxyFactory | 
newInstance()
Create a new factory. 
 | 
void | 
release()  | 
void | 
setCache(ObjectCache cache)  | 
void | 
setConnectionProvider(ConnectionProvider<javax.management.MBeanServerConnection> connProvider)  | 
void | 
setProxyInfo(ProxyInfo proxyInfo)  | 
void | 
setSession(Session session)  | 
void | 
setUndeclaredExceptionClass(java.lang.Class<? extends java.lang.RuntimeException> undeclaredExceptionClass)
Sets the  
RuntimeException class to be used as a wrapper when invoking the remote
 mbean throws an error that is not declared as part of the proxy's method. | 
public static MBeanProxyFactory newInstance()
The factory should be injected with ProxyInfo and ConnectionProvider before being used.
public void setProxyInfo(ProxyInfo proxyInfo)
public void setConnectionProvider(ConnectionProvider<javax.management.MBeanServerConnection> connProvider)
public javax.management.MBeanServerConnection getConnection()
public void setCache(ObjectCache cache)
public ObjectCache getCache()
public void clearCache()
public void setSession(Session session)
public Session getSession()
public void setUndeclaredExceptionClass(java.lang.Class<? extends java.lang.RuntimeException> undeclaredExceptionClass)
RuntimeException class to be used as a wrapper when invoking the remote
 mbean throws an error that is not declared as part of the proxy's method.undeclaredExceptionClass - the wrapper class to use.public java.lang.Class<? extends java.lang.RuntimeException> getUndeclaredExceptionClass()
public void release()
public <T> T findOrCreate(java.lang.Class<T> intf)
intf - UnsupportOperationException - if a mapping to an MBean could not
 be located for that interface.public java.lang.Object findOrCreate(javax.management.ObjectName name)
public <T> T findOrCreate(javax.management.ObjectName name,
                          java.lang.Class<T> intf)
public static <T> javax.management.ObjectName getObjectName(T proxy)
                                                     throws java.lang.IllegalArgumentException
ObjectName associated with a proxy object.T - proxy - java.lang.IllegalArgumentException - if object is not a proxy for an MBean.