Package org.impalaframework.spring.service.registry.config

Examples of org.impalaframework.spring.service.registry.config.ServiceRegistryPostProcessor


   
    protected void addBeanPostProcessors(Application application, ModuleDefinition definition, ConfigurableListableBeanFactory beanFactory) {
       
        ServiceRegistry serviceRegistry = application.getServiceRegistry();
       
        beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, serviceProxyFactoryCreator));
        beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(definition));
        beanFactory.addBeanPostProcessor(new ApplicationAwarePostProcessor(application));
    }
View Full Code Here


   
    protected void addBeanPostProcessors(Application application, ModuleDefinition definition, ConfigurableListableBeanFactory beanFactory) {
       
        ServiceRegistry serviceRegistry = application.getServiceRegistry();
       
        beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, serviceProxyFactoryCreator));
        beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(definition));
    }
View Full Code Here

        final ImpalaOsgiApplicationContext applicationContext = new ImpalaOsgiApplicationContext(parent) {

            @Override
            protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory) {
                //need to add these here because don't get the chance after startRefresh() has been called
                beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, serviceProxyFactoryCreator));
                beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(moduleDefinition));
                super.registerBeanPostProcessors(beanFactory);
            }
        };
        return applicationContext;
View Full Code Here

    public DefaultApplicationContextLoader() {
    }
   
    protected void addBeanPostProcessors(ModuleDefinition definition, ConfigurableListableBeanFactory beanFactory) {
        beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, serviceProxyFactoryCreator));
        beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(definition));
    }
View Full Code Here

        ClassPathXmlApplicationContext parentContext = new ClassPathXmlApplicationContext(
                "childcontainer/parent-with-child-context.xml"){
             @Override
            protected DefaultListableBeanFactory createBeanFactory() {
                DefaultListableBeanFactory beanFactory = super.createBeanFactory();
                beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, null));
                return beanFactory;
            }
        };
       
        parentContext.getBean("parent");
       
        Parent parentBean = (Parent) parentContext.getBean("parent");
        Child child = parentBean.tryGetChild();

        try {
            child.childMethod();
            fail();
        }
        catch (NoServiceException e) {
        }

        // now create child appliction context
        ClassPathXmlApplicationContext childContext = new ClassPathXmlApplicationContext(
                new String[] { "childcontainer/child-context.xml" }, parentContext){
             @Override
                protected DefaultListableBeanFactory createBeanFactory() {
                    DefaultListableBeanFactory beanFactory = super.createBeanFactory();
                    beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, null));
                    beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(new SimpleModuleDefinition("module1")));
                    return beanFactory;
                }
        };
View Full Code Here

    }

    @Override
    protected DefaultListableBeanFactory createBeanFactory() {
        DefaultListableBeanFactory beanFactory = super.createBeanFactory();
        beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, null));
        return beanFactory;
    }
View Full Code Here

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);
        postProcessor.postProcessBeforeInitialization(proxyFactoryCreatorAware, null);
        assertSame(registry, testAware.getServiceRegistry());
        assertSame(proxyFactoryCreator, proxyFactoryCreatorAware.getProxyFactoryCreator());
       
        assertSame(testAware, postProcessor.postProcessAfterInitialization(testAware, null));
    }
View Full Code Here

        final ImpalaOsgiApplicationContext applicationContext = new ImpalaOsgiApplicationContext(parent) {

            @Override
            protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory) {
                //need to add these here because don't get the chance after startRefresh() has been called
                beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, serviceProxyFactoryCreator));
                beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(moduleDefinition));
                super.registerBeanPostProcessors(beanFactory);
            }
        };
        return applicationContext;
View Full Code Here

        final ImpalaOsgiApplicationContext applicationContext = new ImpalaOsgiApplicationContext(parent) {

            @Override
            protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory) {
                //need to add these here because don't get the chance after startRefresh() has been called
                beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry, serviceProxyFactoryCreator));
                beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(moduleDefinition));
                super.registerBeanPostProcessors(beanFactory);
            }
        };
        return applicationContext;
View Full Code Here

TOP

Related Classes of org.impalaframework.spring.service.registry.config.ServiceRegistryPostProcessor

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.