Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
bea2a923
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bea2a923
编写于
5月 12, 2016
作者:
O
Oleg Nenashev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[JENKINS-34755] - Reformat Javadoc
上级
61a9ea60
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
34 deletion
+33
-34
core/src/main/java/jenkins/util/SystemProperties.java
core/src/main/java/jenkins/util/SystemProperties.java
+33
-34
未找到文件。
core/src/main/java/jenkins/util/SystemProperties.java
浏览文件 @
bea2a923
...
...
@@ -24,33 +24,34 @@
package
jenkins.util
;
import
edu.umd.cs.findbugs.annotations.CheckForNull
;
import
hudson.EnvVars
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
javax.servlet.ServletContext
;
/**
* Centralizes calls to
<code>System.getProperty()</code>
and related calls.
* Centralizes calls to
{@link System#getProperty()}
and related calls.
* This allows us to get values not just from environment variables but also from
* the
<code>ServletContext</code>, so properties like <code>hudson.DNSMultiCast.disabled</code>
* can be set in
<code>context.xml</code>
and the app server's boot script does not
* the
{@link ServletContext}, so properties like {@code hudson.DNSMultiCast.disabled}
* can be set in
{@code context.xml}
and the app server's boot script does not
* have to be changed.
*
* <p>This should be used to obtain hudson/jenkins "app"-level parameters
* (e.g.
<code>hudson.DNSMultiCast.disabled</code>
), but not for system parameters
* (e.g.
<code>os.name</code>
).
* (e.g.
{@code hudson.DNSMultiCast.disabled}
), but not for system parameters
* (e.g.
{@code os.name}
).
*
* <p>If you run multiple instances of Jenkins in the same virtual machine and wish
* to obtain properties from
<code>context.xml</code>
, make sure these Jenkins instances use
* to obtain properties from
{@code context.xml}
, make sure these Jenkins instances use
* different ClassLoaders. Tomcat, for example, does this automatically. If you do
* not use different ClassLoaders, the values of properties specified in
*
<code>context.xml</code>
is undefined.
*
{@code context.xml}
is undefined.
*
* <p>Property access is logged on
<code>Level.CONFIG</code>
. Note that some properties
* <p>Property access is logged on
{@link Level#CONFIG}
. Note that some properties
* may be accessed by Jenkins before logging is configured properly, so early access to
* some properties may not be logged.
*
* <p>While it looks like it on first glance, this cannot be mapped to
<code>EnvVars.java</code>
* because
<code>EnvVars.java</code>
is only for build variables, not Jenkins itself variables.
* <p>While it looks like it on first glance, this cannot be mapped to
{@link EnvVars},
* because
{@link EnvVars}
is only for build variables, not Jenkins itself variables.
*
* @author Johannes Ernst
* @since TODO
...
...
@@ -74,19 +75,18 @@ public class SystemProperties {
/**
* Gets the system property indicated by the specified key.
* This behaves just like
<code>System.getProperty(String)</code>
, except that it
* also consults the
<code>ServletContext</code>
's "init" parameters.
* This behaves just like
{@link System#getProperty(java.lang.String)}
, except that it
* also consults the
{@link ServletContext}
's "init" parameters.
*
* @param key the name of the system property.
* @return the string value of the system property,
* or
<code>null</code>
if there is no property with that key.
* or
{@code null}
if there is no property with that key.
*
* @exception SecurityException if a security manager exists and its
* <code>checkPropertyAccess</code> method doesn't allow
* access to the specified system property.
* @exception NullPointerException if <code>key</code> is
* <code>null</code>.
* @exception IllegalArgumentException if <code>key</code> is empty.
* @exception SecurityException if a security manager exists and its
* {@link SecurityManager#checkPropertyAccess(java.lang.String)} method doesn't allow
* accessing to the specified system property.
* @exception NullPointerException if {@code key} is {@code null}.
* @exception IllegalArgumentException if {@code key} is empty.
*/
@CheckForNull
public
static
String
getString
(
String
key
)
{
...
...
@@ -112,20 +112,19 @@ public class SystemProperties {
/**
* Gets the system property indicated by the specified key, or a default value.
* This behaves just like
<code>System.getProperty(String,String)</code>
, except
* that it also consults the
<code>ServletContext</code>
's "init" parameters.
* This behaves just like
{@link System#getProperty(java.lang.String, java.lang.String)}
, except
* that it also consults the
{@link ServletContext}
's "init" parameters.
*
* @param key the name of the system property.
* @param def a default value.
* @return the string value of the system property,
* or
<code>null</code>
if there is no property with that key.
* or
{@code null}
if there is no property with that key.
*
* @exception SecurityException if a security manager exists and its
*
<code>checkPropertyAccess</code>
method doesn't allow
*
{@link SecurityManager#checkPropertyAccess(java.lang.String)}
method doesn't allow
* access to the specified system property.
* @exception NullPointerException if <code>key</code> is
* <code>null</code>.
* @exception IllegalArgumentException if <code>key</code> is empty.
* @exception NullPointerException if {@code key} is {@code null}.
* @exception IllegalArgumentException if {@code key} is empty.
*/
@CheckForNull
public
static
String
getString
(
String
key
,
@CheckForNull
String
def
)
{
...
...
@@ -155,11 +154,11 @@ public class SystemProperties {
* Returns {@code true} if the system property
* named by the argument exists and is equal to the string
* {@code "true"}. If the system property does not exist, return
* {@code "false"}. if a property by this name exists in the
<code>ServletContext</code>
* {@code "false"}. if a property by this name exists in the
{@link ServletContext}
* and is equal to the string {@code "true"}.
*
* This behaves just like
<code>Boolean.getBoolean(String)</code>
, except that it
* also consults the
<code>ServletContext</code>
's "init" parameters.
* This behaves just like
{@link Boolean#getBoolean(java.lang.String)}
, except that it
* also consults the
{@link ServletContext}
's "init" parameters.
*
* @param name the system property name.
* @return the {@code boolean} value of the system property.
...
...
@@ -172,12 +171,12 @@ public class SystemProperties {
* Returns {@code true} if the system property
* named by the argument exists and is equal to the string
* {@code "true"}, or a default value. If the system property does not exist, return
* {@code "true"} if a property by this name exists in the
<code>ServletContext</code>
* {@code "true"} if a property by this name exists in the
{@link ServletContext}
* and is equal to the string {@code "true"}. If that property does not
* exist either, return the default value.
*
* This behaves just like
<code>Boolean.getBoolean(String)</code>
with a default
* value, except that it also consults the
<code>ServletContext</code>
's "init" parameters.
* This behaves just like
{@link Boolean#getBoolean(java.lang.String)}
with a default
* value, except that it also consults the
{@link ServletContext}
's "init" parameters.
*
* @param name the system property name.
* @param def a default value.
...
...
@@ -196,8 +195,8 @@ public class SystemProperties {
* Determines the integer value of the system property with the
* specified name.
*
* This behaves just like
<code>Integer.getInteger(String)</code>
, except that it
* also consults the
<code>ServletContext</code>
's "init" parameters.
* This behaves just like
{@link Integer#getInteger(java.lang.String)}
, except that it
* also consults the
{@link ServletContext}
's "init" parameters.
*
* @param name property name.
* @return the {@code Integer} value of the property.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录