Examples of lookupStateful()


Examples of org.jboss.as.test.clustering.ejb.LocalEJBDirectory.lookupStateful()

        String bean = getRequiredParameter(req, BEAN);
        HttpSession session = req.getSession(true);
        Incrementor incrementor = (Incrementor) session.getAttribute(BEAN);
        if (incrementor == null) {
            try (LocalEJBDirectory directory = new LocalEJBDirectory(module)) {
                incrementor = directory.lookupStateful(bean, Incrementor.class);
            } catch (NamingException e) {
                throw new ServletException(e);
            }
        }
        try {
View Full Code Here

Examples of org.jboss.as.test.clustering.ejb.LocalEJBDirectory.lookupStateful()

    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session = req.getSession(true);
        Stateful bean = (Stateful) session.getAttribute(BEAN);
        if (bean == null) {
            try (LocalEJBDirectory directory = new LocalEJBDirectory(StatefulBean.MODULE)) {
                bean = directory.lookupStateful(StatefulBean.class, Stateful.class);
            } catch (NamingException e) {
                throw new ServletException(e);
            }
        }
View Full Code Here

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory.lookupStateful()

    @Test
    public void testStatefulFailover() throws Exception {
        ContextSelector<EJBClientContext> selector = EJBClientContextSelector.setup(CLIENT_PROPERTIES);
        try (EJBDirectory context = new RemoteEJBDirectory(MODULE_NAME)) {
            Incrementor bean = context.lookupStateful(StatefulIncrementorBean.class, Incrementor.class);

            Result<Integer> result = bean.increment();
            String target = result.getNode();
            int count = 1;
            System.out.println("Established weak affinity to " + target);
View Full Code Here

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory.lookupStateful()

    @Test
    public void testConcurrentFailover() throws Exception {
        ContextSelector<EJBClientContext> selector = EJBClientContextSelector.setup(CLIENT_PROPERTIES);
        try (EJBDirectory directory = new RemoteEJBDirectory(MODULE_NAME)) {
            Incrementor bean = directory.lookupStateful(SlowToDestroyStatefulIncrementorBean.class, Incrementor.class);
            AtomicInteger count = new AtomicInteger();

            // Allow sufficient time for client to receive full topology
            Thread.sleep(CLIENT_TOPOLOGY_UPDATE_WAIT);
View Full Code Here

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory.lookupStateful()

    private Incrementor locator;

    @PostConstruct
    public void postConstruct() {
        try (EJBDirectory directory = new RemoteEJBDirectory(MODULE)) {
            this.locator = directory.lookupStateful(StatefulIncrementorBean.class, Incrementor.class);
        } catch (NamingException e) {
            throw new IllegalStateException(e);
        }
    }
View Full Code Here

Examples of org.jboss.test.cluster.ejb3.stateful.Stateful.lookupStateful()

      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      stateful.lookupStateful();
      Thread.sleep(10 * 1000);
      stateful.testStateful();
     
      stateful.lookupStateful();
      stateful.testStateful();
View Full Code Here

Examples of org.jboss.test.cluster.ejb3.stateful.Stateful.lookupStateful()

      assertNotNull(stateful);
      stateful.lookupStateful();
      Thread.sleep(10 * 1000);
      stateful.testStateful();
     
      stateful.lookupStateful();
      stateful.testStateful();
      Thread.sleep(10 * 1000);
      stateful.testStateful();
   }
  
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.