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
Re: how can i access java deamon public method and get info from java client ?
Quote:
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
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 ?
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.
Re: how can i access java deamon public method and get info from java client ?
Quote:
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
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.