public class Client
{
public static void main(String[] args) throws Exception
{
InitialContext ctx = new InitialContext();
Echo echo = (Echo) ctx.lookup("EchoBean/remote");
System.out.println("-------- Synchronous call");
String ret = echo.echo("normal call");
System.out.println(ret);
// Create the asynchronous proxy
Echo asynchEcho = AsyncUtils.mixinAsync(echo);
System.out.println("-------- Asynchronous call");
ret = asynchEcho.echo("asynchronous call");
System.out.println("Direct return of async invocation is: " + ret);
System.out.println("-------- Synchronous call");
ret = echo.echo("normal call 2");
System.out.println(ret);