Friday November 11, 2005 Bean's client Today I would like to finish guide that I started yesterday. We have application tier in issue tracking application. Now, we will develop J2SE client that invokes methods in EJB tier.
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost
InitialContext ctx = new InitialContext();
Object obj = ctx.lookup("IZFacadeBean");
IZFacadeRemote izFacade = ((IZFacadeRemoteHome)PortableRemoteObject.narrow(obj,
IZFacadeRemoteHome.class)).create();
// print issue ID 1
IssueDTO issue = izFacade.getIssueById(1);
System.out.println("Issue id: " + issue.getId() + ", summary: " + issue.getSummary());
// create new issue
izFacade.createNewIssue(new IssueDTO(new Long(10),"D", new Integer(1), "PETR", "Test fails"));