CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006
    Posts
    230

    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

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: how can i access java deamon public method and get info from java client ?

    Quote Originally Posted by umen View Post
    ...
    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.

  3. #3
    Join Date
    Aug 2006
    Posts
    230

    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 ?

  4. #4
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    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

  5. #5
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: how can i access java deamon public method and get info from java client ?

    Quote Originally Posted by umen View Post
    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.

  6. #6
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    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 code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured