Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.ModuleStateHolder


        boolean success = true;
       
        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);
View Full Code Here


        final String moduleDefinition = currentDefinition.getName();
        logger.info("Unloading module " + moduleDefinition);

        boolean success = true;

        final ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
       
        RuntimeModule runtimeModule = moduleStateHolder.removeModule(moduleDefinition);
        if (runtimeModule != null) {
            try {
                ModuleRuntime moduleRuntime = getModuleRuntime(currentDefinition);
                moduleRuntime.closeModule(application, runtimeModule);
            }
View Full Code Here

        Assert.notNull(classLoaderRegistryFactory, "classLoaderRegistryFactory cannot be null");
        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(moduleOperationInput, "moduleOperationInput cannot be null");
        String moduleToReload = moduleOperationInput.getModuleName();
        Assert.notNull(moduleToReload, "moduleName is required as it specifies the name of the module to reload in "
                + this.getClass().getName());

        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        RootModuleDefinition oldRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
        RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();

        ModificationExtractorRegistry modificationExtractor = getModificationExtractorRegistry();
        ModificationExtractor calculator = modificationExtractor
                .getModificationExtractor(ModificationExtractorType.STRICT);
View Full Code Here

        super();
    }

    public ModuleOperationResult doExecute(Application application, ModuleOperationInput moduleOperationInput) {
       
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        ModificationExtractorRegistry modificationExtractorRegistry = getModificationExtractorRegistry();
        ModificationExtractor calculator = modificationExtractorRegistry
                .getModificationExtractor(ModificationExtractorType.STRICT);
        RootModuleDefinition rootModuleDefinition = moduleStateHolder.getRootModuleDefinition();
       
        if (rootModuleDefinition != null) {
            logger.info("Shutting down application context");
            TransitionSet transitions = calculator.getTransitions(application, rootModuleDefinition, null);
            TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
View Full Code Here

        String moduleToReload = moduleOperationInput.getModuleName();
        Assert.notNull(moduleToReload,
                "moduleName is required as it specifies the name used to match the module to reload in "
                        + this.getClass().getName());
       
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        RootModuleDefinition newDefinition = moduleStateHolder.cloneRootModuleDefinition();

        ModuleDefinition found = newDefinition.findChildDefinition(moduleToReload, false);

        if (found != null) {
View Full Code Here

       
        if (beanVisibilityType.equals(PARENT_ONLY)) {
            return parentApplicationContext;
        }
       
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
       
        if (beanVisibilityType.equals(PARENT_FIRST)) {
            GraphModuleStateHolder graphModuleStateHolder = ObjectUtils.cast(moduleStateHolder, GraphModuleStateHolder.class);
            return new ParentFirstBeanGraphInheritanceStrategy().getParentApplicationContext(graphModuleStateHolder, parentApplicationContext, definition);    
        }
View Full Code Here

       
        while (parentDefinition != null) {
           
            final String parentName = parentDefinition.getName();
           
            final ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
           
            final RuntimeModule parentModule = moduleStateHolder.getModule(parentName);
            if (parentModule instanceof SpringRuntimeModule) {
                SpringRuntimeModule springRuntimeModule = (SpringRuntimeModule) parentModule;
                parentContext = springRuntimeModule.getApplicationContext();
                break;
            }
View Full Code Here

    }

    public ModuleOperationResult doExecute(Application application, ModuleOperationInput moduleOperationInput) {

        Assert.notNull(moduleOperationInput, "moduleOperationInput cannot be null");
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
       
        //note that the module definition source is externally supplied
        ModuleDefinitionSource newModuleDefinitionSource = moduleOperationInput.getModuleDefinitionSource();
        Assert.notNull(newModuleDefinitionSource, "moduleDefinitionSource is required as it specifies the new module definition to apply in " + this.getClass().getName());
       
View Full Code Here

    protected TransitionResultSet addModule(
            Application application,
            ModificationExtractor calculator,
            ModuleDefinition moduleDefinition) {

        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
       
        RootModuleDefinition oldRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
        RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();

        ModuleDefinition parent = moduleDefinition.getParentDefinition();
       
        if (moduleDefinition instanceof RootModuleDefinition) {
            newRootDefinition = (RootModuleDefinition) moduleDefinition;
View Full Code Here

TOP

Related Classes of org.impalaframework.module.spi.ModuleStateHolder

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.