Examples of BeanRetrievingServiceRegistryTargetSource


Examples of org.impalaframework.spring.service.registry.BeanRetrievingServiceRegistryTargetSource

        Assert.notNull(this.serviceRegistry, "serviceRegistry cannot be null");
       
        //BeanRetrievingServiceRegistryTargetSource implements rules on whether bean name, proxyTypes or exportTypes can and cannot be null
       
        //this will return a non-null value if single interface which is concrete class
        ServiceEndpointTargetSource targetSource = new BeanRetrievingServiceRegistryTargetSource(
                this.serviceRegistry,
                registryBeanName,
                proxyTypes,
                exportTypes);
       
        ProxyFactory proxyFactory = new ProxyFactory();
       
        if (targetSource.getTargetClass() == null) {
            //not proxying by class, so proxy by interface
            ProxyFactorySourceUtils.addInterfaces(proxyFactory, proxyTypes);
        }
       
        afterInit(proxyFactory, targetSource);
View Full Code Here

Examples of org.impalaframework.spring.service.registry.BeanRetrievingServiceRegistryTargetSource

        Assert.notNull(this.serviceRegistry, "serviceRegistry cannot be null");
        Assert.notNull(proxyTypes, "proxyTypes cannot be null");
        Assert.notEmpty(proxyTypes, "proxyTypes cannot be empty");
       
        //this will return a non-null value if single interface which is concrete class
        ServiceEndpointTargetSource targetSource = new BeanRetrievingServiceRegistryTargetSource(this.serviceRegistry, registryBeanName, proxyTypes, exportTypesOnly);
        ProxyFactory proxyFactory = new ProxyFactory();
       
        if (targetSource.getTargetClass() == null) {
            //not proxying by class, so proxy by interface
            ProxyFactorySourceUtils.addInterfaces(proxyFactory, proxyTypes);
        }
       
        afterInit(proxyFactory, targetSource);
View Full Code Here

Examples of org.impalaframework.spring.service.registry.BeanRetrievingServiceRegistryTargetSource

        super.setUp();
        serviceRegistry = new DelegatingServiceRegistry();
    }

    public void testGetUsingBean() {
        BeanRetrievingServiceRegistryTargetSource targetSource = new BeanRetrievingServiceRegistryTargetSource(serviceRegistry,
                "mybean", //bean name null
                new Class[]{ Object.class }, //proxy types non null
                null //export types null
                );
       
        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);
       
        assertNull(targetSource.getServiceRegistryReference());
    }
View Full Code Here

Examples of org.impalaframework.spring.service.registry.BeanRetrievingServiceRegistryTargetSource

       
        assertNull(targetSource.getServiceRegistryReference());
    }
   
    public void testGetUsingExportedType() {
        BeanRetrievingServiceRegistryTargetSource targetSource = new BeanRetrievingServiceRegistryTargetSource(serviceRegistry,
                null, //bean name null
                null, //proxy types null
                new Class[]{ Object.class } //export types non null
        );
       
        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);
       
        assertNull(targetSource.getServiceRegistryReference());
    }
View Full Code Here

Examples of org.impalaframework.spring.service.registry.BeanRetrievingServiceRegistryTargetSource

        assertNull(targetSource.getServiceRegistryReference());
    }
   
    public void testNoNameOrExportType() throws Exception {
        try {
            new BeanRetrievingServiceRegistryTargetSource(serviceRegistry,
                    null, //bean name null
                    new Class[]{ Object.class }, //proxy types non null
                    null //export types null
            );
            fail();
View Full Code Here

Examples of org.impalaframework.spring.service.registry.BeanRetrievingServiceRegistryTargetSource

        }
    }
   
    public void testNoProxyOrExportType() throws Exception {
        try {
            new BeanRetrievingServiceRegistryTargetSource(serviceRegistry,
                    "name", //bean name null
                    null, //proxy types null
                    null //export types non null
            );
            fail();
View Full Code Here

Examples of org.impalaframework.spring.service.registry.BeanRetrievingServiceRegistryTargetSource

        Assert.notNull(this.serviceRegistry, "serviceRegistry cannot be null");
       
        //BeanRetrievingServiceRegistryTargetSource implements rules on whether bean name, proxyTypes or exportTypes can and cannot be null
       
        //this will return a non-null value if single interface which is concrete class
        ServiceEndpointTargetSource targetSource = new BeanRetrievingServiceRegistryTargetSource(
                this.serviceRegistry,
                registryBeanName,
                proxyTypes,
                exportTypes);
       
        ProxyFactory proxyFactory = new ProxyFactory();
       
        if (targetSource.getTargetClass() == null) {
            //not proxying by class, so proxy by interface
            ProxyFactorySourceUtils.addInterfaces(proxyFactory, proxyTypes);
        }
       
        afterInit(proxyFactory, targetSource);
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.