[jboss-as7-dev] How to access a AS7 service from a deployed archive?

Brian Stansberry brian.stansberry at redhat.com
Thu Sep 20 12:09:17 EDT 2012


I'm pretty much a noob when it comes to this RA, but this sounds 
architecturally odd to me.

If an RA needs access to container services, aren't there spec defined 
ways by which that access is obtained? If someone else wrote an RA, how 
would they solve this problem? If this RA were deployed in Glassfish, 
how would it do it?

I can see how if the subsystem installs the RA it could use an alternate 
non-spec mechanism of finding services, but it feels odd if there is a 
requirement to use those mechanisms for a deployment.

On 9/20/12 10:44 AM, Jeff Mesnil wrote:
> Hi,
>
> I'm working on making the HornetQ RA deployable in AS7 standalone (ie without a running HornetQ server) to be able to consume
> messages from a remote JMS server[1].
>
> The HornetQ RA requires access to the app server transaction manager to be fully functional[2].
>
> I deploy the RA in standalone/deployments/ directory, the RA is started and it calls a class in the AS7 module
> org.jboss.as.messaging which is in charge to locate the TM[3].
>
> However this class code has a reference on the service container to be able to get the TxnService.
> This was working when the RA is instantiated by the messaging subsystem. But when the RA is deployed, the container reference is
> null.
>
> My question is: in my case (a deployed archive that calls a AS7 module), is there a way to get a reference to the
> ServiceContainer deploying the archive? Does it even make sense to do that this way?
> Once I got it, I should be able to get the transaction manager service.
>
> thanks,
> jeff
>
> [1] https://issues.jboss.org/browse/AS7-5483
> [2] https://community.jboss.org/message/760644
> [3]
> https://github.com/jbossas/jboss-as/blob/master/messaging/src/main/java/org/jboss/as/messaging/jms/TransactionManagerLocator.java
>
>


-- 
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat


More information about the jboss-as7-dev mailing list