Is there a JDK 5 or older API for reading files and or reading streams with a timeout? Also, this API must be safe when wrapped inside an MDB. FYI: I have already looked into using the FutureResult, TimedCallable classes and the like; I have come to the conclusion that using these within in MDB is not advisable since 1. these are not JDK native classes, and 2. threads are spawned inside the MDB; so I need another solution.
Also I would believe that any solution would require threading since there must be a thread that reads and one that manages the the timeliness of the read thread and blocks it if necessary. Therefore, would such a behavior be illegal inside an MDB? What if said API is native to the JDK will this make it safe to implement?