You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Gert Vanthienen <ge...@skynet.be> on 2007/07/10 14:26:32 UTC

Re: How to configure servicename in servicemix.xml LW container component

Arif Mohd,

If you can make your class extend 
org.apache.servicemix.components.util.PojoSupport, the container will 
make sure that the information from the activationSpec is injected into 
your POJO.  PojoSupport's init() method will do the call to 
activateEndpoint(), so you only have to specify the service name on the 
activationSpec.

Gert

Arif Mohd wrote:
> Any one help me with this problem.
>
> Arif Mohd wrote:
>   
>> Hi,
>>
>>   1) Iam having a simple POJO which implements
>> ComponentLifeCycle,MessageExchangeListener interfaces
>>   2) This POJO is configured using servicemix.xml for this component(Not
>> the servicemix.xml shipped with servicemix)
>>   3) Iam using servicemix3.1.0
>>  
>> I have given service name for the POJO both in servicemix.xml and init
>> method as follows
>>
>> in init method
>>
>>   context.activateEndpoint(new QName("http://xxx.com/bescocr_031807",
>> "POJOServ"), "endpoint");
>>
>> in servicemix.xml for this component
>>
>>   <sm:serviceunit id="jbi">
>>     <sm:activationSpecs>
>>       <!-- Put lw components here -->
>>       <sm:activationSpec service="bescocr:POJOServ">
>>         <sm:component>
>>           <bean class="com.xxx.MyPOJO">
>>           </bean>
>>         </sm:component>
>>       </sm:activationSpec>
>>     </sm:activationSpecs>
>>   </sm:serviceunit>
>>
>> Problem:
>>
>>    If i don't give service name in init method of POJO, this component is
>> not being registered.
>>
>>   but ideally i should not give the service name here in init method.
>>
>>
>>
>>     
>
>