|
||||||||||
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.SimpleStatelessWork, Executor.SimpleWork, Executor.StatelessWork, Executor.Work |
Field Summary | |
---|---|
protected List<Advice> |
advices
|
protected OmeroContext |
context
|
protected org.hibernate.SessionFactory |
factory
|
protected org.springframework.jdbc.core.simple.SimpleJdbcOperations |
jdbcOps
|
protected CurrentDetails |
principalHolder
|
protected String[] |
proxyNames
|
protected ExecutorService |
service
|
Constructor Summary | |
---|---|
Executor.Impl(CurrentDetails principalHolder,
org.hibernate.SessionFactory factory,
org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc,
String[] proxyNames)
|
|
Executor.Impl(CurrentDetails principalHolder,
org.hibernate.SessionFactory factory,
org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc,
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 |
executeStateless(Executor.StatelessWork work)
Executes a Executor.StatelessWork 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 final List<Advice> advices
protected final CurrentDetails principalHolder
protected final String[] proxyNames
protected final org.hibernate.SessionFactory factory
protected final org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbcOps
protected final ExecutorService service
Constructor Detail |
---|
public Executor.Impl(CurrentDetails principalHolder, org.hibernate.SessionFactory factory, org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc, String[] proxyNames)
public Executor.Impl(CurrentDetails principalHolder, org.hibernate.SessionFactory factory, org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc, 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 executeStateless(Executor.StatelessWork work)
Executor.StatelessWork
in transaction.
executeStateless
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: Beta-4.2.0-r7571-b29
Copyright © 2009 The University of Dundee. All Rights Reserved.