package org.wamblee.system.spring; import org.springframework.beans.factory.FactoryBean; /** * Bean which adds a service required by the spring component to * the application context so that other spring beans can use it. * * @author Erik Brakkee */ class RequiredServiceBean implements FactoryBean { private String _id; /** * Constructs the bean. * @param aId Id of the bean in the service registry. */ public RequiredServiceBean(String aId) { _id = aId; } @Override public Object getObject() throws Exception { return SpringComponent.REGISTRY.get().find(_id).reference(Object.class); } @Override public Class getObjectType() { return null; } @Override public boolean isSingleton() { return true; } }