Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented the hook
- Loading branch information
Showing
18 changed files
with
112 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package hudson.util; | ||
|
||
import jenkins.util.groovy.GroovyHookScript; | ||
import org.kohsuke.stapler.WebApp; | ||
|
||
import javax.servlet.ServletContext; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
/** | ||
* Indicates a fatal boot problem, among {@link ErrorObject} | ||
* | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
public abstract class BootFailure extends ErrorObject { | ||
protected BootFailure() { | ||
} | ||
|
||
protected BootFailure(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Exposes this failure to UI and invoke the hook. | ||
*/ | ||
public void publish(ServletContext context) { | ||
LOGGER.log(Level.SEVERE, "Failed to initialize Jenkins",this); | ||
|
||
WebApp.get(context).setApp(this); | ||
new GroovyHookScript("boot-failure") | ||
.bind("exception",this) | ||
.run(); | ||
} | ||
|
||
private static final Logger LOGGER = Logger.getLogger(BootFailure.class.getName()); | ||
} |
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
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,14 +1,19 @@ | ||
package hudson.util; | ||
|
||
import org.kohsuke.accmod.Restricted; | ||
import org.kohsuke.accmod.restrictions.NoExternalUse; | ||
|
||
/** | ||
* Indicates that Jenkins is interrupted during reload. | ||
* | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
public class JenkinsReloadFailed extends ErrorObject { | ||
public class JenkinsReloadFailed extends BootFailure { | ||
@Restricted(NoExternalUse.class) @Deprecated | ||
public final Throwable cause; | ||
|
||
public JenkinsReloadFailed(Throwable cause) { | ||
super(cause); | ||
this.cause = cause; | ||
} | ||
} |
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
Oops, something went wrong.