tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gopi Lokavarapu <gopi.lokar...@gmail.com>
Subject Re: Could you please help me how to consume spring services from tuscany rest services.
Date Mon, 02 Sep 2013 09:26:27 GMT
Thank you so much for the response given to me.But I have another
problem.That is, if it is one component in composite file then
<implementation.spring location="/someLocation"> is declared one time,like
that
<composite>
 <component name="component1">
   <implementation.spring="/somLocation/spring-conentx.xml" />
    <service name="component1Service">
      <tuscany:binding.rest uri="http://localhost:8085/hell0"/> //here can
i give like this uri="/hello' (if it is tomcat server)
   </service>
</component>
<component name="component2">
<implementation.spring="/somLocation/spring-conentx.xml" />
    <service name="component2Service">
      <tuscany:binding.rest uri="http://localhost:8085/hell01"/> //here can
i give like this uri="/hello1' (if it is tomcat server)
   </service>
</component>

.................
.................
.................
<component name="componentN'>
<implementation.spring="/somLocation/spring-conentx.xml" />
    <service name="componentNService">
      <tuscany:binding.rest uri="http://localhost:8085/hell0N"/>
   </service>
</component>

</composite>

Problem:From the above scenario spring-context.xml contains all services as
beans,sessionFactory obj bean also there in spring-context.xml.Now whenever
i given a call to service ,every time all service beans instatntiation
takesplace.
i.e
<beans>
<bean id="mySessionFactroy" class="LocalSessionFactoryBean"/>
  <sca:service name="Component1Service" target="bean1"/>
  <sca:service name="Component2Service" target="bean2"/>
..................................................
..................................................
  <sca:service name="ComponentNService" target="beanN"/>
<bean id="bean1" class="class1"/>
<bean id="bean2" class="class2"/>
....................
................
<bean id="bean3" class="classN"/>
</beans>

In the above scenario whenever i run the application with tomcat7 with
apache-wink runtime ,how many components are there in composite file
corresponding times spring-context file is loading,at that time it is
creating objects for everty eventhoug objects are laready intantiated.
i.e
whenever loading composite file
for every implementaion.spring all beans instantiation is takesplace
component1---->implementation.spring------>bean id="bean1"
component2----->implementaion.spring------->bean id="bean1' bean id="bean2'
---------------------------------------
---------------------------------------
componentN------->implementaion.spring------>bean id="bean1" bean
id="bean2"...........bean id="beanN"

first implementation.spring bean1 is instantiatied,
second  implementation.spring again bean1 is instantiatied along with bean2
---------------------------
------------------
N th time  implementation.spring again bean1 is instantiatied along with
bean2,bean2.........beanN


Could please help me how to resolve this problem.


Thank you

T


On Sun, Sep 1, 2013 at 5:35 PM, Luciano Resende <luckbr1975@gmail.com>wrote:

>
>
> On Sat, Aug 31, 2013 at 6:45 AM, Gopi Lokavarapu <gopi.lokarapu@gmail.com>wrote:
>
>> Could you please help me to do the following scenario:While using apche
>> tuscany with spring implementation
>> --------------------------------------------------------------------------
>> I have 2 components and spring context file
>> I configured as 2 services in spring-context file as spring beans.Now i
>> want to access these from tuscany rest binding.
>> I attached my spring context file and compoite file
>>
>>
>>
>>
>> Could you please give me reply please.....
>>
>>
>>
>>
>>      Thank you
>>
>>
> I have modified the spring sample to expose the helloworld service using
> the REST binding, please take a look at
>
>
> https://svn.apache.org/repos/asf/tuscany/sandbox/lresende/sca-2.x/samples/helloworld-spring/
>
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
> http://twitter.com/lresende1975
> http://lresende.blogspot.com/
>

Mime
View raw message