[jboss-dev] EJB3 DevForum: Resource adapter file name hard coded into ejb3/MessagingContainer

Jaikiran Pai jpai at redhat.com
Thu Apr 23 08:49:51 EDT 2009


 From what i see in the code 
(org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.createActivationSpec()) 
the only reason why the rar-name is being used is to get hold of the 
resource adapter MBean for creating the activation spec.  I think the 
dependency on the rar-name can be removed if we somehow can add a 
dependency/inject on the correct  resource adapter MBean. I personally 
don't know if there is any other dependency on the rar-name.

-Jaikiran

Clebert Suconic wrote:
> It looks like the Create Destination is abstracted in another class.
>
> Why do you need to rar-name on the MessagingContainer then? You guys 
> are just using JMS, and the destination creation is abstracted. So, it 
> looks like all you needed was the ConnectionFactoryName to the JCA 
> adaptor, and you would just need to call the CreateDestinationMatcher 
> somehow.
>
> Jaikiran Pai wrote:
>> Clebert Suconic wrote:
>>>
>>> Why the resource adapter is hard coded on 
>>> org.jboss.ejb3.mdb.MessagingContainer?
>> You mean the jms-ra.rar filename right?
>>>
>>> For instance i was going to rename it for JBM2, since we have our 
>>> own provider now, but i couldn't as there is this hard-coded instance. 
>> Not really a solution to what you are trying to achieve (i.e. 
>> removing dependency on the file names), but I think we (EJB3) can 
>> move the hardcoding out of the MessagingContainer and instead 
>> introduce this as an annotation through ejb3-interceptors-aop.xml:
>>
>> <domain name="Message Driven Bean" extends="Intercepted Bean" 
>> inheritBindings="true">
>>      ...
>>      <annotation expr="class(*) AND 
>> !class(@org.jboss.ejb3.annotation.ResourceAdapter)">
>>    @org.jboss.ejb3.annotation.ResourceAdapter ("jms-ra.rar")
>>      </annotation>
>>   </domain>
>>
>>> What if the user was using another JMS provider besides JBM, JBM2 or 
>>> JBossMQ?
>> The ResourceAdapter can be overriden by using the 
>> @org.jboss.ejb3.annotation.ResourceAdapter on the MDB:
>>
>> @ResourceAdapter("somecustom-ra.rar")
>> public class MyMDB
>> {
>> ...
>> }
>>
>>> It seems that this was supposed to be used around creating non 
>>> existent when deploying MDBs,
>> Not sure.
>>> but as far as I remember that feature was Brocked long ago, so this 
>>> code could probably be removed?
>> Creation of non-existent destinations is now available through a 
>> property https://jira.jboss.org/jira/browse/JBAS-6013
>>
>> regards,
>> -Jaikiran
>>
>> _______________________________________________
>> jboss-development mailing list
>> jboss-development at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jboss-development
>




More information about the jboss-development mailing list