FileDocCategorySizeDatePackage
POJO.javaAPI DocJBoss 4.2.12862Fri Jul 13 21:02:24 BST 2007org.jboss.test.asynch

POJO

public class POJO extends Object
Comment
author
Bill Burke
version
$Revision: 57186 $

Fields Summary
Constructors Summary
Methods Summary
public voidtest()

      AsynchProvider asynch = (AsynchProvider) this;
      testMethod(5);

      Future future = asynch.getFuture();
      int rtn = ((Integer) future.get()).intValue();
      if (rtn != 5) throw new RuntimeException("integer return value invalid");

      testMethod("hello");

      future = asynch.getFuture();
      String srtn = (String) future.get();
      if (!"hello".equals(srtn)) throw new RuntimeException("string return value failed");


   
public voidtestCollocated()


      POJO pojo = (POJO) AsynchRemoting.createRemoteProxy("pojo", POJO.class, new InvokerLocator("socket://localhost:5150"));

      AsynchProvider asynch = (AsynchProvider) pojo;
      pojo.testMethod(5);

      Future future = asynch.getFuture();
      int rtn = ((Integer) future.get()).intValue();
      if (rtn != 5) throw new RuntimeException("integer return value invalid");

      pojo.testMethod("hello");

      future = asynch.getFuture();
      String srtn = (String) future.get();
      if (!"hello".equals(srtn)) throw new RuntimeException("string return value failed");

   
public inttestMethod(int echo)

@org.jboss.aspects.asynch.Asynchronous

      System.out.println("echo: " + echo);
      return echo;
   
public java.lang.StringtestMethod(java.lang.String echo)

@org.jboss.aspects.asynch.Asynchronous

      System.out.println("ECHO: echo");
      return echo;