Package hudson.util
Class DoubleLaunchChecker
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.AdministrativeMonitor
-
- hudson.util.DoubleLaunchChecker
-
- All Implemented Interfaces:
ExtensionPoint
,ModelObject
,SearchableModelObject
,SearchItem
,org.kohsuke.stapler.StaplerProxy
@Extension public class DoubleLaunchChecker extends AdministrativeMonitor
Makes sure that no other Hudson uses ourJENKINS_HOME
directory, to forestall the problem of running multiple instances of Hudson that point to the same data directory.This set up error occasionally happens especially when the user is trying to reassign the context path of the app, and it results in a hard-to-diagnose error, so we actively check this.
The mechanism is simple. This class occasionally updates a known file inside the hudson home directory, and whenever it does so, it monitors the timestamp of the file to make sure no one else is updating this file. In this way, while we cannot detect the problem right away, within a reasonable time frame we can detect the collision.
- Since:
- 1.178
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DoubleLaunchChecker.Schedule
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description File
home
-
Fields inherited from class hudson.model.AdministrativeMonitor
id
-
-
Constructor Summary
Constructors Constructor Description DoubleLaunchChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
execute()
String
getCollidingId()
String
getDisplayName()
String
getId()
Figures out a string that identifies this instance of Hudson.boolean
isActivated()
Returns true if this monitor is activated and wants to produce a warning message.-
Methods inherited from class hudson.model.AdministrativeMonitor
all, disable, doDisable, getRequiredPermission, getSearchUrl, getTarget, getUrl, isEnabled, isSecurity
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
-
-
-
Field Detail
-
home
public final File home
-
-
Method Detail
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classAdministrativeMonitor
-
isActivated
public boolean isActivated()
Description copied from class:AdministrativeMonitor
Returns true if this monitor is activated and wants to produce a warning message.This method is called from the HTML rendering thread, so it should run efficiently.
- Specified by:
isActivated
in classAdministrativeMonitor
-
execute
protected void execute()
-
getId
public String getId()
Figures out a string that identifies this instance of Hudson.
-
getCollidingId
public String getCollidingId()
-
-