Assemble applications that use concurrency
Resource environment references to managed executors, thread factories, and context services must be bound to a physical work manager using an assembly tool.
Optionally, your administrator can configure at least one work manager or adjust the settings of the default work manager using the administrative console.
If the application references one or more logical managed executors, thread factories, context services, or work managers, they must be bound to one or more physical work managers using an assembly tool.
The Asynchronous Beans and CommonJ 1.1 interfaces are deprecated. Concurrency Utilities for Java EE, asynchronous beans, and CommonJ interfaces can use one configuration work manager object. The type of interface implemented is resolved during the JNDI lookup time. The type of interface used is determined by the one specified in the resource-env-reference or resource-reference, instead of the one specified in the configuration object. Each resource-env-reference or resource-reference lookup returns the appropriate type of instance. For example, wm/MyWorkManager has two resource-references defined: concurrent/MyExecutor and wm/CommonJWorkMgr. WAS v9 run time returns the correct interface for each resource-env-reference or resource-reference lookup.
Tasks
- Declare a resource environment reference for each managed executor, thread factory, and context service.
The application developer must complete this step.
Add resource environment references with any of the following types to a deployment descriptor within the application, or use the @Resource annotation to define the references.
- javax.enterprise.concurrent.ContextService
- javax.enterprise.concurrent.ManagedExecutorService
- javax.enterprise.concurrent.ManagedScheduledExecutorService
- javax.enterprise.concurrent.ManagedThreadFactory
- java.util.concurrent.ExecutorService
- java.util.concurrent.ScheduledExecutorService
- java.util.concurrent.ThreadFactory
The application then can look up the resource environment reference name in java:comp. For more information about resource environment references, see the References topic.
- Declare a resource reference for each work manager.
The application developer must complete this step.
Add resource references with any of the following types to a deployment descriptor within the application, or use the @Resource annotation to define the references.
- com.ibm.websphere.asynchbeans.WorkManager
- commonj.work.WorkManager
The application then can look up the resource reference name in java:comp. For more information about resource references, see the References topic.
- Use an assembly tool to bind each resource environment reference and resource reference to a physical work manager.
Related:
References in application deployment descriptor files Development and assembly tools