#265 MBeanProxy attributes

open
nobody
None
5
2003-10-30
2003-10-30
Adrian Brock
No

The <depends> element in a -service.xml
now supports the configuration of an MBeanProxy to
reference the dependent service.

This is copied from jboss-service_3_2.dtd

<!-- The proxy-type attribute specifies the interface name
that should be exposed on an MBeanProxy pointing at the
dependent
MBean specified by the JMX ObjectName

The special value proxy-type="attribute" will use the
class declared in the MBeanAttributeInfo as the interface
for MBeanProxy.

e.g.
<mbean code="org.jboss.example.Helper"
name="domain:name=helper"/>

<mbean code="myBean" name="domain:name=x">
<depends optional-attribute-name="Helper"
proxy-type="org.jboss.example.HelperMBean"
>domain:name=helper</depends>
</mbean>

<mbean code="myBean" name="domain:name=x">
<depends optional-attribute-name="Helper"
proxy-type="attribute"
>domain:name=helper</depends>
</mbean>
-->
<!ATTLIST depends proxy-type CDATA #IMPLIED>

And here is an example from the testsuite:

package org.jboss.test.jmx.proxy;
import org.jboss.system.ServiceMBean;
public interface ProxyTestsMBean
extends ServiceMBean
{
TargetMBean getProxy();
void setProxy(TargetMBean proxy);
}

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE server
PUBLIC "-//JBoss//DTD MBean Service 3.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-service_3_2.dtd">

<server>

<mbean code="org.jboss.test.jmx.proxy.Target"
name="jboss.test:name=ProxyTarget"/>

<!-- simple reference with explicit interface type -->
<mbean code="org.jboss.test.jmx.proxy.ProxyTests"
name="jboss.test:name=ProxyTests">
<depends optional-attribute-name="Proxy"

proxy-type="org.jboss.test.jmx.proxy.TargetMBean"
>jboss.test:name=ProxyTarget</depends>
</mbean>

<!-- nested mbean -->
<mbean code="org.jboss.test.jmx.proxy.ProxyTests"
name="jboss.test:name=ProxyTestsNested">
<depends optional-attribute-name="Proxy"

proxy-type="org.jboss.test.jmx.proxy.TargetMBean">
<mbean code="org.jboss.test.jmx.proxy.Target"
name="jboss.test:name=ProxyTargetNested"/>
</depends>
</mbean>

<!-- implicit interface type -->
<mbean code="org.jboss.test.jmx.proxy.ProxyTests"
name="jboss.test:name=ProxyTestsAttribute">
<depends optional-attribute-name="Proxy"
proxy-type="attribute"
>jboss.test:name=ProxyTarget</depends>
</mbean>

</server>

Regards,
Adrian

Discussion