Hi Wilson,
There is no formal documentation for spring integration yet, but there is a write-up I got from a user which I am copying below. I hope this can be useful, let me know if you have further questions.
Thanks,
Nitin
"It's about a
spring intregation of xadisk in a non-JavaEE (tomcat) with transactionnal annotation. I also use atomikos as XATransaction provider.
Start point, tour message in
http://groups.google.com/group/xadisk/browse_thread/thread/e39b3292a36357c4
In my
spring conf I put :
<bean id="xaDiskNativeFS" class="org.xadisk.filesystem.N
ativeXAFileSystem" factory-method="bootXAFileSystemStandAlone">
<constructor-arg>
<bean class="org.xadisk.filesystem.standalone.StandaloneFileSystemConfiguration"
p:transactionLogFileMaxSize="${xadisk.log.size}">
<constructor-arg index="0" value="${xadisk.diskhome}" />
<constructor-arg index="1" value="${jta.uniqueName}-xaDisk" />
</bean>
</constructor-arg>
</bean>
But i don't want to deal with enlistResource each time I want to use
xaDisk. So, like it's done for EntityManager.getSession(), I write my
own class for xaDisk : see attachment. In spring conf i just add this extra line :
<bean id="xaDiskManager" class="com.adminext.admimail.util.XADiskManager" p:xaFileSystem-ref="xaDiskNativeFS"
p:jtaTransactionManager-ref="jtaTransactionManager" />
And now, to use xaDisk in a transactionnal class method I do something like that :
public class Test {
protected XADiskManager xaDiskManager;
@Required
@Inject
public void setXaDiskManager(XADiskManager xaDiskManager) {
this.xaDiskManager = xaDiskManager;
}
@Transactional
public void xaDisk(Application currentApplication) {
try {
this.xaDiskManager.getSession().createFile(new File("temp/xaTestFile" + UUID.randomUUID()), false);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
And that's all !
"