Hi Kardigen,
Ok, this is embarrassing There is currently no exposed API in the JCA connector to deal with this.
However, one thing you could do is to set an
expiration timeout on the job's client-side SLA. For instance:
JPPFJob job = newJPPFJob();
// set the job to expire in the client if it is not finished after 60 seconds
job.getClientSLA().setJobExpirationSchedule(new JPPFSchedule(60_000L));If this is not sufficient for your needs, and you need to know the state of the client prior to sending jobs, then the only convenient way I see is to expose the JPPFClient handled by the JCA connector. This means it should be exposed in the
JPPFConnection interface. I have two main concerns with that:
- if the JPPFClient is exposed, then all other methods in JPPFConnection become irrelevant. That's not a problem to me, it would dramatically simplify the JCA connector code and make JCA and standard client code that much closer, and it would also provide full access to the JPPF client APIs.
- I'm hesitant to change the JPPFConnection interface in a maintenance release, because I'm afraid it will break compatibility with prior maintenance releases. However, I believe it should be no issue if the getJPPFClient() method is instead only added to the implementation class JPPFConnectionImpl. You can then access it with an explicit cast like this:
JPPFConnection connection = ...;
JPPFClient client = ((JPPFConnectionImpl) connection).getJPPFClient();The getJPPFClient() method would of course be added to the interface in the upcoming 5.2 version.
If this approach is OK with you, here's the plan proposal:
- create an enhancement request for the change
- pre-5.2 versions: add getJPPFClient() to JPPFConnectionImpl only
- version 5.2: add getJPPFClient() to both JPPFConnection and JPPFConnectionImpl and deprecate all other methods
- version 6.0: keep getJPPFClient() and remove other (deprecated) methods
Also, given that my bandwidth is limited, I'd rather not have to deliver a new maintenance release for the 5.0 branch. Would you consider upgrading to 5.1? If not, then I can deliver an official patch for JPPF 5.0.5 that would include the enhancement, that's still much less work than a maintenance release. For the 5.1 branch, it will be part of the upcoming 5.1.4 maintenance release.
What do you think?
Thanks,
-Laurent