First, you will find the CommonJ documentation, an implementation of the Timer and Work Manager APIs developed by BEA Oracle and IBM, in the Timer Programmer's Guide and Work Manager API (CommonJ) . They provide an example of a work manager, but are not inserted into this document.
1) What exactly, if anything, do I need to add to deployment descriptors (ejb-jar.xml and friends)?
In the Deployment section of the job manager :
Work managers are defined at the server level through the resource-ref to the appropriate deployment descriptor. It could be web.xml or ejb-jar.xml among others.
The following deployment descriptor fragment demonstrates how to configure a WorkManager :
... <resource-ref> <res-ref-name>wm/MyWorkManager</res-ref-name> <res-type>commonj.work.WorkManager</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> ...
Note. The recommended prefix for the JNDI namespace for WorkManager objects is java: comp / env / wm.
Read the WorkManager javadocs for more details (for example, "The res-auth and res-sharing areas are ignored in this version of the specification. The EJB or servlet can then use the WorkManager as it needs to.").
2) I would like to use the @Resource annotation to introduce the WorkManager into my EJB 3 bean session. What "name" do I use for the resource?
I would say something like this (not tested):
@ResourceRef(jndiName="java:comp/env/wm/MyWorkManager", auth=ResourceRef.Auth.CONTAINER, type="commonj.work.WorkManager", name="MyWorkManager")
3) How to configure the number of threads and other parameters for WorkManager.
See the description of <work-manager> and Using Work Managers to optimize planned work for detailed information about work managers.
I understand that the underlying implementation in WebLogic is CommonJ, but I would prefer to use a generic approach if possible.
I have no other suggestion (and, as long as this implementation complies with the standards, I would not mind using it).