Balaram26
Balaram26

Reputation: 1389

How to create windows service from jar file and how to call it from another jar file?

I have a jar file(primary jar) built for specific purpose. It gets data as input and stores output as certain format files. I have a another java app (secondary jar)built for secondary analysis with a user interface. Secondary jar uses primary jar for certain analysis.

Currently: The primary jar is initiated when secondary jar is started and stopped when secondary jar is closed. But i want to create primary jar as a service,so that it runs all the time and secondary jar just submits jobs to the primary jar service.

Issue: I have searched and found ways to wrap jar file into windows services. But how to communicate with a running service from secondary jar app,sending data to it?

Upvotes: 0

Views: 547

Answers (2)

bb67
bb67

Reputation: 160

you can use JavaExe : it manages automatically those two processes (Service part and UI part) and their communication

Upvotes: 0

devsprint
devsprint

Reputation: 671

There are few ways to communicate between java processes:

  • old style RMI
  • Socket
  • shared file
  • shared db

There are many ways, but you have to choose the one that is most appropriate for your problem.

Upvotes: 1

Related Questions