Theoretically, the JCA will indeed be a specialized API to use for this.
If the application is an EAR and the EJB classes live in a pure EJB module, there are quite certain restrictions on what EJBs are allowed to do. JCA can do exactly those things that EJB does not allow to do (reflection, static fields, create threads, load own libraries, etc.).
The downside is that the JCA is a "thoroughly" documented API that is more intended to be used by vendors of the legacy systems you describe than the "regular" application programmers. If you want to follow the JCA path, one of the sources of information is perhaps the Quartz source code, which contains the incoming JCA resource adapter for Quartz .
Registering Singleton directly as a listener must be done carefully. The inherited library should receive a reference to the Singleton proxy class, and not to the actual implementation (i.e., Do not pass this
to an obsolete library).
Another option would be to provide a regular class that implements the required interface and registers with an inherited library. After receiving the notification, he can find the factory and Queue JMS connection from the JNDI, and then sends a JMS message that is listening to the Message Driven Bean.
source share