Java Reference
In-Depth Information
Coding the EJB client
We are done with the configuration. We will finally proceed with adding a new
Java class
com.packtpub.as7development.chapter3.client.RemoteEJBClient
that will communicate with the Ticket Booking machine's EJB application:
public class RemoteEJBClient {
private final static java.util.logging.Logger
logger = Logger.getLogger(RemoteEJBClient.class
.getName());
private final static Hashtable jndiProperties =
new Hashtable();
public static void main(String[] args) throws
Exception {
Logger.getLogger("org.jboss").setLevel(Level.SEVERE);
[1]
Logger.getLogger("org.xnio").setLevel(Level.SEVERE);
testRemoteEJB();
}
private static void testRemoteEJB() throws
NamingException {
jndiProperties.put(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
final TheatreInfo info =
lookupTheatreInfoEJB(); [2]
final TheatreBooker book =
lookupTheatreBookerEJB(); [3]
String command = "";
Search WWH ::




Custom Search