hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Barran <c.d.bar...@sheffield.ac.uk>
Subject Hivemind Service Wiring Issue.
Date Wed, 08 Feb 2006 17:40:40 GMT
I have created a set of services that depend on each other.
ServiceA depends on ServiceB which depends on ServiceC

If I write a unit test that builds the HiveMind registry.
I can get out ServiceC and test it, works OK

If I get ServiceB and test it works OK.

If I get ServiceA and test it, fails because
ServiceB has no reference to ServiceC.

I guess this is something to do with proxies ?

When I get ServiceB from the registry a proxy is created for ServiceC
and when I use the service it is instanciated.

However when I get ServiceA from the registry a Singlton proxy is 
created for ServiceB but I see no such message about autowiring a Single 
ton proxy for ServiceC. When the code tries to access ServiceC I get a 
NullPointerException. Any ideas.

<?xml version="1.0" encoding="UTF-8"?>
<module id="myModule"  version="1.0.0">
     <service-point id="ServiceC" interface="foo.bar.ServiceC">
     <create-instance class="foo.bar.ServiceCImpl" />
   <interceptor service-id="hivemind.LoggingInterceptor"/>
   </service-point>

    <service-point id="ServiceB" interface="foo.bar.ServiceB">
     <invoke-factory service-id="hivemind.BuilderFactory">
     <construct class="foo.bar.ServiceBImpl" autowire-services="true" />
     </invoke-factory>
   <interceptor service-id="hivemind.LoggingInterceptor"/>
   </service-point>


   <service-point id="ServiceA" interface="foo.bar.ServiceA" >
     <invoke-factory service-id="hivemind.BuilderFactory">
       <construct class="foo.bar.ServiceAImpl" autowire-services="true">
        <set property="country" value="GB" />
        <set property="company" value="COMPANY" />
        <set property="url" value="http://www.foo.com" />
        <set property="script" value="/foo/bar.jsp" />
       </construct>
     </invoke-factory>
     <interceptor service-id="hivemind.LoggingInterceptor"/>
   </service-point>
</module>



-- 
Dr Chris Barran
Senior Systems Developer
Internet Technologies Team
CiCS
The University of Sheffield
Tel: +44 114 2221193

Mime
View raw message