]> git.argeo.org Git - lgpl/argeo-commons.git/blob - SystemExecutionService.java
e03f27ab2461455cb7abff01f0b64ae978a95a32
[lgpl/argeo-commons.git] / SystemExecutionService.java
1 package org.argeo.security;
2
3 import java.util.concurrent.Callable;
4 import java.util.concurrent.Executor;
5 import java.util.concurrent.Future;
6
7 /**
8 * Allows to execute code authenticated as a system user (that is not a real
9 * person). The {@link Executor} interface interface is not used directly in
10 * order to allow future extension of this interface and to simplify its
11 * publication (e.g. as an OSGi service) and interception.
12 */
13 public interface SystemExecutionService extends Executor {
14 /**
15 * Executes this {@link Runnable} within a system authenticated context.
16 * Implementations should make sure that this method is properly secured via
17 * Java permissions since it could access to everything without credentials.
18 */
19 public void execute(Runnable runnable);
20
21 /**
22 * Executes this {@link Callable} within a system authenticated context.
23 * Implementations should make sure that this method is properly secured via
24 * Java permissions since it could access to everything without credentials.
25 */
26 public <T> Future<T> submit(Callable<T> task);
27 }