users@concurrency-ee-spec.java.net

[jsr236-spec users] [jsr236-experts] Feedback requested on proposed changes

From: Anthony Lai <anthony.lai_at_oracle.com>
Date: Fri, 22 Jun 2012 16:19:40 -0700

Dear experts,

Fred has suggested the following changes. They are in the annotations
that he added to the PDF file that he sent out, and I forwarded to the
list on his behalf, a few days back. I am sending this out in case
anyone has missed it. (Fred - I hope I didn't miss anything.)

1. The following contextual invocation points listed section 2.3.1
should be made optional
ManagedTaskListener
- taskAborted()
- taskSubmitted()
- taskStarting()
Trigger
- getNextRunTime()
- skipRun()
We should make all of these optional as contextual invocation points. It
seems inefficient to be propagating context to all of these by default,
which I suspect in a lot of cases won't be used. Let the
ManagedExecutorService/ManagedScheduledExecutorService provide its own
config options to control this as an optional behavior.

2. Remove component-managed from the spec
We should remove component-managed from the spec, because this function
is duplicate of what a user would get by supplying a
ManagedThreadFactory to a Java SE executor service.

Regarding the sentence "If the threads are pooled, the overhead of
reusing a thread disappears since the context does not have to change
the thread’s context." - This statement isn't entirely accurate. Think
of security context, where different users are running the same
component. It would be an error to keep reusing the context of user1 on
pooled threads for user2 and user3 who are also using the component. The
the security context will be all wrong. This is another reason why we
want to get rid of Component-Managed Executor. If we instead let it be
the component's responsibility to get this behavior by supplying a
ManagedThreadFactory to a Java SE executor service, then it will be
clear to the component exactly what they're doing.


3. Distributable ManagedExeutorService should be optional
([Anthony] I think it is implied in section 3.1.3.1.1 where only "Local"
is required but we should make it more obvious)

4. Remove the following requirements from section 3.5.1
" - Tasks submitted to the master executor are owned by the executor
instance. If the master executor becomes unavailable, the submitted
tasks are cancelled.
- All tasks are not considered to be idempotent. If a slave executor
becomes unavailable, all Futures for the tasks submitted to that
executor that have not yet started will be cancelled.
- If a slave executor becomes unavailable, and the task has started, the
result of the task’s Future will throw a
javax.enterprise.concurrent.ExecutorNotAvailableException exception. "

The Distributed ManagedExecutorService/ManagedScheduledExecutorService
should be free to submit to a different "slave" or to run the task itself.

5. Section 4 Managed Object should be optional

Comments are welcome.

Regards
Anthony