Executor.Descriptive, Executor.Impl, Executor.LoggedWork<X>, Executor.Priority, Executor.SimpleSqlWork, Executor.SimpleWork<T>, Executor.SqlWork, Executor.StatefulWork, Executor.Work<X>
Modifier and Type | Field and Description |
---|---|
protected java.util.List<org.aopalliance.aop.Advice> |
advices |
protected ome.system.OmeroContext |
context |
protected SessionFactory |
factory |
protected InternalServiceFactory |
isf |
protected CurrentDetails |
principalHolder |
protected java.lang.String[] |
proxyNames |
protected ThreadPool |
service |
protected ome.util.SqlAction |
sqlAction |
protected java.util.concurrent.ExecutorService |
systemService |
Constructor and Description |
---|
Impl(CurrentDetails principalHolder,
SessionFactory factory,
ome.util.SqlAction sqlAction,
java.lang.String[] proxyNames) |
Impl(CurrentDetails principalHolder,
SessionFactory factory,
ome.util.SqlAction sqlAction,
java.lang.String[] proxyNames,
ThreadPool service) |
Modifier and Type | Method and Description |
---|---|
<T> T |
execute(java.util.Map<java.lang.String,java.lang.String> callContext,
ome.system.Principal p,
Executor.Work<T> work)
Executes a
Executor.Work instance wrapped in two layers of AOP. |
<T> T |
execute(ome.system.Principal p,
Executor.Work<T> work)
Call
Executor.execute(Map, Principal, Work)
with a null call context. |
java.lang.Object |
executeSql(Executor.SqlWork work)
Executes a
Executor.SqlWork in transaction. |
<T> T |
get(java.util.concurrent.Future<T> future)
Helper method to perform
Future.get() and properly unwrap the
exceptions. |
ome.system.OmeroContext |
getContext()
Provides access to the context for Work-API consumers who need to publish
events, etc.
|
java.util.concurrent.ExecutorService |
getService()
Returns the
ExecutorService assigned to this instance. |
ome.system.Principal |
principal()
Returns a
Principal representing your current session or null,
if none is active. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> callable)
Call
Executor.submit(Map, Callable) with a null callContext. |
<T> java.util.concurrent.Future<T> |
submit(Executor.Priority prio,
java.util.concurrent.Callable<T> callable)
Simple submission method with a
Executor.Priority . |
<T> java.util.concurrent.Future<T> |
submit(Executor.Priority prio,
java.util.Map<java.lang.String,java.lang.String> callContext,
java.util.concurrent.Callable<T> callable)
Like
Executor.submit(Map, Callable) but provide info to which priority
queue should be used. |
<T> java.util.concurrent.Future<T> |
submit(java.util.Map<java.lang.String,java.lang.String> callContext,
java.util.concurrent.Callable<T> callable)
Simple submission method which can be used in conjunction with a call to
Executor.execute(Principal, Work) to overcome the no-multiple-login rule. |
protected ome.system.OmeroContext context
protected InternalServiceFactory isf
protected final java.util.List<org.aopalliance.aop.Advice> advices
protected final CurrentDetails principalHolder
protected final java.lang.String[] proxyNames
protected final SessionFactory factory
protected final ome.util.SqlAction sqlAction
protected final ThreadPool service
protected final java.util.concurrent.ExecutorService systemService
public Impl(CurrentDetails principalHolder, SessionFactory factory, ome.util.SqlAction sqlAction, java.lang.String[] proxyNames)
public Impl(CurrentDetails principalHolder, SessionFactory factory, ome.util.SqlAction sqlAction, java.lang.String[] proxyNames, ThreadPool service)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public ome.system.OmeroContext getContext()
Executor
getContext
in interface Executor
public ome.system.Principal principal()
Executor
Principal
representing your current session or null,
if none is active.public <T> T execute(ome.system.Principal p, Executor.Work<T> work)
Executor.execute(Map, Principal, Work)
with a null call context.public <T> T execute(java.util.Map<java.lang.String,java.lang.String> callContext, ome.system.Principal p, Executor.Work<T> work)
Executor.Work
instance wrapped in two layers of AOP. The
first is intended to acquire the proper arguments for
Executor.Work.doWork(Session, ServiceFactory)
for
the OmeroContext
, and the second performs all the standard
service actions for any normal method call.
If the Principal
argument is not null, then additionally, a
login/logout sequence will be performed in a try/finally block.public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> callable)
Executor
Executor.submit(Map, Callable)
with a null callContext.public <T> java.util.concurrent.Future<T> submit(java.util.Map<java.lang.String,java.lang.String> callContext, java.util.concurrent.Callable<T> callable)
Executor
Executor.execute(Principal, Work)
to overcome the no-multiple-login rule.submit
in interface Executor
callContext
- Possibly null. See CurrentDetails.setContext(Map)
callable
- Not null. Action to be taken.public <T> java.util.concurrent.Future<T> submit(Executor.Priority prio, java.util.concurrent.Callable<T> callable)
Executor
Executor.Priority
.submit
in interface Executor
prio
- Possibly null. See Executor.submit(Priority, Map, Callable)
callable
- Not null. Action to be taken.public <T> java.util.concurrent.Future<T> submit(Executor.Priority prio, java.util.Map<java.lang.String,java.lang.String> callContext, java.util.concurrent.Callable<T> callable)
Executor
Executor.submit(Map, Callable)
but provide info to which priority
queue should be used.submit
in interface Executor
prio
- Possibly null. Priority for execution. Default: Executor.Priority.USER
callContext
- Possibly null. See CurrentDetails.setContext(Map)
callable
- Not null. Action to be taken.public <T> T get(java.util.concurrent.Future<T> future)
Executor
Future.get()
and properly unwrap the
exceptions. Any RuntimeException
which was thrown during
execution will be rethrown. All other exceptions will be wrapped in an
InternalException
.public java.util.concurrent.ExecutorService getService()
Executor
ExecutorService
assigned to this instance.
Used by Executor.submit(Callable)
and Executor.get(Future)
.getService
in interface Executor
public java.lang.Object executeSql(Executor.SqlWork work)
Executor.SqlWork
in transaction.executeSql
in interface Executor
work
- Non-null.