| Java EE 7 SDK | 
This sample demonstrates how to use javax.enterprise.concurrent.ManagedExecutorService for submitting tasks.
The demo contains a collection of servlets that show how to use methods from the ManagedExecutorService
   interface to submit tasks to be processed asynchronously.
   All the sample servlets in this demo use the
   default ManagedExecutorService as defined in the Concurrency Utilities for Java EE 1.0 specification which is
   available in all compliant Java EE Products. Thus no special configuration is required.
The following is a list of servlets included in this demo:
| URI pattern | Description | 
|---|---|
| /TestResourceServlet | Submit tasks using a ManagedExecutorServiceretrieved using@Resourcein a servlet, using theexecute()andsubmit()methods. | 
| /TestJNDIServlet | Submit tasks using a ManagedExecutorServiceretrieved using JNDI 
		lookup in a servlet, using theexecute()andsubmit()methods. | 
| /TestEJBServlet | Submit tasks using a ManagedExecutorServicein an EJB session bean, 
		using thesumbit()method. | 
| /TestInvokeAllServlet | Submit a collection of tasks using the invokeAll()method inManagedExecutorService, and wait for all tasks to complete. | 
| /TestInvokeAnyServlet | Submit a collection of tasks using the invokeAny()method inManagedExecutorService, and wait for the first task to complete. | 
| /TestListenerServlet | Submit a ManagedTaskwith aManagedTaskListenerto 
		receive task lifecycle callbacks. | 
| /TestTransactionServlet | Submit tasks that make use of javax.transaction.UserTransaction. | 
The application is built and deployed as a WAR file.
ManagedExecutorService from servlets and EJBssubmit(), execute(), invokeAll(), 
	    invokeAny() methods in ManagedExecutorServiceManagedTaskListener to receive task lifecycle notificationsjavax.transaction.UserTransaction from a taskPerform the following steps to build, deploy, and run the application:
samples_install_dir is the sample application base directory. Go to: samples_install_dir/javaee7/concurrency/executor.
    run outcome.
        mvn clean verify cargo:run
http://localhost:8080/executorclean outcome to undeploy the sample application and to remove the temporary directories such as
        build and dist.
        mvn clean
If you have problems when running the application, refer to the troubleshooting document.
Copyright © 1997-2013 Oracle and/or its affiliates. All rights reserved.