|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.services.util.Executor.Impl
public static class Executor.Impl
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface ome.services.util.Executor |
---|
Executor.Descriptive, Executor.Impl, Executor.SimpleSqlWork, Executor.SimpleWork, Executor.SqlWork, Executor.Work |
Field Summary | |
---|---|
protected List<Advice> |
advices
|
protected OmeroContext |
context
|
protected SessionFactory |
factory
|
protected InternalServiceFactory |
isf
|
protected CurrentDetails |
principalHolder
|
protected String[] |
proxyNames
|
protected ExecutorService |
service
|
protected ome.util.SqlAction |
sqlAction
|
Constructor Summary | |
---|---|
Executor.Impl(CurrentDetails principalHolder,
SessionFactory factory,
ome.util.SqlAction sqlAction,
String[] proxyNames)
|
|
Executor.Impl(CurrentDetails principalHolder,
SessionFactory factory,
ome.util.SqlAction sqlAction,
String[] proxyNames,
ExecutorService service)
|
Method Summary | ||
---|---|---|
Object |
execute(Principal p,
Executor.Work work)
Executes a Executor.Work instance wrapped in two layers of AOP. |
|
Object |
executeSql(Executor.SqlWork work)
Executes a SqkWork in transaction. |
|
|
get(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. |
|
Principal |
principal()
Returns a Principal representing your current session or null,
if none is active. |
|
void |
resetCallGroup()
Delegates to CurrentDetails.resetCallGroup() . |
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
|
void |
setCallGroup(long gid)
Delegates to CurrentDetails.setCallGroup(Long) to permit thread-specific
setting of the group. |
|
|
submit(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected OmeroContext context
protected InternalServiceFactory isf
protected final List<Advice> advices
protected final CurrentDetails principalHolder
protected final String[] proxyNames
protected final SessionFactory factory
protected final ome.util.SqlAction sqlAction
protected final ExecutorService service
Constructor Detail |
---|
public Executor.Impl(CurrentDetails principalHolder, SessionFactory factory, ome.util.SqlAction sqlAction, String[] proxyNames)
public Executor.Impl(CurrentDetails principalHolder, SessionFactory factory, ome.util.SqlAction sqlAction, String[] proxyNames, ExecutorService service)
Method Detail |
---|
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.
principal
in interface Executor
public Object execute(Principal p, Executor.Work work)
Executor.Work
instance wrapped in two layers of AOP. The
first is intended to acquire the proper arguments for
Work#doWork(TransactionStatus, 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.
execute
in interface Executor
p
- work
- public <T> Future<T> submit(Callable<T> callable)
Executor
Executor.execute(Principal, Work)
to overcome the no-multiple-login rule.
submit
in interface Executor
public <T> T get(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
.
get
in interface Executor
public Object executeSql(Executor.SqlWork work)
SqkWork
in transaction.
executeSql
in interface Executor
work
- Non-null.
public void resetCallGroup()
Executor
CurrentDetails.resetCallGroup()
.
resetCallGroup
in interface Executor
Executor.setCallGroup(long)
,
ticket:1434
public void setCallGroup(long gid)
Executor
CurrentDetails.setCallGroup(Long)
to permit thread-specific
setting of the group.
setCallGroup
in interface Executor
ticket:1434
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: 4.3.3-00d1137e-b2894
Copyright © 2009 The University of Dundee. All Rights Reserved.