1 7 package org.jboss.ejb3.test.servicedependency; 8 9 import java.util.Properties ; 10 11 import javax.naming.InitialContext ; 12 import javax.rmi.PortableRemoteObject ; 13 14 20 public class Customer 21 { 22 23 29 public static void main(String [] args) throws Exception 30 { 31 Properties props = new Properties (); 32 props.setProperty("java.naming.factory.initial", 33 "org.jnp.interfaces.NamingContextFactory"); 34 props.setProperty("java.naming.factory.url.pkgs", 35 "org.jboss.naming:org.jnp.interfaces"); 36 props.setProperty("java.naming.provider.url", "localhost:1099"); 37 38 InitialContext ctx = new InitialContext (props); 39 40 Object ejb= ctx.lookup("AccountBean/remote"); 41 Account account = (Account)PortableRemoteObject.narrow(ejb, Account.class); 42 43 account.debit("galder", 10); 44 } 45 46 } 47 | Popular Tags |