Package org.impalaframework.service

Examples of org.impalaframework.service.ServiceRegistryEntry


        LdapServiceReferenceFilter filter = new LdapServiceReferenceFilter("(name=myname)");
        map.setFilter(filter);
       
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("mapkey", "key");
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(service, "mybean", "mymodule", null, attributes, ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, supportedTypes, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(map)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here


        map.setFilter(filter);
        map.setProxyTypes(null);
       
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("mapkey", "key");
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(service, "mybean", "mymodule", null, attributes, ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, null, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(map)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here

        map.setFilter(filter);
        map.setProxyTypes(null);
       
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("mapkey", "key");
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry("stringservice", "mybean", "mymodule", null, attributes, ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, null, false)).andReturn(singletonList);
       
        replay(serviceRegistry);
       
View Full Code Here

    public void testWithList() throws Exception {

        serviceRegistry = createMock(ServiceRegistry.class);
        set.setServiceRegistry(serviceRegistry);
        List<String> service = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(service, "mybean", "mymodule", ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, supportedTypes, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(set)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here

        assertEquals(object, p.maybeExportBean(object, "mybean"));
        verify(beanFactory);
        verify(parentBeanFactory);
        verify(endPoint);
       
        ServiceRegistryEntry service = serviceRegistry.getService("mybean", classes, false);
        assertSame(object, service.getServiceBeanReference().getService());
    }
View Full Code Here

        replay(parentBeanFactory);
        replay(endPoint);
        replay(factoryBean);
        assertEquals(factoryBean, p.maybeExportBean(factoryBean, "mybean"));

        ServiceRegistryEntry service = serviceRegistry.getService("mybean", classes, false);
        assertNotNull(service.getServiceBeanReference().getService());
       
        verify(beanFactory);
        verify(parentBeanFactory);
        verify(endPoint);
        verify(factoryBean);
View Full Code Here

    public void testWithList() throws Exception {

        serviceRegistry = createMock(ServiceRegistry.class);
        list.setServiceRegistry(serviceRegistry);
        List<String> service = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(service, "mybean", "mymodule", ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, supportedTypes, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(list)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here

        replay(parentBeanFactory);
        replay(endPoint);
        replay(factoryBean);
        assertEquals(factoryBean, p.maybeExportBean(factoryBean, "mybean"));

        ServiceRegistryEntry service = serviceRegistry.getService("mybean", classes, false);
        assertNull(service);
       
        verify(beanFactory);
        verify(parentBeanFactory);
        verify(endPoint);
View Full Code Here

    }

    public void testRegistry() throws Exception {
        assertNull(registry.getService("notregistered", classes, false));

        final ServiceRegistryEntry ref = registryaddService("bean1", "module1", "some service", classLoader);
        assertEquals(1, entryDelegate.getBeanReferences("bean1").size());
        assertEquals(1, entryDelegate.getModuleReferences("module1").size());
        assertTrue(entryDelegate.getClassReferences(String.class).isEmpty());
        assertTrue(entryDelegate.hasService(ref));

        ServiceRegistryEntry service = registry.getService("bean1", classes, false);
        assertEquals("some service", service.getServiceBeanReference().getService());
        assertEquals("module1", service.getContributingModule());

        registry.remove(ref);
        assertNull(registry.getService("bean1", classes, false));
        assertEquals(0, entryDelegate.getBeanReferences("bean1").size());
        assertEquals(0, entryDelegate.getModuleReferences("module1").size());
View Full Code Here

        List<Class<?>> exportTypes = new ArrayList<Class<?>>();
        exportTypes.add(String.class);
        exportTypes.add(Object.class);
       
        assertTrue(entryDelegate.getClassReferences(String.class).isEmpty());
        final ServiceRegistryEntry ref = registryaddService("bean1", "module1", "some service", exportTypes, null, classLoader);
        assertEquals(1, entryDelegate.getClassReferences(String.class).size());
        assertEquals(1, entryDelegate.getClassReferences(Object.class).size());
       
        registry.remove(ref);
        assertEquals(0, entryDelegate.getClassReferences(String.class).size());
View Full Code Here

TOP

Related Classes of org.impalaframework.service.ServiceRegistryEntry

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.