Package jenkins.util
Class JenkinsJVM
- java.lang.Object
-
- jenkins.util.JenkinsJVM
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JenkinsJVM()
Protect against people instantiating this class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkJenkinsJVM()
Verify that the classloader that loaded this class is the classloader from whichJenkins
has been started.static void
checkNotJenkinsJVM()
Verify that the classloader that loaded this class is not the classloader from whichJenkins
has been started.static boolean
isJenkinsJVM()
Identify whether the classloader that loaded this class is the classloader from whichJenkins
has been started.protected static void
setJenkinsJVM(boolean jenkinsJVM)
Used byWebAppMain.contextInitialized(ServletContextEvent)
andWebAppMain.contextDestroyed(ServletContextEvent)
to identify the classloader and JVM which startedJenkins
-
-
-
Method Detail
-
isJenkinsJVM
public static boolean isJenkinsJVM()
Identify whether the classloader that loaded this class is the classloader from whichJenkins
has been started.- Returns:
true
if this is the classloader on the JVM that startedJenkins
otherwisefalse
-
checkJenkinsJVM
public static void checkJenkinsJVM()
Verify that the classloader that loaded this class is the classloader from whichJenkins
has been started.- Throws:
IllegalStateException
- if this is not the classloader on the JVM that startedJenkins
.
-
checkNotJenkinsJVM
public static void checkNotJenkinsJVM()
Verify that the classloader that loaded this class is not the classloader from whichJenkins
has been started.- Throws:
IllegalStateException
- if this is the classloader on the JVM that startedJenkins
.
-
setJenkinsJVM
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) protected static void setJenkinsJVM(boolean jenkinsJVM)
Used byWebAppMain.contextInitialized(ServletContextEvent)
andWebAppMain.contextDestroyed(ServletContextEvent)
to identify the classloader and JVM which startedJenkins
- Parameters:
jenkinsJVM
-true
if and only if this is the classloader and JVM that startedJenkins
.
-
-