- Supervisord4j * =====================
This is a simple java client for Supervisor’s XML-RPC API. There are many third-party client which you can find by visiting: Third Party Applications and Libraries But no java was found. the client was simple enough, it is depend on no other jars. So you can import into you project easily.
the following method has been implemented and tested.
- getSupervisorVersion
- getIdentification
- getState
- getPID
- readLog
- clearLog
- shutdown
- restart
- listMethods
- methodHelp
- methodSignature(not tested)
multicall
- getProcessInfo
- getAllProcessInfo
- startAllProcesses
- startProcessGroup (not tested)
- stopProcess
- stopProcessGroup(not tested)
- stopAllProcesses
- signalProcess(not tested)
- signalProcessGroup(not tested)
- signalAllProcesses(not tested)
- sendProcessStdin(not tested)
- sendRemoteCommEvent(not tested)
reloadConfig(not impl)addProcessGroupremoveProcessGroupreadProcessStdoutLogreadProcessStderrLogtailProcessStdoutLogtailProcessStderrLogclearProcessLogsclearAllProcessLogs
the method should be enough for common use, if u want more . u can pull requests.
#Usage
- Enable/Uncomment inet_http_server (found in supervisord.conf) for all your supervisord servers.
[inet_http_server]
port=*:9001
username="yourusername"
password="yourpass"
If not visited by the same server , maybe you should config the iptables
- The Java Sample Code
Supervisord supervisord = Supervisord
//API ADDR,Default:http://localhost:9001/RPC2
.connect(api)
// USERNAME AND PASSWORD
.auth(userName, password)
// the Identification, U shoud find it in "supervisord.conf" default supervisor
.namespace("supervisor")
.proxy("HOST","PORT") //IF NEED
;
Happy supervisord.
- gturri - the XML RPC call was based on his job.
- Android Open Source Project - the base64 tools was import from his.