Hello,
Unfortunately, you can only use the JPPF distributed class loader from within a node.
However, I believe it is still possible to accomplish what you need, by submitting a task that wraps the process to monitor (calling its main() method), from the task that does the monitoring - that means submitting a job from a task executing in a node.
The idea is to start a slave node exclusively for this task, using the
provisioning facilty and then submit the task with a job execution policy to ensure it can only execute in that node.
Basically, the flow is as follows:
- this client appilcation submits a MonitorTask to the JPPF client
- the MonitorTask starts a slave node using the provisioning faciltiy, with all appropriate JVM options
- it also starts a new thread which performs the monitoring
- it then submits a task wrapping the process to monitor and ensures that it can only execute on the slave node
- when the task is completed it stops the monitoring thread and returns the result back to the client application
I implemented a small sample which does what is described above and attached it to this post for your convenience. I hope the code and comments are sufficiently clear. If not, please do not hesitate to get back to us.
Sincerely,
-Laurent