Class AsyncExecutionService

    • Constructor Detail

      • AsyncExecutionService

        public AsyncExecutionService​(IInternalAccess component)
        Create a new asynchronous executor service.
      • AsyncExecutionService

        public AsyncExecutionService​(IInternalAccess component,
                                     java.util.Map<java.lang.String,​java.lang.Object> properties)
        Create a new asynchronous executor service.
    • Method Detail

      • execute

        public void execute​(IExecutable task)
        Execute a task in its own thread.
        Specified by:
        execute in interface IExecutionService
        Parameters:
        task - The task to execute. (called from arbitrary threads)
      • cancel

        public IFuture<java.lang.Void> cancel​(IExecutable task)
        Cancel a task. Triggers the task to be not executed in future.
        Specified by:
        cancel in interface IExecutionService
        Parameters:
        task - The task to execute.
        listener - The listener.
        Returns:
        Future signaling cancellation.
      • startService

        public IFuture<java.lang.Void> startService()
        Start the execution service. Resumes all scheduled tasks.
        Specified by:
        startService in interface IInternalService
        Overrides:
        startService in class BasicService
        Returns:
        A future that is done when the service has completed starting.
      • shutdownService

        public IFuture<java.lang.Void> shutdownService()
        Shutdown the executor service. // todo: make callable more than once
        Specified by:
        shutdownService in interface IInternalService
        Overrides:
        shutdownService in class BasicService
        Returns:
        A future that is done when the service has completed its shutdown.
      • customIsValid

        public boolean customIsValid()
        Test if the service is valid.
        Returns:
        True, if service can be used.