Package org.impalaframework.facade

Examples of org.impalaframework.facade.ModuleManagementFacade


   */
  @Override
  public void closeWebApplicationContext(ServletContext servletContext) {

    // the superclass closes the modules
    ModuleManagementFacade facade = WebServletUtils.getModuleManagementFacade(servletContext);

    if (facade != null) {

      servletContext.log("Closing modules and root application context hierarchy");

      ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.CloseRootModuleOperation);
      boolean success = operation.execute(null).isSuccess();

      if (!success) {
        // this is the fallback in case the rootDefinition is null
        super.closeWebApplicationContext(servletContext);
      }

      // now close the bootstrap factory
      facade.close();
    }
  }
View Full Code Here


  public void moduleContentsModified(ModuleChangeEvent event) {
    Set<String> modified = getModifiedModules(event);

    if (!modified.isEmpty()) {
      ModuleManagementFacade factory = ImpalaServletUtils.getModuleManagementFacade(servletContext);

      for (String moduleName : modified) {

        logger.info("Processing modified module " + moduleName);

        ModuleOperation operation = factory.getModuleOperationRegistry().getOperation(ModuleOperationConstants.ReloadNamedModuleOperation);
        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, null, moduleName);
        operation.execute(moduleOperationInput);
      }
    }
  }
View Full Code Here

  @ManagedOperation(description = "Uses the current ModuleDefintitionSource to perform a full reload of the module hierarchy")
  public void reloadModules() {
   
    Assert.notNull(servletContext);

    ModuleManagementFacade factory = (ModuleManagementFacade) servletContext
        .getAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE);
    if (factory == null) {
      throw new ConfigurationException(
          "No instance of "
              + ModuleManagementFacade.class.getName()
              + " found. Your context loader needs to be configured to create an instance of this class and attach it to the ServletContext using the attribue WebConstants.IMPALA_FACTORY_ATTRIBUTE");
    }

    ModuleDefinitionSource source = (ModuleDefinitionSource) servletContext
        .getAttribute(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE);
    if (source == null) {
      throw new ConfigurationException(
          "No instance of "
              + ModuleDefinitionSource.class.getName()
              + " found. Your context loader needs to be configured to create an instance of this class and attach it to the ServletContext using the attribue WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE");

    }

    ModuleOperationInput moduleOperationInput = new ModuleOperationInput(source, null, null);
   
    ModuleOperation operation = factory.getModuleOperationRegistry().getOperation(ModuleOperationConstants.ReloadRootModuleOperation);
    operation.execute(moduleOperationInput);
  }
View Full Code Here

    return moduleName;
  }

  public static HttpServletRequest getWrappedRequest(HttpServletRequest request,
      ServletContext servletContext, String moduleName) {
    final ModuleManagementFacade moduleManagementFactory = ImpalaServletUtils.getModuleManagementFacade(servletContext);
    HttpServletRequest wrappedRequest = null;
   
    if (moduleManagementFactory != null) {
      HttpRequestWrapperFactory factory = ObjectUtils.cast(moduleManagementFactory.getBean(WebConstants.REQUEST_WRAPPER_FACTORY_BEAN_NAME), HttpRequestWrapperFactory.class);
      if (factory != null) {
        wrappedRequest = factory.getWrappedRequest(request, servletContext, moduleName);
      } else {
        wrappedRequest = request;
      }
View Full Code Here

TOP

Related Classes of org.impalaframework.facade.ModuleManagementFacade

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.