• Post Reply Bookmark Topic Watch Topic
  • New Topic

exposing bussiness method to client

 
siva sankar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written a standalone client to invoke the ejb running on weblogic server.It is working fine.But what i want is,how does the client can know all the bussiness methods of EJB(without implementation).If client is able to know,how is it possible.

thanks & regards,
Siva
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siva,

The first and the easiest solution to your problem is to ask the developer of the bean. However, if you have a requirement to call a business method dynamically at runtime then you could use one of the two approaches below.

A. Use standard java reflection(or apache commons reflection) on the remote reference of the bean on the client side. This should work with JDK < 5.0.

B. Use anotations. The bean developer could annotate methods with "@Business" or something else that makes sense. The client developer could check for this annotation using an annotation parser(which someone has to write or find it on Google). You could also add some text describing your business methods to this custom annotation.

Cheers!

[ July 31, 2007: Message edited by: Shailesh Kini ]
[ July 31, 2007: Message edited by: Shailesh Kini ]
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by siva sankar:
Hi,

I have written a standalone client to invoke the ejb running on weblogic server.It is working fine.But what i want is,how does the client can know all the bussiness methods of EJB(without implementation).If client is able to know,how is it possible.

thanks & regards,
Siva


Can you explain it a little more as to what is the real requirement.
Do you want to just lookup *any* EJB and invoke some methods on it? If yes, how would you know what data should be passed to the bean?
If no, then the Remote interface is the best way to know what all business methods are exposed by the EJB.
 
purushottaman dwarkanathan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use the service locator design pattern to get a handle to remote service, which you would have binded with the JNDI name. Once you get a handle to the proxy, you will be able to call all the business methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!