|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.lifecycle.Lifecycle
public abstract class Lifecycle
Provides the capability for starting/stopping/restarting/uninstalling Hudson.
The steps to perform these operations depend on how Hudson is launched, so the concrete instance of this method (which is VM-wide singleton) is discovered by looking up a FQCN from the system property "hudson.lifecycle".
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
Constructor Summary | |
---|---|
Lifecycle()
|
Method Summary | |
---|---|
boolean |
canRestart()
The same as verifyRestartable() except the status is indicated by the return value,
not by an exception. |
boolean |
canRewriteHudsonWar()
Can rewriteHudsonWar(File) work? |
static Lifecycle |
get()
Gets the singleton instance. |
File |
getHudsonWar()
If the location of jenkins.war is known in this life cycle, return it location. |
void |
restart()
If this life cycle supports a restart of Hudson, do so. |
void |
rewriteHudsonWar(File by)
Replaces jenkins.war by the given file. |
void |
verifyRestartable()
Can the restart() method restart Hudson? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Lifecycle()
Method Detail |
---|
public static Lifecycle get()
public File getHudsonWar()
When a non-null value is returned, Hudson will offer an upgrade UI to a newer version.
public void rewriteHudsonWar(File by) throws IOException
On some system, most notably Windows, a file being in use cannot be changed, so rewriting jenkins.war requires some special trick. Override this method to do so.
IOException
public boolean canRewriteHudsonWar()
rewriteHudsonWar(File)
work?
public void restart() throws IOException, InterruptedException
UnsupportedOperationException
,
which is what the default implementation does.
The restart operation may happen synchronously (in which case this method will never return), or asynchronously (in which case this method will successfully return.)
Throw an exception if the operation fails unexpectedly.
IOException
InterruptedException
public void verifyRestartable() throws RestartNotSupportedException
restart()
method restart Hudson?
RestartNotSupportedException
- If the restart is not supported, throw this exception and explain the cause.public boolean canRestart()
verifyRestartable()
except the status is indicated by the return value,
not by an exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |