This content has been marked as final. Show 2 replies
No. If you want to do that, i.e. a real dependency, don't use the TransactionManagerLocator.
You should inject it directly, see jca-jboss-beans.xml:
<!-- The transaction manager --> <property name="transactionManager"><inject bean="TransactionManager" property="transactionManager"/></property>
If you wanted to further an just use the anonymous inject, i.e.
@Inject // No name implies match the interface to the only implementation public void setTransactionManager(TransactionManager tm); or xml equivalent <property name="transactionManager"><inject/></property>
Then we'd need to make MC aware of the instance in transaction-jboss-beans.xml
<bean name="RealTransactionManager"> <constructor factoryMethod="getTransactionManager"> <factory bean="TransactionManager"/> </constructor> </bean>
Since the thing called TransactionManager is not really a TM, its a factory for it. :-)
Bugger, can't get static instances past you. ;-)
I'm going for the anonymous inject.