wood burning stoves 2.0*
The moose likes Java in General and the fly likes Calling Java Methods in a windows java service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Calling Java Methods in a windows java service" Watch "Calling Java Methods in a windows java service" New topic
Author

Calling Java Methods in a windows java service

Davie Lang
Greenhorn

Joined: Feb 06, 2004
Posts: 6
I want to be able to allow a C programme to interface with my Java Service.

I know I can use the JNI to allow the C programme to talk to Java, but how can I get the C programme to talk to Java if it is running as a windows java service?

Thanks in advance for any advice.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
This sounds like a job for socket communication. Your Java program can establish a java.net.ServerSocket and listen for requests from the C program. Once a connection is established, start a Thread to accept the data from the C program, process it and return the result.
I believe we have a whole forum here for socket related programming.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling Java Methods in a windows java service