Using WorkManagers in your applications

If you do not explicitly assign a Work Manager to an application, it will use the default Weblogic Work Manager. A module can be assigned to your custom Work Manager by using the <dispatch-policy> element in the deployment descriptor. As an alternative, you can define new Work Managers in your deployment descriptors through the <work-manager> element and associate as well constraints to them. Let’s see how to apply both approaches for all supported descriptors (weblogic.xml, weblogic-ejb-jar.xml, weblogic-application.xml):

Applying a Work Manager in your Web applications (weblogic.xml)

If you want to apply your Work Manager policies in your Web applications, you can reference it through the wl-dispatch-policy element in the weblogic.xml file. In the following example, we are using the ExampleWM (that we have formerly created through the Web console):

<weblogic-web-app xmlns="">



Web applications can even reference a Work Manager at more granular level, such as at Servlet level, by setting the parameter wl-dispatch-policy as init parameter of your servlet. In the following example, we are associating the ExampleWM Work Manager with Servlet “WorkServlet”:











Applying a Work Manager in your EJBs (weblogic-ejb-jar.xml)

Work Manager can be as well bound to a specific EJB application by mentioning it into the dispatch-policy element of the weblogic-ejb.jar.xml. In the following example, we are binding the ExampleWM to our WorkEJB:








Applying a Work Manager in your application (weblogic-application.xml)

If you want to define a Work Manager and use it across all modules contained in EAR, then you can define it into the WLS Enterprise application descriptor named weblogic-application.xml file. In the following example, we are defining a Work Manager named JEEScopedWorkManager with Min and Max constraints:




Are we living in a simulated reality? Check it here!
Francesco Google+