Package org.impalaframework.service

Examples of org.impalaframework.service.ServiceRegistryEntry


       
        verify(serviceRegistry);
    }
   
    public void testWithFinalClass() throws Exception {
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry("service", "mybean", "mymod", ClassUtils.getDefaultClassLoader());
       
        replay(serviceRegistry);
        try {
            creator.createProxyFactory(new StaticServiceReferenceProxyFactorySource(null, ref), null, null);
            fail();
View Full Code Here


        assertFalse(registry.addEventListener(serviceRegistryMap));

        String service1 = "some service1";
        String service2 = "some service2";
       
        final ServiceRegistryEntry ref1 = registry.addService("bean1", "module1", new StaticServiceBeanReference(service1), null, Collections.singletonMap("mapkey", "bean1"), classLoader);
        final ServiceRegistryEntry ref2 = registry.addService("bean2", "module1", new StaticServiceBeanReference(service2), null, Collections.singletonMap("mapkey", "bean2"), classLoader);
        assertEquals(2, serviceRegistryMap.size());
        assertNotNull(serviceRegistryMap.get("bean1"));
        assertNotNull(serviceRegistryMap.get("bean2"));
        registry.remove(ref1);
        registry.remove(ref2);     
View Full Code Here

   
    public void testDestroy() throws Exception {
        serviceRegistryMap.init();
        String service1 = "some service1";
       
        final ServiceRegistryEntry entry1 = registry.addService("bean1", "module1", new StaticServiceBeanReference(service1), null, Collections.singletonMap("mapkey", "bean1"), classLoader);
        assertEquals(1, serviceRegistryMap.size());  
       
        serviceRegistryMap.destroy();
        assertTrue(serviceRegistryMap.isEmpty());
       
View Full Code Here

                );
       
        assertNull(targetSource.getServiceRegistryReference());
       
        Object service = new Object();
        final ServiceRegistryEntry serviceReference = serviceRegistry.addService("mybean", "moduleName", new StaticServiceBeanReference(service), ClassUtils.getDefaultClassLoader());
       
        assertNotNull(targetSource.getServiceRegistryReference());
       
        serviceRegistry.remove(serviceReference);
       
View Full Code Here

       
        assertNull(targetSource.getServiceRegistryReference());
       
        Object service = new Object();
        List<Class<?>> asList = Arrays.asList(new Class<?>[]{Object.class});
        final ServiceRegistryEntry serviceReference = serviceRegistry.addService("mybean", "moduleName", new StaticServiceBeanReference(service), asList, null, ClassUtils.getDefaultClassLoader());
       
        assertNotNull(targetSource.getServiceRegistryReference());
       
        serviceRegistry.remove(serviceReference);
       
View Full Code Here

       
        replay(beanFactory);
        exporter.init();
        verify(beanFactory);
       
        ServiceRegistryEntry serviceReference = registry.getService("exportName", classes, false);
        assertSame(service, serviceReference.getServiceBeanReference().getService());
       
        exporter.destroy();
        assertNull(registry.getService("exportName", classes, false));
    }
View Full Code Here

       
        replay(beanFactory);
        exporter.init();
        verify(beanFactory);
       
        ServiceRegistryEntry serviceReference = registry.getService("myBean", classes, false);
        assertSame(service, serviceReference.getServiceBeanReference().getService());
       
        exporter.destroy();
        assertNull(registry.getService("myBean", classes, false));
    }
View Full Code Here

       
        replay(beanFactory);
        exporter.init();
        verify(beanFactory);
       
        ServiceRegistryEntry s = registry.getService(null, classes, true);
        assertSame(service, s.getServiceBeanReference().getService());
        assertEquals(attributes, s.getAttributes());
       
        assertFalse(registry.getServices(new LdapServiceReferenceFilter("(attribute1=*)"), classes, false).isEmpty());
        assertFalse(registry.getServices(new LdapServiceReferenceFilter("(attribute1=*)"), classes, true).isEmpty());
       
        exporter.destroy();
View Full Code Here

       
        replay(beanFactory);
        exporter.init();
        verify(beanFactory);
       
        ServiceRegistryEntry s = registry.getService("myBean", classes, false);
        assertNotNull(s);
       
        exporter.destroy();
        assertNull(registry.getService("myBean", classes, false));
    }
View Full Code Here

   
    public void testNoMapKey() throws Exception {
        LdapServiceReferenceFilter filter = new LdapServiceReferenceFilter("(name=myname)");
        map.setFilter(filter);
       
        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(map)).andReturn(true);
       
        replay(serviceRegistry);
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.