This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
As we know the clients would interact with the stubs of Home and Remote interface implementation objects. But how do we generate the stubs after the beans, Home and Remote interfaces are created from a JBoss server. I have my Bean,Home, Remote interfaces , ejb-jar.xml and Jboss.xml are all packaged to a jar file and deployed in JBoss. But how does an application client communicate with these beans with out having the stubs. Please let me know, if there is any command or mechanism to generate stubs which can be provided to client.
Thanks & Regards, SK
SCJP 5.0, DB2 - 800, DB2 - 803, SCDJWS (On the way)
Yes I meant to use ejb 2.1. But would you mind elaborating on your statement
All the client needs are the Remote and Remote Home interfaces. Your client looks up the remote home proxy using JNDI and from the proxy obtains the the home proxy.
In many books I read, it is mentioned that client needs a stub to communicate to the remote objects as client and remote objects do not share a common heap and stubs play a vital role in passing the request , attributes to the remote objects and they are network aware objects.
I think what you are reading concerns the underlying "plumbing" provided by the client JARs for the EJB container. So what the JBoss client code is doing for you is creating stubs. But the code you write does not have to be concerned with that.
For example, my client code looks something like this:
SomeEjbRemoteHome rh = (SomeEjbRemoteHome)context.lookup(SomeEjbRemoteHome.JNDI_NAME); SomeEjbRemote ejb = rh.create(); // at this point I can call the methods declared on the EJB ejb.someMethod();
Notice the my code doesn't have to worry about any stubs, and that the two interfaces, SomeEjbRemoteHome and SomeEjbRemote, are the same interfaces used by my EJB on the server.