|
-
May 29th, 2011, 05:17 AM
#1
how can i access java deamon public method and get info from java client ?
i have java daemon , that holds info . it is always working . ( its my code i can kill it and change it ) .
now i like to be able to get and set parameters while this daemon is running with separate java process , they both in the same machine and i have access to the daemon jar's .
is it possible ?
do i use reflation
-
May 29th, 2011, 05:35 AM
#2
Re: how can i access java deamon public method and get info from java client ?
 Originally Posted by umen
...
do i use reflation
Reflation? - stimulating the economy by increasing the money supply or reducing taxes? I don't think that would work...
The simplest, most robust way is probably to have your daemon monitor a parameter file, and when it changes, to reload the parameters from the file. You can use the Watch Service API to get notified when a file has changed in the filesystem.
It is better to have an approximate answer to the right question than an exact answer to the wrong one...
J. Tukey
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
May 29th, 2011, 05:57 AM
#3
Re: how can i access java deamon public method and get info from java client ?
can i do it via jvm ? like c++ to java ?
-
May 29th, 2011, 07:46 AM
#4
Re: how can i access java deamon public method and get info from java client ?
Another possibility would be to use a Socket. Connect and pass the info.
Norm
-
May 29th, 2011, 06:17 PM
#5
Re: how can i access java deamon public method and get info from java client ?
 Originally Posted by umen
can i do it via jvm ? like c++ to java ?
Whut? The Watch Service API is part of Java, and Java runs in the JVM... what has C++ to Java got to do with anything?
Furious activity is no substitute for understanding...
H. H. Williams
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
May 30th, 2011, 03:56 AM
#6
Re: how can i access java deamon public method and get info from java client ?
Or you could RMI to get and set the parameters.
But, if you just need to set the values then dlorde's solution is probably the easiest to implement.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|