aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions/NotifyOnActionCacheHit.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/NotifyOnActionCacheHit.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/NotifyOnActionCacheHit.java34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/NotifyOnActionCacheHit.java b/src/main/java/com/google/devtools/build/lib/actions/NotifyOnActionCacheHit.java
index ac58b89f4a..89c9a20c2e 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/NotifyOnActionCacheHit.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/NotifyOnActionCacheHit.java
@@ -14,17 +14,47 @@
package com.google.devtools.build.lib.actions;
+import com.google.common.eventbus.EventBus;
+import com.google.devtools.build.lib.actions.Executor.ActionContext;
+import com.google.devtools.build.lib.events.EventHandler;
+import com.google.devtools.build.lib.vfs.Path;
+
/**
* An action which must know when it is skipped due to an action cache hit.
*
* Use should be rare, as the action graph is a functional model.
*/
public interface NotifyOnActionCacheHit extends Action {
+ /**
+ * A custom interface similar to {@link ActionExecutionContext}, but specific to cache hits.
+ */
+ public interface ActionCachedContext {
+ /**
+ * An event listener to report messages to. Errors that signal a action failure should
+ * use ActionExecutionException.
+ */
+ EventHandler getEventHandler();
+
+ /** The EventBus for the current build. */
+ EventBus getEventBus();
+
+ /**
+ * Returns the execution root. This is the directory underneath which Blaze builds its entire
+ * output working tree, including the source symlink forest. All build actions are executed
+ * relative to this directory.
+ */
+ Path getExecRoot();
+
+ /**
+ * Looks up and returns an action context implementation of the given interface type.
+ */
+ <T extends ActionContext> T getContext(Class<? extends T> type);
+ }
/**
* Called when action has "cache hit", and therefore need not be executed.
*
- * @param executor the executor
+ * @param context the action context for a cache hit
*/
- void actionCacheHit(Executor executor);
+ void actionCacheHit(ActionCachedContext context);
}