Package org.impalaframework.module

Examples of org.impalaframework.module.RuntimeModule


    /*
     * ******************* InternalOperationsFacade methods * **************************
     */

    public RuntimeModule getRuntimeModule(String moduleName) {
        final RuntimeModule runtimeModule = getModuleStateHolder().getModule(moduleName);
       
        if (runtimeModule == null) {
            throw new NoServiceException("No module named '" + moduleName + "' has been loaded");
        }
       
View Full Code Here


           
            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

    if (session == null) {
      return null;
    }
    ModuleManagementFacade moduleManagementFacade = WebServletUtils.getModuleManagementFacade(servletContext);
    if (moduleManagementFacade != null) {
      RuntimeModule currentModuleContext = moduleManagementFacade.getModuleStateHolder().getModule(moduleName);
     
      if (currentModuleContext != null) {
        return new ModuleAwareWrapperHttpSession(session, currentModuleContext.getClassLoader());
      } else {
        logger.warn("No module application context associated with module: " + moduleName + ". Using unwrapped session");
        return session;
      }
    }
View Full Code Here

      String directoryName = (String) GlobalCommandState.getInstance().getValue(
          CommandStateConstants.DIRECTORY_NAME);
     
      ClassLoader parent = null;

      RuntimeModule runtimeModule = null;
     
      try {       
        if (directoryName != null && !InteractiveCommandUtils.isRootProject(directoryName)) {
          runtimeModule = Impala.getRuntimeModule(directoryName);
        }
        else {
          runtimeModule = Impala.getRootRuntimeModule();
        }
      }
      catch (NoServiceException e) {
        //we're not terribly interested in this situation - simply means that the module context has not been loaded
      }
     
      if (runtimeModule != null) {
        parent = runtimeModule.getClassLoader();
      } else {
        parent = ClassUtils.getDefaultClassLoader();
      }

      c = Class.forName(testClassName, false, parent);
View Full Code Here

        if (moduleStateHolder.getModule(moduleName) == null) {

            ModuleRuntime moduleRuntime = getModuleRuntime(currentDefinition);
           
            try {
                RuntimeModule runtimeModule = moduleRuntime.loadRuntimeModule(application, currentDefinition);
                moduleStateHolder.putModule(moduleName, runtimeModule);
            }
            catch (Throwable e) {
               
                try {
View Full Code Here

        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

    }
    return null;
  }

  public RuntimeModule getRootRuntimeModule() {
    RuntimeModule runtimeModule = getModuleStateHolder().getRootModule();
    if (runtimeModule == null) {
      throw new NoServiceException("No root application has been loaded");
    }
    return runtimeModule;
  }
View Full Code Here

    }
    return runtimeModule;
  }

  public RuntimeModule getModuleContext(String moduleName) {
    RuntimeModule runtimeModule = getModuleStateHolder().getModule(moduleName);
    if (runtimeModule == null) {
      throw new NoServiceException("No runtime module " + moduleName + " is available");
    }
    return runtimeModule;
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public <T extends Object> T getBean(String beanName, Class<T> t) {
   
    RuntimeModule runtimeModule = getRootRuntimeModule();
    return (T) checkBeanType(runtimeModule, beanName, t);
  }
View Full Code Here

  }
 
  @SuppressWarnings("unchecked")
  public <T extends Object> T getModuleBean(String moduleName, String beanName, Class<T> t) {
   
    RuntimeModule runtimeModule = getModuleContext(moduleName);
    return (T) checkBeanType(runtimeModule, beanName, t);
  }
View Full Code Here

TOP

Related Classes of org.impalaframework.module.RuntimeModule

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.