Package org.impalaframework.service.registry.internal

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


    private ServiceRegistry 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 ServiceArrayRegistryExporter();
        registry = new DelegatingServiceRegistry();
        beanFactory = createMock(DefaultListableBeanFactory.class);
        exporter.setBeanFactory(beanFactory);
        exporter.setModuleDefinition(new SimpleModuleDefinition("module1"));
        exporter.setServiceRegistry(registry);
        exporter.setBeanClassLoader(ClassUtils.getDefaultClassLoader());
View Full Code Here

    private ServiceRegistry serviceRegistry;

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

import org.impalaframework.spring.service.registry.config.ServiceRegistryPostProcessor;

public class ServiceRegistryPostProcessorTest extends TestCase {

    public final void testPostProcessBeforeInitialization() {
        ServiceRegistry registry = new DelegatingServiceRegistry();
        ProxyFactoryCreator proxyFactoryCreator = new DefaultProxyFactoryCreator();
        ServiceRegistryPostProcessor postProcessor = new ServiceRegistryPostProcessor(registry, proxyFactoryCreator);
        TestRegistryAware testAware = new TestRegistryAware();
        TestProxyFactoryCreatorAware proxyFactoryCreatorAware = new TestProxyFactoryCreatorAware();
        postProcessor.postProcessBeforeInitialization(testAware, null);
View Full Code Here

    private FilteredServiceProxyFactoryBean factoryBean;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        serviceRegistry = new DelegatingServiceRegistry();
        factoryBean = new FilteredServiceProxyFactoryBean();
        factoryBean.setServiceRegistry(serviceRegistry);
        factoryBean.setFilterExpression("(name=*)");
        factoryBean.setProxyTypes(new Class[]{List.class});
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        bean = new NamedServiceProxyFactoryBean();
        serviceRegistry = new DelegatingServiceRegistry();
       
        proxyFactoryCreator = new DefaultProxyFactoryCreator();
        bean.setServiceRegistry(serviceRegistry);
       
        classLoader = ClassUtils.getDefaultClassLoader();
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        bean = new TypedServiceProxyFactoryBean();
        serviceRegistry = new DelegatingServiceRegistry();
        bean.setServiceRegistry(serviceRegistry);
       
        classLoader = ClassUtils.getDefaultClassLoader();
        exportTypes = new Class<?>[] { Child.class };
        proxyClassTypes = new Class<?>[] { TestChild.class };
View Full Code Here

        UnloadTransitionProcessor unloadTransitionProcessor = new UnloadTransitionProcessor();
        transitionProcessors.addItem(Transition.UNLOADED_TO_LOADED, loadTransitionProcessor);
        transitionProcessors.addItem(Transition.LOADED_TO_UNLOADED, unloadTransitionProcessor);
        transitionManager.setTransitionProcessorRegistry(transitionProcessors);    

        ApplicationManager applicationManager = TestApplicationManager.newApplicationManager(new ModuleClassLoaderRegistry(), moduleStateHolder, new DelegatingServiceRegistry());
        Application application = applicationManager.getCurrentApplication();
       
        RootModuleDefinition test1Definition = newTest1().getModuleDefinition();
        ModificationExtractor calculator = new StrictModificationExtractor();
        TransitionSet transitions = calculator.getTransitions(application, null, test1Definition);
View Full Code Here

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

        List<String> service1 = new ArrayList<String>();
        List<String> service2 = new ArrayList<String>();
        List<String> service3 = new ArrayList<String>();
       
        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);
       
        assertTrue(list.isEmpty());
       
        //now call init to add
        list.init();
       
        assertEquals(2, list.size());
       
        //now add service and see it automatically reflect
        registry.addService("bean3", "module1", new StaticServiceBeanReference(service3), null, Collections.singletonMap("mapkey", "bean3"), classLoader);
        assertEquals(3, list.size());
       
        list.destroy();
        assertTrue(list.isEmpty());       
       
        //no need to remove listener as this was removed via destroy
        assertFalse(registry.removeEventListener(list));
    }
View Full Code Here

        super.setUp();
        map = new ContributionMap<Object>();
        serviceRegistryMap = new ServiceRegistryMap<Object>();
        map.setExternalContributions(serviceRegistryMap);
        serviceRegistryMap.setFilterExpression("(mapkey=*)");
        registry = new DelegatingServiceRegistry();
        serviceRegistryMap.setServiceRegistry(registry);
        classLoader = ClassUtils.getDefaultClassLoader();
    }
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.