Ben,

Its been some time but I'm curious, why a Singleton?

cheers,

miguel

On 12/14/06, Ben Gidley <[EMAIL PROTECTED]> wrote:

This is quite easy to do you create Spring factory bean that provides the
service

To make this work I cheated an chucked the registry onto a Singleton. I
suspect other strategies are possible.

e.g.
public class HivemindFactoryBean implements FactoryBean {

    private String serviceId;

    private Class serviceInterface;

    public Object getObject() throws Exception {
        return RegistryManager.getInstance().getRegistry().getService(
                serviceId, serviceInterface);
    }

    public Class getObjectType() {
        return serviceInterface;
    }

    public boolean isSingleton() {
        return true;
    }

    public String getServiceId() {
        return serviceId;
    }

    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    public Class getServiceInterface() {
        return serviceInterface;
    }

    public void setServiceInterface(Class serviceInterface) {
        this.serviceInterface = serviceInterface;
    }

}

On 12/13/06, Miguel Angel Hernández <[EMAIL PROTECTED]> wrote:
>
> Stefan,
>
> How did this turned out?
> I ran into a similar problem, and found this link very usefull:
>
> http://hivemind.apache.org/hivemind/BuilderFactory.html
>
> Indeed injecting spring services in hivemind's is fairly easy, though
> backwards is'nt...
>
> Miguel
>
>

Reply via email to