Examples of StaticServiceBeanReference


Examples of org.impalaframework.service.StaticServiceBeanReference

        catch (NoServiceException e) {
            e.printStackTrace();
        }

        Child service = newChild();
        serviceRegistry.addService(null, "moduleName"new StaticServiceBeanReference(service), Arrays.asList(exportTypes) , null, classLoader);
        child.childMethod();
       
        //show we can also cast to one of the other interfaces
        GrandChild grandChild = (GrandChild) child;
        grandChild.childMethod();
View Full Code Here

Examples of org.impalaframework.service.StaticServiceBeanReference

        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());       
       
View Full Code Here

Examples of org.impalaframework.service.StaticServiceBeanReference

        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

Examples of org.impalaframework.service.StaticServiceBeanReference

   
    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

Examples of org.impalaframework.service.StaticServiceBeanReference

        serviceRegistryMap.setFilter(new LdapServiceReferenceFilter("(mapkey=bean1)"));
        serviceRegistryMap.init();

        //this one will match
        registry.addService("bean1", "module1", new StaticServiceBeanReference("some service1"), null, Collections.singletonMap("mapkey", "bean1"), classLoader);
       
        //this one won't
        registry.addService("bean2", "module1", new StaticServiceBeanReference("some service1"), null, Collections.singletonMap("mapkey", "bean2"), classLoader);
        assertEquals(1, serviceRegistryMap.size());
    }
View Full Code Here

Examples of org.impalaframework.service.StaticServiceBeanReference

        serviceRegistryMap.init();

        String service1 = "value1";
        String service2 = "value2";
       
        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);
        assertEquals(2, serviceRegistryMap.size());

        Map<String,String> m = new HashMap<String, String>();
        m.put("bean2", "value2a");
        map.putAll(m);
View Full Code Here

Examples of org.impalaframework.service.StaticServiceBeanReference

    public void testGetExistingServices() throws Exception {
       
        String service1 = "value1";
        String service2 = "value2";
       
        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);
       
        serviceRegistryMap.init();
        assertEquals(2, serviceRegistryMap.size());
    }
View Full Code Here

Examples of org.impalaframework.service.StaticServiceBeanReference

        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());       
       
View Full Code Here

Examples of org.impalaframework.service.StaticServiceBeanReference

                );
       
        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

Examples of org.impalaframework.service.StaticServiceBeanReference

       
        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
TOP
Copyright © 2018 www.massapi.com. 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.