You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Arif Mohd <ar...@wipro.com> on 2007/06/29 12:21:52 UTC

How to configure servicename in servicemix.xml LW container component

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.


-- 
View this message in context: http://www.nabble.com/How-to-configure-servicename-in-servicemix.xml-LW-container-component-tf3999211s12049.html#a11358068
Sent from the ServiceMix - User mailing list archive at Nabble.com.


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

Posted by Gert Vanthienen <ge...@skynet.be>.
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.
>>
>>
>>
>>     
>
>   


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

Posted by Arif Mohd <ar...@wipro.com>.
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.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-configure-servicename-in-servicemix.xml-LW-container-component-tf3999211s12049.html#a11518883
Sent from the ServiceMix - User mailing list archive at Nabble.com.