hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Strutynski, Oliver" <oliver.strutyn...@sdm-research.de>
Subject Multiple interfaces again
Date Tue, 21 Sep 2004 09:50:06 GMT
I have one more problem(?) with multiple interfaces:

Define interfaces A,B
Interface C extends A,B
Class X implements C

Now I have two more services Y and Z. Both depend on the implementation 
X, but import different service interfaces. So in my hivemodule.xml I 
have something like:


  <service-point id="MyA" interface="A">
      <invoke-factory service-id="hivemind.BuilderFactory">
          <construct autowire-services="true" class="X">
              <boolean>false</boolean>
          </construct>
      </invoke-factory>
  </service-point>
 
  <service-point id="MyB" interface="B">
      <invoke-factory service-id="hivemind.BuilderFactory">
          <construct autowire-services="true" class="X">
              <boolean>false</boolean>
          </construct>
      </invoke-factory>
  </service-point>

  and simple service points for Y and Z.

Hivemind correctly autowires everything and both Y and Z get an instance 
of X, however because Y and Z import different interfaces, two instances 
of X are being created. Is there a proper way to make sure that only one 
instance of X will be created and handed to both Y and Z, without making 
X and Z depend on the combined interface C (which is not really an option)?

Probably a definition like

   <service-point id="MyAandB" interface="A,B">
      <invoke-factory service-id="hivemind.BuilderFactory">
          <construct autowire-services="true" class="X">
              <boolean>false</boolean>
          </construct>
      </invoke-factory>
  </service-point>

could do the job, but that is not currently possible with Hivemind.

Thanks again for any help.

Oliver Strutynski

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message