I need to find a way of communication between java and python program. My application is Java, and another application ( python) will request me some data and trigger some process in my Java Application.
EDITED: My application is Java desktop application, that uses Jboss Application server.
For first release, I do not have enough time to make a comprehensive way of communication. So I am planing to use subprocess.Popen for first release. I will provide them a jar. Then they can call me from pyhton.
Actually I was planned to make a single class that takes some arguments on main. Then according to parameters, my application can determine to call related function. But there is a problem here. When they want to call my functions in following way. in each call, a new java process will be created and I can not keep some static variables from my application. Actually What I need is to run my application once, then access some functions from existing process.
#!/usr/bin/env python
from subprocess import Popen, PIPE
p = Popen(['java', '-jar', 'myjarfile.jar'], stdin=PIPE, stdout=PIPE)
Do you think Can I implement this using subprocess.Popen. If not can you show me an easy way ?