-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce `Loadable` interface CloudBees CI uses `load()` method to reload selectively parts of the Jenkins object model, without reloading everything. This formalizes the interface that gets used for this purpose, even if most of the Saveable implementations were using a `load()` method by convention. * Add missing @OverRide * Jenkins#load can throw IOException * Inline loadConfig into load * Make Plugin#load/save synchronized (same as Descriptor)
- Loading branch information
Showing
9 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package hudson.model; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import jenkins.model.Loadable; | ||
|
||
/** | ||
* Marker interface for Descriptors which use xml persistent data, and as such need to load from disk when instantiated. | ||
|
@@ -10,8 +11,9 @@ | |
* @author <a href="mailto:[email protected]">Nicolas De Loof</a> | ||
* @since 2.140 | ||
*/ | ||
public interface PersistentDescriptor extends Saveable { | ||
public interface PersistentDescriptor extends Loadable, Saveable { | ||
|
||
@PostConstruct | ||
@Override | ||
void load(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package jenkins.model; | ||
|
||
import hudson.model.Saveable; | ||
import java.io.IOException; | ||
|
||
/** | ||
* Object whose state can be loaded from disk. In general, also implements {@link Saveable}. | ||
* | ||
* @since TODO | ||
*/ | ||
public interface Loadable { | ||
|
||
/** | ||
* Loads the state of this object from disk. | ||
* | ||
* @throws IOException The state could not be loaded. | ||
*/ | ||
void load() throws IOException; | ||
} |