Examples of LifecycleBean


Examples of com.sun.faces.config.beans.LifecycleBean

            fcb = (FacesConfigBean) digester.peek();
        } catch (Exception e) {
            throw new IllegalStateException
                ("No parent FacesConfigBean on object stack");
        }
        LifecycleBean lb = fcb.getLifecycle();
        if (lb == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[LifecycleRule]{" +
                                           digester.getMatch() +
                                           "} New " + CLASS_NAME);

Examples of com.sun.faces.config.beans.LifecycleBean

        applicationBean.addActionListener("com.sun.faces.application.ActionListenerImpl");
        applicationBean.addNavigationHandler("com.sun.faces.application.NavigationHandlerImpl");
        applicationBean.addStateManager("com.sun.faces.application.StateManagerImpl");
        applicationBean.addViewHandler("com.sun.faces.application.ViewHandlerImpl");

        lifecycleBean = new LifecycleBean();
        lifecycleBean.addPhaseListener("com.sun.faces.lifecycle.ELResolverInitPhaseListener");

        /*
         * Wrap these in braces to allow repetition of the ivar name
         */
 

Examples of com.sun.faces.config.beans.LifecycleBean

            fcb = (FacesConfigBean) digester.peek();
        } catch (Exception e) {
            throw new IllegalStateException
                ("No parent FacesConfigBean on object stack");
        }
        LifecycleBean lb = fcb.getLifecycle();
        if (lb == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[LifecycleRule]{" +
                                           digester.getMatch() +
                                           "} New " + CLASS_NAME);

Examples of org.springframework.beans.factory.LifecycleBean

  public void testTestBeanCount() {
    assertTestBeanCount(13);
  }

  public void testLifecycleMethods() throws Exception {
    LifecycleBean bean = (LifecycleBean) getBeanFactory().getBean("lifecycle");
    bean.businessMethod();
  }

Examples of org.springframework.beans.factory.LifecycleBean

    TestBean dad = (TestBean) applicationContext.getBean("father", TestBean.class);
    assertTrue("Dad has correct name", dad.getName().equals("Albert"));
  }

  public void testCloseTriggersDestroy() {
    LifecycleBean lb = (LifecycleBean) applicationContext.getBean("lifecycle");
    assertTrue("Not destroyed", !lb.isDestroyed());
    applicationContext.close();
    if (applicationContext.getParent() != null) {
      ((ConfigurableApplicationContext) applicationContext.getParent()).close();
    }
    assertTrue("Destroyed", lb.isDestroyed());
    applicationContext.close();
    if (applicationContext.getParent() != null) {
      ((ConfigurableApplicationContext) applicationContext.getParent()).close();
    }
    assertTrue("Destroyed", lb.isDestroyed());
  }

Examples of org.springframework.beans.factory.LifecycleBean

    ServletContextEvent event = new ServletContextEvent(sc);
    listener.contextInitialized(event);
    WebApplicationContext context = (WebApplicationContext) sc.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
    assertTrue("Correct WebApplicationContext exposed in ServletContext",
        context instanceof XmlWebApplicationContext);
    LifecycleBean lb = (LifecycleBean) context.getBean("lifecycle");
    assertTrue("Has father", context.containsBean("father"));
    assertTrue("Has rod", context.containsBean("rod"));
    assertTrue("Has kerry", context.containsBean("kerry"));
    assertTrue("Not destroyed", !lb.isDestroyed());
    assertFalse(context.containsBean("beans1.bean1"));
    assertFalse(context.containsBean("beans1.bean2"));
    listener.contextDestroyed(event);
    assertTrue("Destroyed", lb.isDestroyed());
  }

Examples of org.springframework.beans.factory.LifecycleBean

    ServletConfig config = new MockServletConfig(sc, "test");
    servlet.init(config);
    WebApplicationContext context = (WebApplicationContext) sc.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
    assertTrue("Correct WebApplicationContext exposed in ServletContext",
        context instanceof XmlWebApplicationContext);
    LifecycleBean lb = (LifecycleBean) context.getBean("lifecycle");
    assertTrue("Not destroyed", !lb.isDestroyed());
    assertFalse(context.containsBean("beans1.bean1"));
    assertFalse(context.containsBean("beans1.bean2"));
    servlet.destroy();
    assertTrue("Destroyed", lb.isDestroyed());
  }

Examples of org.springframework.beans.factory.LifecycleBean

    ServletContextEvent event = new ServletContextEvent(sc);
    listener.contextInitialized(event);
    WebApplicationContext context = (WebApplicationContext) sc.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
    assertTrue("Correct WebApplicationContext exposed in ServletContext",
        context instanceof XmlWebApplicationContext);
    LifecycleBean lb = (LifecycleBean) context.getBean("lifecycle");
    assertTrue("Has father", context.containsBean("father"));
    assertTrue("Has rod", context.containsBean("rod"));
    assertTrue("Has kerry", context.containsBean("kerry"));
    assertTrue("Not destroyed", !lb.isDestroyed());
    assertTrue(context.containsBean("beans1.bean1"));
    assertTrue(context.isTypeMatch("beans1.bean1", org.springframework.beans.factory.access.TestBean.class));
    assertTrue(context.containsBean("beans1.bean2"));
    assertTrue(context.isTypeMatch("beans1.bean2", org.springframework.beans.factory.access.TestBean.class));
    listener.contextDestroyed(event);
    assertTrue("Destroyed", lb.isDestroyed());
  }

Examples of org.springframework.tests.sample.beans.LifecycleBean

  public void testTestBeanCount() {
    assertTestBeanCount(13);
  }

  public void testLifecycleMethods() throws Exception {
    LifecycleBean bean = (LifecycleBean) getBeanFactory().getBean("lifecycle");
    bean.businessMethod();
  }

Examples of org.springframework.tests.sample.beans.LifecycleBean

    TestBean dad = applicationContext.getBean("father", TestBean.class);
    assertTrue("Dad has correct name", dad.getName().equals("Albert"));
  }

  public void testCloseTriggersDestroy() {
    LifecycleBean lb = (LifecycleBean) applicationContext.getBean("lifecycle");
    assertTrue("Not destroyed", !lb.isDestroyed());
    applicationContext.close();
    if (applicationContext.getParent() != null) {
      ((ConfigurableApplicationContext) applicationContext.getParent()).close();
    }
    assertTrue("Destroyed", lb.isDestroyed());
    applicationContext.close();
    if (applicationContext.getParent() != null) {
      ((ConfigurableApplicationContext) applicationContext.getParent()).close();
    }
    assertTrue("Destroyed", lb.isDestroyed());
  }
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.