Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Distributed Java and the fly likes I have class name,method name,input parameter datatypes as Strings.How to invoke the desired method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "I have class name,method name,input parameter datatypes as Strings.How to invoke the desired method?" Watch "I have class name,method name,input parameter datatypes as Strings.How to invoke the desired method?" New topic
Author

I have class name,method name,input parameter datatypes as Strings.How to invoke the desired method?

Narik Ramuk
Greenhorn

Joined: Jan 25, 2013
Posts: 3
Please reply
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Hi Narik and welcome to JavaRanch!

Unfortunately your problem description is not detailed enough for anyone here to know what you are trying to achieve. As you posted the question to the 'Distribued Java' forum I guess you want to make some kind of remote procedure call, right? There are many existing solutions and frameworks for this like Web Services, RMI, EJB and many more. But without knowing more about your problem it's impossible to give you good advices. You should try to explain it in a little bit more detail.

Marco
Narik Ramuk
Greenhorn

Joined: Jan 25, 2013
Posts: 3
Sorry.


What I am trying to achieve is.

I have a table in database having Class name , Method Name, Parameters the method takes and datatypes of the parameters.

I have to call that particular method by passing the parameters and get the return value dynamically in my class.

I hope this info is sufficient to understand what I want.


Is there a possible way?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42935
    
  68
So this all happens within the same JVM? As Marco said, "distributed" usually implies that more than one JVM is involved.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

If all you want to do is to call methods dynamically based on class and method names then the Reflection API is your friend. But this has nothing to do with distributed Java.

Marco
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I have class name,method name,input parameter datatypes as Strings.How to invoke the desired method?