FileDocCategorySizeDatePackage
Client.javaAPI DocJBoss 4.2.12529Fri Jul 13 20:54:44 BST 2007org.jboss.tutorial.packaging.client

Client

public class Client extends Object
Sample client for the jboss container.
author
Bill Burke
version
$Id: Client.java 60233 2007-02-03 10:13:23Z wolfc $

Fields Summary
Constructors Summary
Methods Summary
public static javax.naming.InitialContextgetInitialContext()

      return new InitialContext();
   
public static voidmain(java.lang.String[] args)

      Session1 session1 = (Session1) getInitialContext().lookup("tutorial/Session1Bean/remote");
      Session2 session2 = (Session2) getInitialContext().lookup("tutorial/Session2Bean/remote");

      int oneF = session1.create1FromFactory();
      int oneM = session1.create1FromManager();
      int twoF = session1.create2FromFactory();
      int twoM = session1.create2FromManager();

      Entity1 one = session2.find1FromFactory(oneF);
      System.out.println("factory: " + one.getString());

      one = session2.find1FromManager(oneM);
      System.out.println("manager: " + one.getString());


      Entity2 two = session2.find2FromFactory(twoF);
      System.out.println("factory: " + two.getString());

      two = session2.find2FromManager(twoM);
      System.out.println("manager: " + two.getString());