Code example for AbstractLazyCreationTargetSource

0
     * 
     * @param serviceRegistry a {@link org.opennms.core.soa.ServiceRegistry} object. 
     * @param filter  
     * @param serviceInterface a {@link java.lang.Class} object. 
     */ 
    public ServiceRegistryTargetSource(ServiceRegistry serviceRegistry, String filter, Class<?> serviceInterface) { 
        m_serviceRegistry = serviceRegistry; 
        m_filter = filter; 
        m_serviceInterface = serviceInterface; 
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    protected Object createObject() throws Exception { 
        Object object = m_serviceRegistry.findProvider(m_serviceInterface, m_filter); 
        if (object == null) { 
            throw new IllegalStateException("Unable to find an object that implements '" +  
                    m_serviceInterface +  
                    (m_filter == null ? "'" : " matching filter "+m_filter)); 
        }