Package org.jboss.test.cluster.ejb2.basic.interfaces

Examples of org.jboss.test.cluster.ejb2.basic.interfaces.StatelessSessionHome


     
      // CalledHome EJB is contained in cross-server.jar and bound during deployment
      // lookup binding locally on Node0 - should succeed
      Context naming = getContext(NODE0_JNDI);
      CalledHome home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      { // ensure that EJB is operational 
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on same server using local JNDI", home);
     
      // lookup binding locally on Node1 - should succeed
      naming = getContext(NODE1_JNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on different server in cluster using local JNDI", home);
     
      // lookup binding using HA-JNDI on Node0 - should succeed
      naming = getContext(NODE0_HAJNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on same server using HA-JNDI", home);
     
      // lookup binding using HA-JNDI on Node1 - should succeed
      naming = getContext(NODE1_HAJNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on different server in cluster using HA-JNDI", home);
View Full Code Here


     
      // CalledHome EJB is contained in cross-server.jar and bound during deployment
      // lookup binding locally on Node0 - should succeed
      Context naming = getContext(NODE0_JNDI);
      CalledHome home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      { // ensure that EJB is operational 
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on same server using local JNDI", home);
     
      // lookup binding locally on Node1 - should succeed
      naming = getContext(NODE1_JNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on different server in cluster using local JNDI", home);
     
      // lookup binding using HA-JNDI on Node0 - should succeed
      naming = getContext(NODE0_HAJNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on same server using HA-JNDI", home);
     
      // lookup binding using HA-JNDI on Node1 - should succeed
      naming = getContext(NODE1_HAJNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on different server in cluster using HA-JNDI", home);
View Full Code Here

      env1.setProperty(Context.INITIAL_CONTEXT_FACTORY,
         "org.jnp.interfaces.NamingContextFactory");
      env1.setProperty(Context.PROVIDER_URL, urls[0]);
      InitialContext ctx = new InitialContext(env1);
     
      CalledHome home = (CalledHome) ctx.lookup("cluster.ejb.CalledHome");
      CalledRemote bean = home.create();
      VMID[] ids = bean.invokeCall(urls[1], "cluster.ejb.CalleeHome");
      log.info("VMID[0] = "+ids[0]);
      log.info("VMID[1] = "+ids[1]);
      assertTrue("VMID[0] != VMID[1]", ids[0].equals(ids[1]) == false);
      bean.remove();
View Full Code Here

      // lookup binding locally on Node0 - should succeed
      Context naming = getContext(NODE0_JNDI);
      CalledHome home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      { // ensure that EJB is operational 
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on same server using local JNDI", home);
     
      // lookup binding locally on Node1 - should succeed
      naming = getContext(NODE1_JNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on different server in cluster using local JNDI", home);
     
      // lookup binding using HA-JNDI on Node0 - should succeed
      naming = getContext(NODE0_HAJNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on same server using HA-JNDI", home);
     
      // lookup binding using HA-JNDI on Node1 - should succeed
      naming = getContext(NODE1_HAJNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on different server in cluster using HA-JNDI", home);

   }
View Full Code Here

      // lookup binding locally on Node0 - should succeed
      Context naming = getContext(NODE0_JNDI);
      CalledHome home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      { // ensure that EJB is operational 
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on same server using local JNDI", home);
     
      // lookup binding locally on Node1 - should succeed
      naming = getContext(NODE1_JNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on different server in cluster using local JNDI", home);
     
      // lookup binding using HA-JNDI on Node0 - should succeed
      naming = getContext(NODE0_HAJNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on same server using HA-JNDI", home);
     
      // lookup binding using HA-JNDI on Node1 - should succeed
      naming = getContext(NODE1_HAJNDI);
      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
      if (home != null)
      {   // ensure that EJB is operational
         CalledRemote remote = home.create();
         remote.remove();
      }
      closeContext(naming);
      assertNotNull("lookup EJB binding on different server in cluster using HA-JNDI", home);

   }
View Full Code Here

         "org.jnp.interfaces.NamingContextFactory");
      env1.setProperty(Context.PROVIDER_URL, urls[0]);
      InitialContext ctx = new InitialContext(env1);
     
      CalledHome home = (CalledHome) ctx.lookup("cluster.ejb.CalledHome");
      CalledRemote bean = home.create();
      VMID[] ids = bean.invokeCall(urls[1], "cluster.ejb.CalleeHome");
      log.info("VMID[0] = "+ids[0]);
      log.info("VMID[1] = "+ids[1]);
      assertTrue("VMID[0] != VMID[1]", ids[0].equals(ids[1]) == false);
      bean.remove();
      log.info("done");
   }
View Full Code Here

      {        
         tx = (UserTransaction)ctx.lookup("UserTransaction");
         tx.begin();
         try
         {
            UserTransactionStickyHome home = (UserTransactionStickyHome)ctx.lookup(jndiName);
            UserTransactionStickyRemote bean = home.create();
            for (int j = 1; j <= numCallsPerTx; j++)
            {
               String origin = "tx" + i + "-c" + j;           
               log(origin + " " + bean.amISticky());
            }
View Full Code Here

         tx = (UserTransaction)ctx.lookup("UserTransaction");
         tx.begin();
         try
         {
            UserTransactionStickyHome home = (UserTransactionStickyHome)ctx.lookup(jndiName);
            UserTransactionStickyRemote bean = home.create();
            for (int j = 1; j <= numCallsPerTx; j++)
            {
               String origin = "tx" + i + "-c" + j;           
               log(origin + " " + bean.amISticky());
            }
            log("");
         }
         catch (Exception e)
         {
View Full Code Here

TOP

Related Classes of org.jboss.test.cluster.ejb2.basic.interfaces.StatelessSessionHome

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.