Package org.jboss.test.cts.interfaces

Examples of org.jboss.test.cts.interfaces.StatefulSession


   public void loopbackTest (EJBObject obj)
      throws RemoteException
   {
      // This should throw an exception.
      StatefulSession bean = ( StatefulSession ) obj;

      bean.method1("Hello");
   }
View Full Code Here


   {
      log.info("createStatefulSessionHandle");
      try
      {
         StatefulSessionHome home = (StatefulSessionHome) sessionCtx.getEJBHome();
         StatefulSession bean = home.create(testName);
         bean.incCounter();
         Handle handle = bean.getHandle();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(handle);
         this.statefulHandle = baos.toByteArray();
      }
View Full Code Here

      try
      {
         ByteArrayInputStream bais = new ByteArrayInputStream(statefulHandle);
         ObjectInputStream ois = new ObjectInputStream(bais);
         Handle handle = (Handle) ois.readObject();
         StatefulSession bean = (StatefulSession) handle.getEJBObject();
         bean.incCounter();
         int count = bean.getCounter();
         log.info("useStatefulSessionHandle, count="+count);
      }
      catch(Exception e)
      {
         log.error("Failed to read session from handle", e);
View Full Code Here

   {
      try
      {
        Context ctx = new InitialContext();
        StatefulSessionHome home = (StatefulSessionHome) ctx.lookup("ejbcts/StatefulSessionBean");
        StatefulSession sessionBean;
        try
        {
           sessionBean = home.create(testName);
        }
        catch (CreateException crex)
        {
           log.debug("Loopback CreateException: " + crex);
           throw new EJBException(crex);
        }
        sessionBean.loopbackTest(sessionCtx.getEJBObject());

      }
      catch (javax.naming.NamingException nex)
      {
         log.debug("Could not locate bean instance");
View Full Code Here

   public void loopbackTest (EJBObject obj)
      throws java.rmi.RemoteException
   {
      // This should throw an exception.
      StatefulSession bean = ( StatefulSession ) obj;

      bean.method1("Hello");
   }
View Full Code Here

   {
      log.info("createStatefulSessionHandle");
      try
      {
         StatefulSessionHome home = (StatefulSessionHome) sessionCtx.getEJBHome();
         StatefulSession bean = home.create(testName);
         bean.incCounter();
         Handle handle = bean.getHandle();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(handle);
         this.statefulHandle = baos.toByteArray();
      }
View Full Code Here

      try
      {
         ByteArrayInputStream bais = new ByteArrayInputStream(statefulHandle);
         ObjectInputStream ois = new ObjectInputStream(bais);
         Handle handle = (Handle) ois.readObject();
         StatefulSession bean = (StatefulSession) handle.getEJBObject();
         bean.incCounter();
         int count = bean.getCounter();
         log.info("useStatefulSessionHandle, count="+count);
      }
      catch(Exception e)
      {
         log.error("Failed to read session from handle", e);
View Full Code Here

  public void testLongWait() throws Exception
  {
      Context ctx = getInitialContext();
      getLog().debug("+++ testLongWait");
      StatefulSessionHome sessionHome = ( StatefulSessionHome ) ctx.lookup("ejbcts/LongWaitStatefulSessionBean");
      StatefulSession sessionBean = sessionHome.create("testLongWait");   

      getLog().debug("Sleeping...");
      sessionBean.sleep(5000);
      sessionBean.ping();
      getLog().debug("+++ testLongWait passed");
  }
View Full Code Here

TOP

Related Classes of org.jboss.test.cts.interfaces.StatefulSession

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.