Java API for Concurrency
CONCURRENCY 1.0 - 1.0
JavaDoc Assertion Detail

TotalsTotalActiveDeprecatedRemoved
# of Assertions 474700
# of Required Assertions 474700
# of Optional Assertions 0000

IDReturnMethod/FieldDescriptionRequiredDeprecatedTestable
CONCURRENCY:JAVADOC:1AbortedExceptionjavax.enterprise.concurrent.AbortedException.AbortedException
Constructs an AbortedException with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable#initCause(java.lang.Throwable). true
true
CONCURRENCY:JAVADOC:2AbortedExceptionjavax.enterprise.concurrent.AbortedException.AbortedException
( String ,
Throwable )
Constructs an AbortedException exception with the specified detail message and cause. Note that the detail message associated with cause is not automatically incorporated in this exception's detail message. true
true
CONCURRENCY:JAVADOC:3AbortedExceptionjavax.enterprise.concurrent.AbortedException.AbortedException
( String )
Constructs an AbortedException exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable#initCause(java.lang.Throwable). true
true
CONCURRENCY:JAVADOC:4AbortedExceptionjavax.enterprise.concurrent.AbortedException.AbortedException
( Throwable )
Constructs an AbortedException exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). true
true
CONCURRENCY:JAVADOC:5Objectjavax.enterprise.concurrent.ContextService.createContextualProxy
( Object ,
Class )
Creates a new contextual object proxy for the input object instance. Each method invocation will have the context of the application component instance that created the contextual object proxy. The contextual object is useful when developing or using Java SE threading mechanisms propagating events to other component instances or communicating with component instances on different Java processes. If the application component that created the proxy is not started or deployed, all methods on reflected interfaces will throw a java.lang.IllegalStateException. For example, to execute a Runnable which is contextualized with the creator's context using a Java SE ExecutorService: public class MyRunnable implements Runnable { public void run() { System.out.println("MyRunnable.run with Java EE Context available."); } } InitialContext ctx = new InitialContext(); ThreadFactory threadFactory = (ThreadFactory) ctx .lookup("java:comp/env/concurrent/ThreadFactory"); ContextService ctxService = (ContextService) ctx .lookup("java:comp/env/concurrent/ContextService"); MyRunnable myRunnableInstance = ...; Runnable rProxy = ctxService.createContextualProxy(myRunnableInstance, Runnable.class); ExecutorService exSvc = Executors.newThreadPool(10, threadFactory); Future f = exSvc.submit(rProxy); true
true
CONCURRENCY:JAVADOC:6Objectjavax.enterprise.concurrent.ContextService.createContextualProxy
( Object ,
Class )
throws IllegalArgumentException
- if the intf argument is null, the instance does not implement the specified interface, or there is not an accessible default constructor.true
true
CONCURRENCY:JAVADOC:7Objectjavax.enterprise.concurrent.ContextService.createContextualProxy
( Object ,
Class[] )
Creates a new contextual object proxy for the input object instance. This method is similar to T createContextualProxy(T instance, Class intf) except that this method can be used if the proxy has to support multiple interfaces. Example: public class MyRunnableWork implements Runnable, SomeWorkInterface { public void run() { System.out.println("MyRunnableWork.run with Java EE Context available."); } public void someWorkInterfaceMethod() { ... } } ThreadFactory threadFactory = ...; ContextService ctxService = ...; MyRunnableWork myRunnableWorkInstance = ...; Object proxy = ctxService.createContextualProxy(myRunnableWorkInstance, Runnable.class, SomeWorkInterface.class); // call SomeWorkInterface method on the proxy ((SomeWorkInterface) proxy).someWorkInterfaceMethod(); ExecutorService exSvc = Executors.newThreadPool(10, threadFactory); // submit the proxy as a Runnable to the ExecutorService Future f = exSvc.submit( (Runnable)proxy); true
true
CONCURRENCY:JAVADOC:8Objectjavax.enterprise.concurrent.ContextService.createContextualProxy
( Object ,
Class[] )
throws IllegalArgumentException
- if the interfaces argument is null, the instance does not implement all the specified interfaces, or there is not an accessible default constructor.true
true
CONCURRENCY:JAVADOC:9Objectjavax.enterprise.concurrent.ContextService.createContextualProxy
( Object ,
Map ,
Class )
Creates a new contextual object proxy for the input object instance. The contextual object is useful when developing or using Java SE threading mechanisms propagating events to other component instances or communicating with component instances on different Java processes. If the application component that created the proxy is not started or deployed, all methods on reflected interfaces will throw a java.lang.IllegalStateException. This method accepts a Map object which allows the contextual object creator to define what contexts or behaviors to capture when creating the contextual object. The specified properties will remain with the contextual object. For example, to call a Message Driven Bean (MDB) with the sender's context, but within the MDB's transaction: public class MyServlet ... { public void doPost() throws NamingException, JMSException { InitialContext ctx = new InitialContext(); // Get the ContextService that only propagates // security context. ContextService ctxSvc = (ContextService) ctx.lookup("java:comp/env/SecurityContext"); // Set any custom context data through execution properties Map execProps = new HashMap(); execProps.put("vendor_a.security.tokenexpiration", "15000"); // Specify that contextual object should run inside the current // transaction. If we have a failure, we don't want to consume // the message. execProps.put(ManagedTask.TRANSACTION, "USE_TRANSACTION_OF_EXECUTION_THREAD"); ProcessMessage msgProcessor = ctxSvc.createContextualProxy(new MessageProcessor(), execProps, ProcessMessage.class); ConnectionFactory cf = (ConnectionFactory) ctx.lookup("java:comp/env/MyTopicConnectionFactory"); Destination dest = (Destination) ctx.lookup("java:comp/env/MyTopic"); Connection con = cf.createConnection(); Session session = con.createSession(true, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = session.createProducer(dest); Message msg = session.createObjectMessage((Serializable)msgProcessor); producer.send(dest, msg); ... } public class MyMDB ... { public void onMessage(Message msg) { // Get the ProcessMessage contextual object from the message. ObjectMessage omsg = (ObjectMessage)msg; ProcessMessage msgProcessor = (ProcessMessage)omsg.getObject(); // Process the message in the specified context. msgProcessor.processMessage(msg); } } public interface ProcessMessage { public void processMessage(Message msg); } public class MessageProcessor implements ProcessMessage, Serializable { public void processMessage(Message msg) { // Process the message with the application container // context that sent the message. } } true
true
CONCURRENCY:JAVADOC:10Objectjavax.enterprise.concurrent.ContextService.createContextualProxy
( Object ,
Map ,
Class )
throws IllegalArgumentException
- if the intf argument null, the instance does not implement the specified interface, or there is not an accessible default constructor.true
true
CONCURRENCY:JAVADOC:11Objectjavax.enterprise.concurrent.ContextService.createContextualProxy
( Object ,
Map ,
Class[] )
Creates a new contextual object proxy for the input object instance. This method is similar to T createContextualProxy(T instance, Map executionProperties, Class intf) except that this method can be used if the proxy has to support multiple interfaces. true
true
CONCURRENCY:JAVADOC:12Objectjavax.enterprise.concurrent.ContextService.createContextualProxy
( Object ,
Map ,
Class[] )
throws IllegalArgumentException
- if the interfaces argument is null, the instance does not implement all the specified interfaces, or there is not an accessible default constructor.true
true
CONCURRENCY:JAVADOC:13Mapjavax.enterprise.concurrent.ContextService.getExecutionProperties
( Object )
Gets the current execution properties on the context proxy instance. true
true
CONCURRENCY:JAVADOC:14Mapjavax.enterprise.concurrent.ContextService.getExecutionProperties
( Object )
throws IllegalArgumentException
thrown if the input contextualProxy is not a valid contextual object proxy created with the createContextualProxy method.true
true
CONCURRENCY:JAVADOC:15Stringjavax.enterprise.concurrent.LastExecution.getIdentityName
The name or ID of the identifiable object, as specified in the ManagedTask#IDENTITY_NAME execution property of the task if it also implements the ManagedTask interface. true
true
CONCURRENCY:JAVADOC:16Objectjavax.enterprise.concurrent.LastExecution.getResult
Result of the last execution. true
true
CONCURRENCY:JAVADOC:17Datejavax.enterprise.concurrent.LastExecution.getRunEnd
The last time in which the task was completed. true
true
CONCURRENCY:JAVADOC:18Datejavax.enterprise.concurrent.LastExecution.getRunStart
The last time in which the task started running. true
true
CONCURRENCY:JAVADOC:19Datejavax.enterprise.concurrent.LastExecution.getScheduledStart
The last time in which task was scheduled to run. true
true
CONCURRENCY:JAVADOC:20booleanjavax.enterprise.concurrent.ManageableThread.isShutdown
This method is used by the application component provider to check whether a thread created by the newThread method of ManagedThreadFactory has been marked for shut down. If the value is true, the application component provider should finish any work on this thread as soon as possible. true
true
CONCURRENCY:JAVADOC:21booleanjavax.enterprise.concurrent.ManagedExecutors.isCurrentThreadShutdown
Utility method for checking the isShutdown() value of the current thread if it is a ManageableThread created from ManagedThreadFactory#newThread(java.lang.Runnable) ManagedThreadFactory.newThread() . true
true
CONCURRENCY:JAVADOC:22Runnablejavax.enterprise.concurrent.ManagedExecutors.managedTask
( Runnable ,
ManagedTaskListener )
Returns a Runnable object that also implements ManagedTask interface so it can receive notification of lifecycle events with the provided ManagedTaskListener when the task is submitted to a ManagedExecutorService or a ManagedScheduledExecutorService. Example: Runnable task = ...; ManagedTaskListener myTaskListener = ...; ManagedExecutorService executor = ...; Runnable taskWithListener = ManagedExecutors.managedTask(task, myTaskListener); executor.submit(taskWithListener); true
true
CONCURRENCY:JAVADOC:23Runnablejavax.enterprise.concurrent.ManagedExecutors.managedTask
( Runnable ,
ManagedTaskListener )
throws IllegalArgumentException
if task is nulltrue
true
CONCURRENCY:JAVADOC:24Runnablejavax.enterprise.concurrent.ManagedExecutors.managedTask
( Runnable ,
Map ,
ManagedTaskListener )
Returns a Runnable object that also implements ManagedTask interface so it can receive notification of lifecycle events with the provided ManagedTaskListener and to provide additional execution properties when the task is submitted to a ManagedExecutorService or a ManagedScheduledExecutorService. true
true
CONCURRENCY:JAVADOC:25Runnablejavax.enterprise.concurrent.ManagedExecutors.managedTask
( Runnable ,
Map ,
ManagedTaskListener )
throws IllegalArgumentException
if task is nulltrue
true
CONCURRENCY:JAVADOC:26Callablejavax.enterprise.concurrent.ManagedExecutors.managedTask
( Callable ,
ManagedTaskListener )
Returns a Callable object that also implements ManagedTask interface so it can receive notification of lifecycle events with the provided ManagedTaskListener when the task is submitted to a ManagedExecutorService or a ManagedScheduledExecutorService. true
true
CONCURRENCY:JAVADOC:27Callablejavax.enterprise.concurrent.ManagedExecutors.managedTask
( Callable ,
ManagedTaskListener )
throws IllegalArgumentException
if task is nulltrue
true
CONCURRENCY:JAVADOC:28Callablejavax.enterprise.concurrent.ManagedExecutors.managedTask
( Callable ,
Map ,
ManagedTaskListener )
Returns a Callable object that also implements ManagedTask interface so it can receive notification of lifecycle events with the provided ManagedTaskListener and to provide additional execution properties when the task is submitted to a ManagedExecutorService or a ManagedScheduledExecutorService. true
true
CONCURRENCY:JAVADOC:29Callablejavax.enterprise.concurrent.ManagedExecutors.managedTask
( Callable ,
Map ,
ManagedTaskListener )
throws IllegalArgumentException
if task is nulltrue
true
CONCURRENCY:JAVADOC:30ScheduledFuturejavax.enterprise.concurrent.ManagedScheduledExecutorService.schedule
( Runnable ,
Trigger )
Creates and executes a task based on a Trigger. The Trigger determines when the task should run and how often. true
true
CONCURRENCY:JAVADOC:31ScheduledFuturejavax.enterprise.concurrent.ManagedScheduledExecutorService.schedule
( Runnable ,
Trigger )
throws RejectedExecutionException
if task cannot be scheduled for execution.true
true
CONCURRENCY:JAVADOC:32ScheduledFuturejavax.enterprise.concurrent.ManagedScheduledExecutorService.schedule
( Runnable ,
Trigger )
throws NullPointerException
if command is null.true
true
CONCURRENCY:JAVADOC:33ScheduledFuturejavax.enterprise.concurrent.ManagedScheduledExecutorService.schedule
( Callable ,
Trigger )
Creates and executes a task based on a Trigger. The Trigger determines when the task should run and how often. true
true
CONCURRENCY:JAVADOC:34ScheduledFuturejavax.enterprise.concurrent.ManagedScheduledExecutorService.schedule
( Callable ,
Trigger )
throws RejectedExecutionException
if task cannot be scheduled for execution.true
true
CONCURRENCY:JAVADOC:35ScheduledFuturejavax.enterprise.concurrent.ManagedScheduledExecutorService.schedule
( Callable ,
Trigger )
throws NullPointerException
if callable is null.true
true
CONCURRENCY:JAVADOC:36Mapjavax.enterprise.concurrent.ManagedTask.getExecutionProperties
Provides additional information to the ManagedExecutorService or ManagedScheduledExecutorService when executing this task. Some standard property keys are defined in this class. Custom property keys may be defined but must not begin with "javax.enterprise.concurrent.". true
true
CONCURRENCY:JAVADOC:37ManagedTaskListenerjavax.enterprise.concurrent.ManagedTask.getManagedTaskListener
The ManagedTaskListener to receive notification of lifecycle events of this task. true
true
CONCURRENCY:JAVADOC:38voidjavax.enterprise.concurrent.ManagedTaskListener.taskAborted
( Future ,
ManagedExecutorService ,
Object ,
Throwable )
Called when a task's Future has been cancelled anytime during the life of a task. This method may be called after taskDone(). The Future#isCancelled() method returns false if the task was aborted through another means other than Future#cancel(boolean) . The exception argument will represent the cause of the cancellation: java.util.concurrent.CancellationException if the task was cancelled, SkippedException if the task was skipped or AbortedException if the task failed to start for another reason. The AbortedException.getCause() method will return the exception that caused the task to fail to start. true
true
CONCURRENCY:JAVADOC:39voidjavax.enterprise.concurrent.ManagedTaskListener.taskDone
( Future ,
ManagedExecutorService ,
Object ,
Throwable )
Called when a submitted task has completed running, either successfully or failed due to any exception thrown from the task, task being cancelled, rejected, or aborted. true
true
CONCURRENCY:JAVADOC:40voidjavax.enterprise.concurrent.ManagedTaskListener.taskStarting
( Future ,
ManagedExecutorService ,
Object )
This method is called before the task is about to start. The task will not enter the starting state until the taskSubmitted listener has completed. This method may be called from the same thread that the task was submitted with. true
true
CONCURRENCY:JAVADOC:41voidjavax.enterprise.concurrent.ManagedTaskListener.taskSubmitted
( Future ,
ManagedExecutorService ,
Object )
Called after the task has been submitted to the Executor. The task will not enter the starting state until the taskSubmitted listener has completed. This method may be called from the same thread that the task was submitted with. This event does not indicate that the task has been scheduled for execution. true
true
CONCURRENCY:JAVADOC:42SkippedExceptionjavax.enterprise.concurrent.SkippedException.SkippedException
Constructs an SkippedException with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable#initCause(java.lang.Throwable). true
true
CONCURRENCY:JAVADOC:43SkippedExceptionjavax.enterprise.concurrent.SkippedException.SkippedException
( String )
Constructs an SkippedException exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable#initCause(java.lang.Throwable). true
true
CONCURRENCY:JAVADOC:44SkippedExceptionjavax.enterprise.concurrent.SkippedException.SkippedException
( String ,
Throwable )
Constructs an SkippedException exception with the specified detail message and cause. Note that the detail message associated with cause is not automatically incorporated in this exception's detail message. true
true
CONCURRENCY:JAVADOC:45SkippedExceptionjavax.enterprise.concurrent.SkippedException.SkippedException
( Throwable )
Constructs an SkippedException exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). true
true
CONCURRENCY:JAVADOC:46Datejavax.enterprise.concurrent.Trigger.getNextRunTime
( LastExecution ,
Date )
Retrieve the next time that the task should run after. true
true
CONCURRENCY:JAVADOC:47booleanjavax.enterprise.concurrent.Trigger.skipRun
( LastExecution ,
Date )
Return true if this run instance should be skipped. This is useful if the task shouldn't run because it is late or if the task is paused or suspended. Once this task is skipped, the state of it's Future's result will throw a SkippedException. Unchecked exceptions will be wrapped in a SkippedException. true
true