Wednesday, June 11, 2008

JBoss HA Singleton using a service interface

I wrote this post on a previous blog that was lost but resurrected it here:

Some related links are:
http://wiki.jboss.org/wiki/JBossHASingletonRemoteAccess
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=55794
http://lists.jboss.org/pipermail/jboss-user/2006-October/014954.html

You can also access the HA Singleton via the actual services interface instead of org.jboss.jmx.adaptor.rmi.RMIAdaptorExt. So for example if we wanted to access a service with the following interface com.platform.management.logging.distributed.RemoteServerLoggerMBean, then we would use something like the following:

<server>
<mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
name="jboss.jmx:type=adaptor,name=SingletonInvoker,protocol=jrmp,service=proxyFactory">
<depends optional-attribute-name="InvokerName">jboss:service=invoker,type=pooled</depends>
<depends optional-attribute-name="TargetName">
my.domain:service=HaRemoteLoggingService</depends>
<attribute name="JndiName">jmx/invoker/SingletonRMIAdaptor3< /attribute>

<attribute name="InvokeTargetMethod">true</attribute>
<attribute name="ExportedInterfaces">
com.platform.management.logging.distributed.RemoteServerLoggerMBean
</attribute>
<attribute name="ClientInterceptors">
<interceptors>

<interceptor>org.jboss.proxy.ClientMethodInterceptor< /interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor< /interceptor>
</interceptors>
</attribute>

</mbean>
</server>

No comments: