[New] Added ExecutionHandler.archiveActivity()

This commit is contained in:
Robert von Burg 2017-10-27 09:20:32 +02:00
parent 49d5e41fe5
commit 7c15a8d7c5
2 changed files with 40 additions and 29 deletions

View File

@ -262,7 +262,8 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
});
}
private void archiveActivity(String realm, Locator activityLoc) {
@Override
public void archiveActivity(String realm, Locator activityLoc) {
this.executorService.execute(() -> {
try {
runAsAgent(ctx -> {

View File

@ -39,9 +39,9 @@ public abstract class ExecutionHandler extends StrolchComponent {
* immediately in an asynchronous manner
*
* @param realm
* the realm where the {@link Activity} resides
* the realm where the {@link Activity} resides
* @param activityLoc
* the {@link Locator} of the {@link Activity}
* the {@link Locator} of the {@link Activity}
*/
public abstract void addForExecution(String realm, Locator activityLoc);
@ -49,9 +49,9 @@ public abstract class ExecutionHandler extends StrolchComponent {
* Removes the given {@link Locator} for an {@link Activity} from execution, so it is not executed further
*
* @param realm
* the realm where the {@link Activity} resides
* the realm where the {@link Activity} resides
* @param activityLoc
* the {@link Locator} of the {@link Activity}
* the {@link Locator} of the {@link Activity}
*/
public abstract void removeFromExecution(String realm, Locator activityLoc);
@ -59,10 +59,20 @@ public abstract class ExecutionHandler extends StrolchComponent {
* Triggers a to execution for all registered activities in the given realm
*
* @param realm
* the realm to trigger execution for
* the realm to trigger execution for
*/
public abstract void triggerExecution(String realm);
/**
* Archives the given {@link Activity}
*
* @param realm
* the realm where the activity resides
* @param activityLoc
* the {@link Locator} of the {@link Activity}
*/
public abstract void archiveActivity(String realm, Locator activityLoc);
/**
* <p>
* Returns the {@link DelayedExecutionTimer}
@ -81,9 +91,9 @@ public abstract class ExecutionHandler extends StrolchComponent {
* Starts the execution of the given {@link Activity} with the given {@link Locator}
*
* @param realm
* the realm where the {@link Activity} resides
* the realm where the {@link Activity} resides
* @param activityLoc
* the {@link Locator} of the {@link Activity}
* the {@link Locator} of the {@link Activity}
*/
public abstract void toExecution(String realm, Locator activityLoc);
@ -91,9 +101,9 @@ public abstract class ExecutionHandler extends StrolchComponent {
* Completes the execution of the given {@link Action} with the given {@link Locator}
*
* @param realm
* the realm where the {@link Action} resides
* the realm where the {@link Action} resides
* @param actionLoc
* the {@link Locator} of the {@link Action}
* the {@link Locator} of the {@link Action}
*/
public abstract void toExecuted(String realm, Locator actionLoc);
@ -101,9 +111,9 @@ public abstract class ExecutionHandler extends StrolchComponent {
* Sets the state of the {@link Action} with the given {@link Locator} to {@link State#STOPPED}
*
* @param realm
* the realm where the {@link Action} resides
* the realm where the {@link Action} resides
* @param actionLoc
* the {@link Locator} of the {@link Action}
* the {@link Locator} of the {@link Action}
*/
public abstract void toStopped(String realm, Locator actionLoc);
@ -111,9 +121,9 @@ public abstract class ExecutionHandler extends StrolchComponent {
* Sets the state of the {@link Action} with the given {@link Locator} to {@link State#WARNING}
*
* @param realm
* the realm where the {@link Action} resides
* the realm where the {@link Action} resides
* @param actionLoc
* the {@link Locator} of the {@link Action}
* the {@link Locator} of the {@link Action}
*/
public abstract void toWarning(String realm, Locator actionLoc);
@ -121,9 +131,9 @@ public abstract class ExecutionHandler extends StrolchComponent {
* Sets the state of the {@link Action} with the given {@link Locator} to {@link State#ERROR}
*
* @param realm
* the realm where the {@link Action} resides
* the realm where the {@link Action} resides
* @param actionLoc
* the {@link Locator} of the {@link Action}
* the {@link Locator} of the {@link Action}
*/
public abstract void toError(String realm, Locator actionLoc);