• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

exposing bussiness method to client

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic