diff options
author | Ulf Adams <ulfjack@google.com> | 2015-11-02 15:02:00 +0000 |
---|---|---|
committer | Florian Weikert <fwe@google.com> | 2015-11-02 16:57:26 +0000 |
commit | 093d995cf1298aadedb0e39356dc61bb0db403dc (patch) | |
tree | e10fb3e934402c990944f32c6005656ef1a0db2e /src/main/java/com/google/devtools/build/lib/pkgcache/LoadingCallback.java | |
parent | c33e3738b43835e5dcc35dce2ea6653ec0e6497a (diff) |
Move LoadingPhaseRunner.Callback to the top-level class LoadingCallback.
--
MOS_MIGRATED_REVID=106839024
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/pkgcache/LoadingCallback.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/pkgcache/LoadingCallback.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingCallback.java b/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingCallback.java new file mode 100644 index 0000000000..5b4538399c --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingCallback.java @@ -0,0 +1,40 @@ +// Copyright 2015 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.devtools.build.lib.pkgcache; + +import com.google.devtools.build.lib.cmdline.PackageIdentifier; +import com.google.devtools.build.lib.packages.Target; + +import java.util.Collection; +import java.util.Set; + +/** + * A callback interface to notify the caller about specific events. + * TODO(bazel-team): maybe we should use the EventBus instead? + */ +public interface LoadingCallback { + /** + * Called after the target patterns have been resolved to give the caller a chance to validate + * the list before proceeding. + */ + void notifyTargets(Collection<Target> targets) throws LoadingFailedException; + + /** + * Called after loading has finished, to notify the caller about the visited packages. + * + * <p>The set of visited packages is the set of packages in the transitive closure of the + * union of the top level targets. + */ + void notifyVisitedPackages(Set<PackageIdentifier> visitedPackages); +}
\ No newline at end of file |