aspose file tools*
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: 1278

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: 39548
    
  27
So this all happens within the same JVM? As Marco said, "distributed" usually implies that more than one JVM is involved.


Ping & DNS - updated with new look and Ping home screen widget
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1278

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I have class name,method name,input parameter datatypes as Strings.How to invoke the desired method?
 
Similar Threads
How to reference an Object in main from a called method
Trying to draw Polygon to no avail
get DB information parameters
A Question about Java Maps
converting the json to bean exception