Make web site - Writing Your First Bean 71 The complete client

Writing Your First Bean 71 The complete client source code is shown in Source 3.8. package examples; import javax.naming.Context; import javax.naming.InitialContext; import java.util.Properties; /** * This class is an example of client code that invokes * methods on a simple stateless session bean. */ public class HelloClient { public static void main(String[] args) throws Exception { /* * Setup properties for JNDI initialization. * * These properties will be read-in from * the command-line. */ Properties props = System.getProperties(); /* * Obtain the JNDI initial context. * * The initial context is a starting point for * connecting to a JNDI tree. We choose our JNDI * driver, the network location of the server, etc. * by passing in the environment properties. */ Context ctx = new InitialContext(props); /* * Get a reference to the home object - the * factory for Hello EJB Objects */ Object obj = ctx.lookup( HelloHome ); /* * Home objects are RMI-IIOP objects, and so * they must be cast into RMI-IIOP objects * using a special RMI-IIOP cast. * * See Appendix A for more details on this. */ HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow( Source 3.8 HelloClient.java. (continued)
We are here to provide web hosting at an affordable rate for the online Christian community. The term “Christian” is used by various groups with diverse beliefs to describe themselves. Some people, including many born-again Christians, use a fairly specific definition of “Christian”. They believe that in order to be a Christian, one must follow Jesus, and that the proof of this is found in agreeing to and following the doctrines set forth in the Bible. Others who refer to themselves as Christians require only that one believes that Jesus is the Son of God, that he died, and that he was resurrected from the dead, to claim the term Christian.Check Christian Web Hosting section.

Leave a Reply