[jboss-dev-forums] [Design of JCA on JBoss] - Re: JcaXAResourceRecovery
adrian@jboss.org
do-not-reply at jboss.com
Fri Feb 29 08:21:50 EST 2008
With the MC in JBoss5 we could do something like the following:
NOTE: I allow mutlple XAResources because of the ResourceAdapter
http://java.sun.com/j2ee/1.4/docs/api/javax/resource/spi/ResourceAdapter.html
But it would be the job of our Resource Adapter deployment to add
the known activation specs, i.e. those that have been activated.
| package org.jboss.tm; // in jboss integration
|
| public interface XAResourceRecovery
| {
| XAResource[] getXAResources();
| }
|
You would then have methods:
| public void addXAResourceRecovery(XAResourceRecovery recovery) {}
| public void removeXAResourceRecovery(XAResourceRecovery recovery) {}
|
The wiring can then either be done manually (including programmatically - see MBeans below)
| <bean "MyConnectionManager" ...>
| <install bean="TMService" method="addXAResourceRecovery">
| <parameter><this/></parameter>
| </install>
| <uninstall bean="TMService" method="removeXAResourceRecovery">
| <parameter><this/></parameter>
| </uninstall>
| </bean>
|
or "automagically" by you asking to be injected with any bean
that implements the interface.
| <bean name="TMService" ...>
| <incallback method="addXAResourceRecovery"/>
| <uncallback method="addXAResourceRecovery"/>
| </bean>
|
The automagic approach is less error prone, but doesn't work with MBeans.
LEGACY
For the old MBeans it would have to do something like:
| <mbean ...>
| <attribute name="TMService><inject bean="TMService"/></attribute>
|
| public void startService() throws Exception
| {
| getTMService().addXAResourceRecovery(this);
| }
| public void stopService() throws Exception
| {
| getTMService().removeXAResourceRecovery(this);
| }
|
IMPLEMENTATION AND SECURITY
The construction of the XAResource (including the injection
of a "Recovery Subject" from the security config - see above) would
be handled by whoever implements the XAResourceRecovery.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133205#4133205
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133205
More information about the jboss-dev-forums
mailing list