Class Executor.Impl

  • All Implemented Interfaces:
    Executor, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
    Enclosing interface:
    Executor

    public static class Executor.Impl
    extends java.lang.Object
    implements Executor
    • Field Detail

      • context

        protected ome.system.OmeroContext context
      • advices

        protected final java.util.List<org.aopalliance.aop.Advice> advices
      • proxyNames

        protected final java.lang.String[] proxyNames
      • sqlAction

        protected final ome.util.SqlAction sqlAction
      • systemService

        protected final java.util.concurrent.ExecutorService systemService
    • Method Detail

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • getContext

        public ome.system.OmeroContext getContext()
        Description copied from interface: Executor
        Provides access to the context for Work-API consumers who need to publish events, etc.
        Specified by:
        getContext in interface Executor
      • principal

        public ome.system.Principal principal()
        Description copied from interface: Executor
        Returns a Principal representing your current session or null, if none is active.
        Specified by:
        principal in interface Executor
      • execute

        public <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. 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.
        Specified by:
        execute in interface Executor
        Parameters:
        callContext - Possibly null key-value map. See #3529
        p -
        work -
        Returns:
        See above.
      • submit

        public <T> java.util.concurrent.Future<T> submit​(java.util.concurrent.Callable<T> callable)
        Description copied from interface: Executor
        Call Executor.submit(Map, Callable) with a null callContext.
        Specified by:
        submit in interface Executor
        Returns:
        See above.
      • submit

        public <T> java.util.concurrent.Future<T> submit​(java.util.Map<java.lang.String,​java.lang.String> callContext,
                                                         java.util.concurrent.Callable<T> callable)
        Description copied from interface: Executor
        Simple submission method which can be used in conjunction with a call to Executor.execute(Principal, Work) to overcome the no-multiple-login rule.
        Specified by:
        submit in interface Executor
        Parameters:
        callContext - Possibly null. See CurrentDetails.setContext(Map)
        callable - Not null. Action to be taken.
        Returns:
        See above.
      • get

        public <T> T get​(java.util.concurrent.Future<T> future)
        Description copied from interface: Executor
        Helper method to perform 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.
        Specified by:
        get in interface Executor