Methods Summary |
---|
public static javax.naming.InitialContext | getInitialContext()
Hashtable props = getInitialContextProperties();
return new InitialContext(props);
|
private static java.util.Hashtable | getInitialContextProperties()
Hashtable props = new Hashtable();
props.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
return props;
|
public static void | main(java.lang.String[] args)
EJB3StandaloneBootstrap.boot(null);
EJB3StandaloneBootstrap.scanClasspath();
InitialContext ctx = getInitialContext();
CustomerDAOLocal local = (CustomerDAOLocal)ctx.lookup("CustomerDAOBean/local");
CustomerDAORemote remote = (CustomerDAORemote)ctx.lookup("CustomerDAOBean/remote");
System.out.println("----------------------------------------------------------");
System.out.println("This test scans the System Property java.class.path for all annotated EJB3 classes");
System.out.print(" ");
int id = local.createCustomer("Gavin");
Customer cust = local.findCustomer(id);
System.out.println("Successfully created and found Gavin from @Local interface");
id = remote.createCustomer("Emmanuel");
cust = remote.findCustomer(id);
System.out.println("Successfully created and found Emmanuel from @Remote interface");
System.out.println("----------------------------------------------------------");
|