Forums Register Login

exposing bussiness method to client

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
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.
A magnificient life is loaded with tough challenges. En garde tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 444 times.
Similar Threads
Should I design a front controller for swing component?
Controller and Bussiness delegate
EJB call
Transaction Timeout in Stateful Session Ejb
Doubt in ejbCreate
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:13:38.