Package org.impalaframework.facade

Examples of org.impalaframework.facade.ModuleManagementFacade


   */
  @Override
  protected WebApplicationContext createWebApplicationContext(ServletContext servletContext, ApplicationContext parent)
      throws BeansException {

    ModuleManagementFacade facade = createModuleManagementFacade(servletContext);

    // load the parent context, which is web-independent
    ModuleDefinitionSource moduleDefinitionSource = getModuleDefinitionSource(servletContext, facade);

    // add items to servlet context
    servletContext.setAttribute(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE, moduleDefinitionSource);
    servletContext.setAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE, facade);
   
    ModuleOperationInput input = new ModuleOperationInput(moduleDefinitionSource, null, null);
    ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.UpdateRootModuleOperation);   
    operation.execute(input);

    ConfigurableApplicationContext context = facade.getModuleStateHolder().getRootModuleContext();

    if (context == null) {
      throw new InvalidStateException("Root application context is null");
    }
   
View Full Code Here


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

    // the superclass closes the modules
    ModuleManagementFacade facade = ImpalaServletUtils.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

  }

    void initApplicationContext(BundleContext bundleContext, ApplicationContext applicationContext) {
    
       //TODO introduce constants for bean names
    ModuleManagementFacade facade = ObjectUtils.cast(applicationContext.getBean("moduleManagementFacade"),
        ModuleManagementFacade.class);
   
    if (facade == null) {
      throw new InvalidStateException("Application context '" + applicationContext.getDisplayName()
          + "' does not contain bean named 'moduleManagementFacade'");
View Full Code Here

    }

    void initApplicationContext(BundleContext bundleContext, ApplicationContext applicationContext) {
      
        //TODO introduce constants for bean names
        ModuleManagementFacade facade = ObjectUtils.cast(applicationContext.getBean("moduleManagementFacade"),
                ModuleManagementFacade.class);
       
        if (facade == null) {
            throw new InvalidStateException("Application context '" + applicationContext.getDisplayName()
                    + "' does not contain bean named 'moduleManagementFacade'");
View Full Code Here

  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();
    ModuleStateHolder moduleStateHolder = facade.getModuleStateHolder();
   
    if (!initialized) {
     
      ModuleStateChangeNotifier moduleStateChangeNotifier = facade.getModuleStateChangeNotifier();
      moduleStateChangeNotifier.addListener(new ModuleStateChangeListener() {

        public void moduleStateChanged(ModuleStateHolder moduleStateHolder, ModuleStateChange change) {
          try {
            servlet.init();
View Full Code Here

    }

    void initApplicationContext(BundleContext bundleContext, ApplicationContext applicationContext) {
      
        //TODO introduce constants for bean names
        ModuleManagementFacade facade = ObjectUtils.cast(applicationContext.getBean("moduleManagementFacade"),
                ModuleManagementFacade.class);
       
        if (facade == null) {
            throw new InvalidStateException("Application context '" + applicationContext.getDisplayName()
                    + "' does not contain bean named 'moduleManagementFacade'");
View Full Code Here

public class ModuleIntegrationUtils {

    public static HttpServletRequest getWrappedRequest(HttpServletRequest request,
            ServletContext servletContext, RequestModuleMapping moduleMapping) {
        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, moduleMapping);
            } else {
                wrappedRequest = request;
            }
View Full Code Here

    protected ConfigurableApplicationContext initImpalaApplicationContext(
            ServletContext servletContext,
            final WebApplicationContext superContext) {
       
        ModuleManagementFacade facade = createModuleManagementFacade(servletContext, superContext);

        // load the parent context, which is web-independent
        ModuleDefinitionSource moduleDefinitionSource = getModuleDefinitionSource(servletContext, facade);

        // add items to servlet context
        servletContext.setAttribute(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE, moduleDefinitionSource);
        servletContext.setAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE, facade);

        ApplicationManager applicationManager = facade.getApplicationManager();
        Application application = applicationManager.getCurrentApplication();
       
        ModuleOperationInput input = new ModuleOperationInput(moduleDefinitionSource, null, null);
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.UpdateRootModuleOperation);      
        operation.execute(application, input);

        ConfigurableApplicationContext context = SpringModuleUtils.getRootSpringContext(application.getModuleStateHolder());

        if (context == null) {
View Full Code Here

    @Override
    public void closeWebApplicationContext(ServletContext servletContext) {

        try {
            // the superclass closes the modules
            ModuleManagementFacade facade = WebServletUtils.getModuleManagementFacade(servletContext);
   
            if (facade != null) {
   
                servletContext.log("Closing modules and root application context hierarchy");
   
                facade.getApplicationManager().close();
   
                // now close the bootstrap factory
                facade.close();
            }       
        } finally {
            super.closeWebApplicationContext(servletContext);
        }
    }
View Full Code Here

                    + "' as ServletContext attribute with name [" + attrName + "]");
        }
    }

    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

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.