1 4 package org.objectweb.jonas.stests.appli; 5 6 import javax.naming.Context ; 7 import javax.naming.InitialContext ; 8 import javax.naming.NamingException ; 9 import javax.rmi.PortableRemoteObject ; 10 11 14 public class CustomerClient { 15 16 static Context ctx = null; 17 static CustomerHome home = null; 18 19 public static void main(String [] arg) { 20 21 try { 23 ctx = new InitialContext (); 24 } catch (NamingException e) { 25 e.printStackTrace(); 26 System.exit(2); 27 } 28 29 String bName = "CustomerHome"; 31 try { 32 home = (CustomerHome) PortableRemoteObject.narrow(ctx.lookup(bName), CustomerHome.class); 33 34 } catch(Exception e) { 35 e.printStackTrace(); 36 System.exit(2); 37 } 38 39 } 41 } 42 | Popular Tags |