Package org.jboss.test.cts.interfaces

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


      {
         getLog().debug("Unserialize bean handle...");
         ByteArrayInputStream in = new ByteArrayInputStream(bytes);
         ObjectInputStream ois = new ObjectInputStream(in);
         beanHandle = (Handle) ois.readObject();
         StatelessSession theSession = (StatelessSession) beanHandle.getEJBObject();
         theSession.method1("Hello");
         getLog().debug("Called method1 on handle session bean");
      }
      finally
      {
         System.setProperties(sysProps);
View Full Code Here


         Object ref = ctx.lookup("ejbcts/StatelessSessionHome");
         StatelessSessionHome home = (StatelessSessionHome)
               PortableRemoteObject.narrow(ref, StatelessSessionHome.class);
         sessionBean = home.create();
         StatelessSessionHome home2 = (StatelessSessionHome) sessionBean.getEJBHome();
         StatelessSession bean2 = home2.create();
         bean2.remove();
      }
      finally
      {
         System.setProperties(sysProps);
      }
View Full Code Here

    */
   public void testEjbs() throws Exception
   {
      Context enc = getENC();     
      StatelessSessionHome home = (StatelessSessionHome) enc.lookup("ejb/StatelessSessionBean");
      StatelessSession session = home.create();
      session.method1("testEjbs");
      session.remove();
   }
View Full Code Here

   static void testEjbs() throws Exception
   {
      log.info("+++ testEjbs");
      Context enc = getENC();     
      StatelessSessionHome home = (StatelessSessionHome) enc.lookup("ejb/StatelessSessionBean");
      StatelessSession session = home.create();
      session.method1("testEjbs");
      session.remove();
   }
View Full Code Here

      try
      {
         InitialContext ctx = new InitialContext();
         enc = (Context) ctx.lookup("java:comp/env");
         StatelessSessionHome home = (StatelessSessionHome) enc.lookup("ejb/StatelessSessionHome");
         StatelessSession bean = home.create();
         sessionHandle = bean.getHandle();
      }
      catch(Exception e)
      {
         log.error("StatelessSessionHome create failed", e);
         throw new EJBException("StatelessSessionHome create failed", e);
View Full Code Here

   public String useSessionHandle(String arg)
   {
      log.info("useSessionHandle");
      try
      {
         StatelessSession bean = (StatelessSession) sessionHandle.getEJBObject();
         arg = bean.method1(arg);
      }
      catch(Exception e)
      {
         log.error("StatelessSession handle failed", e);
         throw new EJBException("StatelessSession handle failed", e);
View Full Code Here

      try
      {
         InitialContext ctx = new InitialContext();
         enc = (Context) ctx.lookup("java:comp/env");
         StatelessSessionHome home = (StatelessSessionHome) enc.lookup("ejb/StatelessSessionHome");
         StatelessSession bean = home.create();
         sessionHandle = bean.getHandle();
      }
      catch(Exception e)
      {
         log.error("StatelessSessionHome create failed", e);
         throw new EJBException("StatelessSessionHome create failed", e);
View Full Code Here

   public String useSessionHandle(String arg)
   {
      log.info("useSessionHandle");
      try
      {
         StatelessSession bean = (StatelessSession) sessionHandle.getEJBObject();
         arg = bean.method1(arg);
      }
      catch(Exception e)
      {
         log.error("StatelessSession handle failed", e);
         throw new EJBException("StatelessSession handle failed", e);
View Full Code Here

   {
      try
      {
         InitialContext ctx = new InitialContext();
         StatelessSessionHome home = (StatelessSessionHome) ctx.lookup("ejbcts/StatelessSessionBean");
         StatelessSession sessionBean;
         try
         {
            sessionBean = home.create();
         }
         catch (CreateException ex)
         {
            log.debug("Loopback CreateException: " + ex);
            throw new EJBException(ex);
         }
         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.
      StatelessSession bean = (StatelessSession) obj;
      bean.method1("Hello");
   }
View Full Code Here

TOP

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

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.