Examples of ModuleManagementFacade


Examples of org.impalaframework.facade.ModuleManagementFacade

    @Override
    protected RequestModuleMapper newRequestModuleMapper(FilterConfig config) {
        final ServletContext servletContext = config.getServletContext();

        ModuleManagementFacade facade = WebServletUtils.getModuleManagementFacade(servletContext);
        if (facade.containsBean("requestModuleMapper")) {
            return ObjectUtils.cast(facade.getBean("requestModuleMapper"), RequestModuleMapper.class);
        }
        return super.newRequestModuleMapper(config);
    }
View Full Code Here

Examples of org.impalaframework.facade.ModuleManagementFacade

   
    @Override
    protected RequestModuleMapper newRequestModuleMapper(ServletConfig config) {
        final ServletContext servletContext = config.getServletContext();

        ModuleManagementFacade facade = WebServletUtils.getModuleManagementFacade(servletContext);
        if (facade.containsBean("requestModuleMapper")) {
            return ObjectUtils.cast(facade.getBean("requestModuleMapper"), RequestModuleMapper.class);
        }
        return super.newRequestModuleMapper(config);
    }
View Full Code Here

Examples of org.impalaframework.facade.ModuleManagementFacade

    HttpSession wrapSession(HttpSession session) {
        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");
View Full Code Here

Examples of org.impalaframework.facade.ModuleManagementFacade

    }

    @Override
    protected WebApplicationContext initWebApplicationContext() throws BeansException {
       
        ModuleManagementFacade moduleManagementFacade = ImpalaServletUtils.getModuleManagementFacade(getServletContext());
        this.frameworkLockHolder = moduleManagementFacade.getFrameworkLockHolder();
       
        try {
           
            this.frameworkLockHolder.writeLock();
       
View Full Code Here

Examples of org.impalaframework.facade.ModuleManagementFacade

public class ModuleIntegrationUtils {

    public static HttpServletRequest getWrappedRequest(HttpServletRequest request,
            ServletContext servletContext, String moduleName) {
        final ModuleManagementFacade moduleManagementFactory = WebServletUtils.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

Examples of org.impalaframework.facade.ModuleManagementFacade

       
        return ObjectUtils.cast(attribute, ApplicationContext.class);
    }

    public static ModuleManagementFacade getModuleManagementFacade(ServletContext servletContext) {
        ModuleManagementFacade facade = WebServletUtils.getModuleManagementFacade(servletContext);
   
        if (facade == null) {
            throw new ConfigurationException("Unable to load " + FrameworkServletContextCreator.class.getName()
                    + " as no attribute '" + WebConstants.IMPALA_FACTORY_ATTRIBUTE
                    + "' has been set up. Have you set up your Impala ContextLoader correctly?");
View Full Code Here

Examples of org.impalaframework.facade.ModuleManagementFacade

  public WebApplicationContext createWebApplicationContext() throws BeansException {

    // the superclass closes the modules
    final ServletContext servletContext = servlet.getServletContext();
    ModuleManagementFacade facade = ImpalaServletUtils.getModuleManagementFacade(servletContext);

    final String servletName = servlet.getServletName();
    Application application = facade.getApplicationManager().getCurrentApplication();
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
   
    if (!initialized) {
     
      ModuleStateChangeNotifier moduleStateChangeNotifier = facade.getModuleStateChangeNotifier();
      ModuleStateChangeListener listener = newModuleStateChangeListener(servletName);
            moduleStateChangeNotifier.addListener(listener);
      this.initialized = true;
    }
   
View Full Code Here

Examples of org.impalaframework.facade.ModuleManagementFacade

    @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

Examples of org.impalaframework.facade.ModuleManagementFacade

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

        if (!modified.isEmpty()) {
           
            ModuleManagementFacade factory = WebServletUtils.getModuleManagementFacade(servletContext);               
            ApplicationManager applicationManager = factory.getApplicationManager();
            Application application = applicationManager.getCurrentApplication();

            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(application, moduleOperationInput);
            }
        }
View Full Code Here

Examples of org.impalaframework.facade.ModuleManagementFacade

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);

        ModuleManagementFacade moduleManagementFacade = ImpalaServletUtils.getModuleManagementFacade(config.getServletContext());
        this.frameworkLockHolder = moduleManagementFacade.getFrameworkLockHolder();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.