Package org.impalaframework.service.registry.internal

Examples of org.impalaframework.service.registry.internal.DelegatingServiceRegistry


        assertTrue(set.remove(ref1));
        assertTrue(set.isEmpty());
    }
   
    public void testWithListener() throws Exception {
        DelegatingServiceRegistry registry = new DelegatingServiceRegistry();
        set.setServiceRegistry(registry);
        set.setFilterExpression("(mapkey=*)");

        List<String> service1 = Arrays.asList("1", "2");
        List<String> service2 = Arrays.asList("2", "3");
        List<String> service2a = Arrays.asList("2", "3");
        List<String> service3 = Arrays.asList("3", "4");
       
        ClassLoader classLoader = ClassUtils.getDefaultClassLoader();
        registry.addService("bean1", "module1", new StaticServiceBeanReference(service1), null, Collections.singletonMap("mapkey", "bean1"), classLoader);
        registry.addService("bean2", "module1", new StaticServiceBeanReference(service2), null, Collections.singletonMap("mapkey", "bean2"), classLoader);
        registry.addService("bean2a", "module1", new StaticServiceBeanReference(service2a), null, Collections.singletonMap("mapkey", "bean2a"), classLoader);
       
        assertTrue(set.isEmpty());
       
        //now call init to add
        set.init();
       
        assertEquals(2, set.size());
       
        //now add service and see it automatically reflect
        registry.addService("bean3", "module1", new StaticServiceBeanReference(service3), null, Collections.singletonMap("mapkey", "bean3"), classLoader);
        assertEquals(3, set.size());
       
        set.destroy();
        assertTrue(set.isEmpty());       
       
        //no need to remove listener as this was removed via destroy
        assertFalse(registry.removeEventListener(set));
    }
View Full Code Here


    private DelegatingServiceRegistry serviceRegistry;
   
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        serviceRegistry = new DelegatingServiceRegistry();
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        classes = new Class[]{String.class};
        exporter = new ServiceRegistryExporter();
        registry = new DelegatingServiceRegistry();
        beanFactory = createMock(DefaultListableBeanFactory.class);
        exporter.setBeanFactory(beanFactory);
        exporter.setModuleDefinition(new SimpleModuleDefinition("module1"));
        exporter.setServiceRegistry(registry);
        exportTypes = new Class<?>[]{String.class, Object.class};
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        set = new ServiceRegistrySet<Object>();
       
        serviceRegistry = new DelegatingServiceRegistry();
        set.setServiceRegistry(serviceRegistry);
        supportedTypes = new Class[]{ List.class };
        set.setProxyTypes(supportedTypes);
       
        filter = new LdapServiceReferenceFilter("(name=*)");
 
View Full Code Here

        p = new NamedServiceAutoExportPostProcessor();
        beanFactory = createMock(DefaultListableBeanFactory.class);
        parentBeanFactory = createMock(DefaultListableBeanFactory.class);
        endPoint = createMock(NamedServiceProxyFactoryBean.class);
        factoryBean = createMock(FactoryBean.class);
        serviceRegistry = new DelegatingServiceRegistry();
        p.setBeanFactory(beanFactory);
        p.setServiceRegistry(serviceRegistry);
        p.setBeanClassLoader(ClassUtils.getDefaultClassLoader());
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        list = new ServiceRegistryList<Object>();
       
        serviceRegistry = new DelegatingServiceRegistry();
        list.setServiceRegistry(serviceRegistry);
        supportedTypes = new Class[]{ List.class };
        list.setProxyTypes(supportedTypes);
       
        filter = new LdapServiceReferenceFilter("(name=*)");
 
View Full Code Here

*/
public class SimpleServiceRegistryFactory implements ServiceRegistryFactory {
   
    public ServiceRegistry newServiceRegistry() {
       
        DelegatingServiceRegistry serviceRegistry = new DelegatingServiceRegistry();
        ServiceEntryRegistry entryRegistryDelegate = newServiceEntryRegistry();
        serviceRegistry.setEntryRegistryDelegate(entryRegistryDelegate);
       
        InvokingServiceEventListenerRegistry listenerRegistryDelegate = newInvokingServiceEventListenerRegistry();
        serviceRegistry.setListenerRegistryDelegate(listenerRegistryDelegate);
        return serviceRegistry;
    }
View Full Code Here

*/
public class SimpleServiceRegistryFactory implements ServiceRegistryFactory {
   
    public ServiceRegistry newServiceRegistry() {
       
        DelegatingServiceRegistry serviceRegistry = new DelegatingServiceRegistry();
        ServiceEntryRegistry entryRegistryDelegate = newServiceEntryRegistry();
        serviceRegistry.setEntryRegistryDelegate(entryRegistryDelegate);
       
        InvokingServiceEventListenerRegistry listenerRegistryDelegate = newInvokingServiceEventListenerRegistry();
        serviceRegistry.setListenerRegistryDelegate(listenerRegistryDelegate);
        return serviceRegistry;
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.service.registry.internal.DelegatingServiceRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.