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 ItemClient { 15 16 static Context ctx = null; 17 static ItemHome 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 = "ItemHome"; 31 try { 32 home = (ItemHome) PortableRemoteObject.narrow(ctx.lookup(bName), ItemHome.class); 33 } catch(Exception e) { 34 e.printStackTrace(); 35 System.exit(2); 36 } 37 38 } 40 } 41 | Popular Tags |