public class MBeanProxyFactoryBean extends MBeanClientInterceptor implements org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean
There is no need for the managed resource to implement the proxy interface, although you may find it convenient to do. It is not required that every operation and attribute in the management interface is matched by a corresponding property or method in the proxy interface.
Attempting to invoke or access any method or property on the proxy
interface that does not correspond to the management interface will lead
to an InvalidInvocationException
.
MBeanClientInterceptor
,
InvalidInvocationException
logger
Constructor and Description |
---|
MBeanProxyFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Checks that the
proxyInterface has been specified and then
generates the proxy for the target MBean. |
Object |
getObject() |
Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setProxyInterface(Class<?> proxyInterface)
Set the interface that the generated proxy will implement.
|
convertResultValueIfNecessary, destroy, doInvoke, getEnvironment, getManagementInterface, handleConnectFailure, invoke, isPrepared, prepare, setAgentId, setConnectOnStartup, setEnvironment, setManagementInterface, setObjectName, setRefreshOnConnectFailure, setServer, setServiceUrl, setUseStrictCasing
public void setProxyInterface(Class<?> proxyInterface)
This will usually be a management interface that matches the target MBean, exposing bean property setters and getters for MBean attributes and conventional Java methods for MBean operations.
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoader
in class MBeanClientInterceptor
public void afterPropertiesSet() throws MBeanServerNotFoundException, MBeanInfoRetrievalException
proxyInterface
has been specified and then
generates the proxy for the target MBean.afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class MBeanClientInterceptor
MBeanServerNotFoundException
MBeanInfoRetrievalException
@Nullable public Object getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<Object>
public Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<Object>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<Object>