提交 b3c661d5 编写于 作者: A alanharder

some hudson.war/jenkins.war changes

上级 0b424d69
...@@ -50,8 +50,8 @@ import java.util.Enumeration; ...@@ -50,8 +50,8 @@ import java.util.Enumeration;
import java.util.jar.JarFile; import java.util.jar.JarFile;
/** /**
* Represents a Hudson plug-in and associated control information * Represents a Jenkins plug-in and associated control information
* for Hudson to control {@link Plugin}. * for Jenkins to control {@link Plugin}.
* *
* <p> * <p>
* A plug-in is packaged into a jar file whose extension is <tt>".hpi"</tt>, * A plug-in is packaged into a jar file whose extension is <tt>".hpi"</tt>,
...@@ -60,9 +60,9 @@ import java.util.jar.JarFile; ...@@ -60,9 +60,9 @@ import java.util.jar.JarFile;
* <p> * <p>
* At the runtime, a plugin has two distinct state axis. * At the runtime, a plugin has two distinct state axis.
* <ol> * <ol>
* <li>Enabled/Disabled. If enabled, Hudson is going to use it * <li>Enabled/Disabled. If enabled, Jenkins is going to use it
* next time Hudson runs. Otherwise the next run will ignore it. * next time Jenkins runs. Otherwise the next run will ignore it.
* <li>Activated/Deactivated. If activated, that means Hudson is using * <li>Activated/Deactivated. If activated, that means Jenkins is using
* the plugin in this session. Otherwise it's not. * the plugin in this session. Otherwise it's not.
* </ol> * </ol>
* <p> * <p>
...@@ -104,7 +104,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> { ...@@ -104,7 +104,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
/** /**
* Used to control the unpacking of the bundled plugin. * Used to control the unpacking of the bundled plugin.
* If a pin file exists, Hudson assumes that the user wants to pin down a particular version * If a pin file exists, Jenkins assumes that the user wants to pin down a particular version
* of a plugin, and will not try to overwrite it. Otherwise, it'll be overwritten * of a plugin, and will not try to overwrite it. Otherwise, it'll be overwritten
* by a bundled copy, to ensure consistency across upgrade/downgrade. * by a bundled copy, to ensure consistency across upgrade/downgrade.
* @since 1.325 * @since 1.325
...@@ -113,7 +113,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> { ...@@ -113,7 +113,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
/** /**
* Short name of the plugin. The artifact Id of the plugin. * Short name of the plugin. The artifact Id of the plugin.
* This is also used in the URL within Hudson, so it needs * This is also used in the URL within Jenkins, so it needs
* to remain stable even when the *.hpi file name is changed * to remain stable even when the *.hpi file name is changed
* (like Maven does.) * (like Maven does.)
*/ */
...@@ -129,7 +129,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> { ...@@ -129,7 +129,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
private final List<Dependency> optionalDependencies; private final List<Dependency> optionalDependencies;
/** /**
* Is this plugin bundled in hudson.war? * Is this plugin bundled in jenkins.war?
*/ */
/*package*/ boolean isBundled; /*package*/ boolean isBundled;
...@@ -349,7 +349,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> { ...@@ -349,7 +349,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
} }
/** /**
* Enables this plugin next time Hudson runs. * Enables this plugin next time Jenkins runs.
*/ */
public void enable() throws IOException { public void enable() throws IOException {
if(!disableFile.delete()) if(!disableFile.delete())
...@@ -357,7 +357,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> { ...@@ -357,7 +357,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
} }
/** /**
* Disables this plugin next time Hudson runs. * Disables this plugin next time Jenkins runs.
*/ */
public void disable() throws IOException { public void disable() throws IOException {
// creates an empty file // creates an empty file
...@@ -378,7 +378,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> { ...@@ -378,7 +378,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
/** /**
* If true, the plugin is going to be activated next time * If true, the plugin is going to be activated next time
* Hudson runs. * Jenkins runs.
*/ */
public boolean isEnabled() { public boolean isEnabled() {
return !disableFile.exists(); return !disableFile.exists();
......
...@@ -111,7 +111,7 @@ public abstract class Lifecycle implements ExtensionPoint { ...@@ -111,7 +111,7 @@ public abstract class Lifecycle implements ExtensionPoint {
} }
/** /**
* If the location of <tt>hudson.war</tt> is known in this life cycle, * If the location of <tt>jenkins.war</tt> is known in this life cycle,
* return it location. Otherwise return null to indicate that it is unknown. * return it location. Otherwise return null to indicate that it is unknown.
* *
* <p> * <p>
...@@ -126,22 +126,22 @@ public abstract class Lifecycle implements ExtensionPoint { ...@@ -126,22 +126,22 @@ public abstract class Lifecycle implements ExtensionPoint {
} }
/** /**
* Replaces hudson.war by the given file. * Replaces jenkins.war by the given file.
* *
* <p> * <p>
* On some system, most notably Windows, a file being in use cannot be changed, * On some system, most notably Windows, a file being in use cannot be changed,
* so rewriting <tt>hudson.war</tt> requires some special trick. Override this method * so rewriting <tt>jenkins.war</tt> requires some special trick. Override this method
* to do so. * to do so.
*/ */
public void rewriteHudsonWar(File by) throws IOException { public void rewriteHudsonWar(File by) throws IOException {
File dest = getHudsonWar(); File dest = getHudsonWar();
// this should be impossible given the canRewriteHudsonWar method, // this should be impossible given the canRewriteHudsonWar method,
// but let's be defensive // but let's be defensive
if(dest==null) throw new IOException("hudson.war location is not known."); if(dest==null) throw new IOException("jenkins.war location is not known.");
// backing up the old hudson.war before it gets lost due to upgrading // backing up the old jenkins.war before it gets lost due to upgrading
// (newly downloaded hudson.war and 'backup' (hudson.war.tmp) are the same files // (newly downloaded jenkins.war and 'backup' (jenkins.war.tmp) are the same files
// unless we are trying to rewrite hudson.war by a backup itself // unless we are trying to rewrite jenkins.war by a backup itself
File bak = new File(dest.getPath() + ".bak"); File bak = new File(dest.getPath() + ".bak");
if (!by.equals(bak)) if (!by.equals(bak))
FileUtils.copyFile(dest, bak); FileUtils.copyFile(dest, bak);
...@@ -156,7 +156,7 @@ public abstract class Lifecycle implements ExtensionPoint { ...@@ -156,7 +156,7 @@ public abstract class Lifecycle implements ExtensionPoint {
* Can {@link #rewriteHudsonWar(File)} work? * Can {@link #rewriteHudsonWar(File)} work?
*/ */
public boolean canRewriteHudsonWar() { public boolean canRewriteHudsonWar() {
// if we don't know where hudson.war is, it's impossible to replace. // if we don't know where jenkins.war is, it's impossible to replace.
File f = getHudsonWar(); File f = getHudsonWar();
return f!=null && f.canWrite(); return f!=null && f.canWrite();
} }
......
...@@ -55,7 +55,7 @@ import java.net.URL; ...@@ -55,7 +55,7 @@ import java.net.URL;
public class WindowsInstallerLink extends ManagementLink { public class WindowsInstallerLink extends ManagementLink {
/** /**
* Location of the hudson.war. * Location of the jenkins.war.
* In general case, we can't determine this value, yet having this is a requirement for the installer. * In general case, we can't determine this value, yet having this is a requirement for the installer.
*/ */
private final File hudsonWar; private final File hudsonWar;
...@@ -65,8 +65,8 @@ public class WindowsInstallerLink extends ManagementLink { ...@@ -65,8 +65,8 @@ public class WindowsInstallerLink extends ManagementLink {
*/ */
private volatile File installationDir; private volatile File installationDir;
private WindowsInstallerLink(File hudsonWar) { private WindowsInstallerLink(File jenkinsWar) {
this.hudsonWar = hudsonWar; this.hudsonWar = jenkinsWar;
} }
public String getIconFileName() { public String getIconFileName() {
......
...@@ -87,7 +87,7 @@ public class WindowsServiceLifecycle extends Lifecycle { ...@@ -87,7 +87,7 @@ public class WindowsServiceLifecycle extends Lifecycle {
} }
/** /**
* On Windows, hudson.war is locked, so we place a new version under a special name, * On Windows, jenkins.war is locked, so we place a new version under a special name,
* which is picked up by the service wrapper upon restart. * which is picked up by the service wrapper upon restart.
*/ */
@Override @Override
...@@ -98,7 +98,7 @@ public class WindowsServiceLifecycle extends Lifecycle { ...@@ -98,7 +98,7 @@ public class WindowsServiceLifecycle extends Lifecycle {
if(dest==null) throw new IOException("jenkins.war location is not known."); if(dest==null) throw new IOException("jenkins.war location is not known.");
// backing up the old jenkins.war before its lost due to upgrading // backing up the old jenkins.war before its lost due to upgrading
// unless we are trying to rewrite hudson.war by a backup itself // unless we are trying to rewrite jenkins.war by a backup itself
File bak = new File(dest.getPath() + ".bak"); File bak = new File(dest.getPath() + ".bak");
if (!by.equals(bak)) if (!by.equals(bak))
FileUtils.copyFile(dest, bak); FileUtils.copyFile(dest, bak);
......
...@@ -74,7 +74,7 @@ import javax.servlet.ServletContext; ...@@ -74,7 +74,7 @@ import javax.servlet.ServletContext;
* Source of the update center information, like "http://jenkins-ci.org/update-center.json" * Source of the update center information, like "http://jenkins-ci.org/update-center.json"
* *
* <p> * <p>
* Hudson can have multiple {@link UpdateSite}s registered in the system, so that it can pick up plugins * Jenkins can have multiple {@link UpdateSite}s registered in the system, so that it can pick up plugins
* from different locations. * from different locations.
* *
* @author Andrew Bayer * @author Andrew Bayer
...@@ -173,7 +173,7 @@ public class UpdateSite { ...@@ -173,7 +173,7 @@ public class UpdateSite {
certs.add(c); certs.add(c);
} }
// all default root CAs in JVM are trusted, plus certs bundled in Hudson // all default root CAs in JVM are trusted, plus certs bundled in Jenkins
Set<TrustAnchor> anchors = CertificateUtil.getDefaultRootCAs(); Set<TrustAnchor> anchors = CertificateUtil.getDefaultRootCAs();
ServletContext context = Hudson.getInstance().servletContext; ServletContext context = Hudson.getInstance().servletContext;
for (String cert : (Set<String>) context.getResourcePaths("/WEB-INF/update-center-rootCAs")) { for (String cert : (Set<String>) context.getResourcePaths("/WEB-INF/update-center-rootCAs")) {
...@@ -320,7 +320,7 @@ public class UpdateSite { ...@@ -320,7 +320,7 @@ public class UpdateSite {
for (PluginWrapper pw : Hudson.getInstance().getPluginManager().getPlugins()) { for (PluginWrapper pw : Hudson.getInstance().getPluginManager().getPlugins()) {
if(!pw.isBundled() && pw.getUpdateInfo()!=null) if(!pw.isBundled() && pw.getUpdateInfo()!=null)
// do not advertize updates to bundled plugins, since we generally want users to get them // do not advertize updates to bundled plugins, since we generally want users to get them
// as a part of hudson.war updates. This also avoids unnecessary pinning of plugins. // as a part of jenkins.war updates. This also avoids unnecessary pinning of plugins.
return true; return true;
} }
return false; return false;
...@@ -352,7 +352,7 @@ public class UpdateSite { ...@@ -352,7 +352,7 @@ public class UpdateSite {
public final String sourceId; public final String sourceId;
/** /**
* The latest hudson.war. * The latest jenkins.war.
*/ */
public final Entry core; public final Entry core;
/** /**
...@@ -361,7 +361,7 @@ public class UpdateSite { ...@@ -361,7 +361,7 @@ public class UpdateSite {
public final Map<String,Plugin> plugins = new TreeMap<String,Plugin>(String.CASE_INSENSITIVE_ORDER); public final Map<String,Plugin> plugins = new TreeMap<String,Plugin>(String.CASE_INSENSITIVE_ORDER);
/** /**
* If this is non-null, Hudson is going to check the connectivity to this URL to make sure * If this is non-null, Jenkins is going to check the connectivity to this URL to make sure
* the network connection is up. Null to skip the check. * the network connection is up. Null to skip the check.
*/ */
public final String connectionCheckUrl; public final String connectionCheckUrl;
...@@ -464,7 +464,7 @@ public class UpdateSite { ...@@ -464,7 +464,7 @@ public class UpdateSite {
*/ */
public final String compatibleSinceVersion; public final String compatibleSinceVersion;
/** /**
* Version of Hudson core this plugin was compiled against. * Version of Jenkins core this plugin was compiled against.
*/ */
public final String requiredCore; public final String requiredCore;
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册