Package org.impalaframework.service

Examples of org.impalaframework.service.ServiceRegistry


        Assert.notNull(moduleStateHolderFactory, "moduleStateHolderFactory cannot be null");
        Assert.notNull(serviceRegistryFactory, "serviceRegistryFactory cannot be null");
       
        ClassLoaderRegistry classLoaderRegistry = classLoaderRegistryFactory.newClassLoaderRegistry();
        ModuleStateHolder moduleStateHolder = moduleStateHolderFactory.newModuleStateHolder();
        ServiceRegistry serviceRegistry = serviceRegistryFactory.newServiceRegistry();
        Application application = new ImpalaApplication(classLoaderRegistry, moduleStateHolder, serviceRegistry, id);
   
        return application;
    }
View Full Code Here


    public DefaultApplicationContextLoader() {
    }
   
    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

    public DefaultApplicationContextLoader() {
    }
   
    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

    }

    ImpalaOsgiApplicationContext newApplicationContext(
            Application application, ApplicationContext parent, final ModuleDefinition moduleDefinition) {
       
        final ServiceRegistry serviceRegistry = application.getServiceRegistry();
       
        final ImpalaOsgiApplicationContext applicationContext = new ImpalaOsgiApplicationContext(parent) {

            @Override
            protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory) {
View Full Code Here

       
        final String moduleName = currentDefinition.getName();
        logger.info("Loading definition " + moduleName);
       
        final ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        final ServiceRegistry serviceRegistry = application.getServiceRegistry();
       
        if (moduleStateHolder.getModule(moduleName) == null) {

            ModuleRuntime moduleRuntime = getModuleRuntime(currentDefinition);
           
            try {
                RuntimeModule runtimeModule = moduleRuntime.loadRuntimeModule(application, currentDefinition);
                moduleStateHolder.putModule(moduleName, runtimeModule);
            }
            catch (Throwable e) {
               
                try {
                    serviceRegistry.evictModuleServices(moduleName);
                } catch (Exception ee) {
                    logger.error("Error evicting modules from module: " + moduleName, ee);
                }
               
                logger.error("Failed to handle loading of application module: " + moduleName, e);
View Full Code Here

import org.impalaframework.spring.service.registry.config.ServiceRegistryPostProcessor;

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

public class SimpleServiceRegistryFactoryTest extends TestCase {

    public void testNewServiceRegistry() throws Exception {
        ServiceRegistryFactory factory = new SimpleServiceRegistryFactory();
        ServiceRegistry serviceRegistry = factory.newServiceRegistry();
        assertTrue(serviceRegistry instanceof DelegatingServiceRegistry);
    }
View Full Code Here

       
        final String moduleName = currentDefinition.getName();
        logger.info("Loading definition " + moduleName);
       
        final ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        final ServiceRegistry serviceRegistry = application.getServiceRegistry();
       
        if (moduleStateHolder.getModule(moduleName) == null) {

            ModuleRuntime moduleRuntime = getModuleRuntime(currentDefinition);
           
            try {
                RuntimeModule runtimeModule = moduleRuntime.loadRuntimeModule(application, currentDefinition);
                moduleStateHolder.putModule(moduleName, runtimeModule);
            }
            catch (Throwable e) {
               
                try {
                    serviceRegistry.evictModuleServices(moduleName);
                } catch (Exception ee) {
                    logger.error("Error evicting modules from module: " + moduleName, ee);
                }
               
                logger.error("Failed to handle loading of application module: " + moduleName, e);
View Full Code Here

        Assert.notNull(moduleStateHolderFactory, "moduleStateHolderFactory cannot be null");
        Assert.notNull(serviceRegistryFactory, "serviceRegistryFactory cannot be null");
       
        ClassLoaderRegistry classLoaderRegistry = classLoaderRegistryFactory.newClassLoaderRegistry();
        ModuleStateHolder moduleStateHolder = moduleStateHolderFactory.newModuleStateHolder();
        ServiceRegistry serviceRegistry = serviceRegistryFactory.newServiceRegistry();
        Application application = new ImpalaApplication(classLoaderRegistry, moduleStateHolder, serviceRegistry, id);
   
        return application;
    }
View Full Code Here

        Assert.notNull(moduleStateHolderFactory, "moduleStateHolderFactory cannot be null");
        Assert.notNull(serviceRegistryFactory, "serviceRegistryFactory cannot be null");
       
        ClassLoaderRegistry classLoaderRegistry = classLoaderRegistryFactory.newClassLoaderRegistry();
        ModuleStateHolder moduleStateHolder = moduleStateHolderFactory.newModuleStateHolder();
        ServiceRegistry serviceRegistry = serviceRegistryFactory.newServiceRegistry();
        Application application = new ImpalaApplication(classLoaderRegistry, moduleStateHolder, serviceRegistry, id);
   
        return application;
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.service.ServiceRegistry

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.