hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Wannheden" <>
Subject Re: setting list parameters
Date Thu, 02 Nov 2006 07:40:33 GMT

Using a configuration point would probably be the most natural way to
do this. But if you prefer there are other possibilities. But these
would require you to write some Java code.

One alternative would be to implement an object provider. With that
(let's call it service-list) you'd set the property as follows:

<set-object property="myCustomServices"

You contribute this object provider as a service to the configuration

  <service-point id="ServiceListObjectProvider"
    <create-instance class="service.impl.ServiceListObjectProvider"/>

  <contribution configuration-id="hivemind.ObjectProviders">
    <provider prefix="service" service-id="ServiceListObjectProvider"/>

Now it's just a matter of implementing the ServiceListObjectProvider
class which should be straight forward.

This is all of course more work than a simple configuration. But if
it's a common pattern in your code it might make sense.



BTW Don't worry about the gift certificate :-)

On 10/31/06, <> wrote:
> I have a service that has method like "setMyCustomServices(List
> services)" but I can't figure out how to set this in the hivemind module
> descriptor. This is what I tried:
> <service-point id="SomeService" interface="SomeServiceInterface">
>         <invoke-factory>
>             <construct class="SomeServiceImpl" >
>                 <set-service property="myCustomServices">
>                     <list>
>                         <service-id>service.MyCustomServiceX</service-id>
>                         <service-id>service.MyCustomServiceY</service-id>
>                         <service-id>service.MyCustomServiceZ</service-id>
>                     </list>
>                 </set-service>
>             </construct>
>         </invoke-factory>
>     </service-point>
> I looked at using configuration points, but that seems like more
> complexity than is necessary.
> Anyone know the best way to do this?
> Thanks

View raw message