Executor.Descriptive, Executor.Impl, Executor.Priority, Executor.SimpleSqlWork, Executor.SimpleWork, Executor.SqlWork, Executor.StatefulWork, Executor.Work<X>
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Advice> |
advices |
protected OmeroContext |
context |
protected SessionFactory |
factory |
protected InternalServiceFactory |
isf |
protected CurrentDetails |
principalHolder |
protected java.lang.String[] |
proxyNames |
protected java.util.concurrent.ExecutorService |
service |
protected SqlAction |
sqlAction |
protected java.util.concurrent.ExecutorService |
systemService |
Constructor and Description |
---|
Impl(CurrentDetails principalHolder,
SessionFactory factory,
SqlAction sqlAction,
java.lang.String[] proxyNames) |
Impl(CurrentDetails principalHolder,
SessionFactory factory,
SqlAction sqlAction,
java.lang.String[] proxyNames,
java.util.concurrent.ExecutorService service) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(java.util.Map<java.lang.String,java.lang.String> callContext,
Principal p,
Executor.Work work)
Executes a
Executor.Work instance wrapped in two layers of AOP. |
java.lang.Object |
execute(Principal p,
Executor.Work 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. |
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. |
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 OmeroContext context
protected InternalServiceFactory isf
protected final java.util.List<Advice> advices
protected final CurrentDetails principalHolder
protected final java.lang.String[] proxyNames
protected final SessionFactory factory
protected final SqlAction sqlAction
protected final java.util.concurrent.ExecutorService service
protected final java.util.concurrent.ExecutorService systemService
public Impl(CurrentDetails principalHolder, SessionFactory factory, SqlAction sqlAction, java.lang.String[] proxyNames)
public Impl(CurrentDetails principalHolder, SessionFactory factory, SqlAction sqlAction, java.lang.String[] proxyNames, java.util.concurrent.ExecutorService 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 OmeroContext getContext()
Executor
getContext
in interface Executor
public Principal principal()
Executor
Principal
representing your current session or null,
if none is active.public java.lang.Object execute(Principal p, Executor.Work work)
Executor.execute(Map, Principal, Work)
with a null call context.public java.lang.Object execute(java.util.Map<java.lang.String,java.lang.String> callContext, Principal p, Executor.Work 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.
Version: 5.4.4-ice35-b82
Copyright © 2018 The University of Dundee & Open Microscopy Environment. All Rights Reserved.