Assembling applications that use concurrency

Resource environment references to managed executors, thread factories, and context services must be bound to a physical work manager by using an assembly tool.

Before you begin

Optionally, your administrator can configure at least one work manager or adjust the settings of the default work manager by using the administrative console.

About this task

If your 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 by 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 that is 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. The product run time returns the correct interface for each resource-env-reference or resource-reference lookup.

Procedure

  1. 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.

  2. 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.

  3. Use an assembly tool to bind each resource environment reference and resource reference to a physical work manager.

指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:21
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tasb_assemble
檔名:tasb_assemble.html