Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7bc415b1
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7bc415b1
编写于
12月 05, 2008
作者:
T
tbell
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
823cc419
e7ea2e48
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
122 addition
and
48 deletion
+122
-48
src/share/classes/com/sun/servicetag/Installer.java
src/share/classes/com/sun/servicetag/Installer.java
+29
-24
src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java
.../classes/com/sun/servicetag/SolarisSystemEnvironment.java
+2
-2
src/share/classes/com/sun/servicetag/SunConnection.java
src/share/classes/com/sun/servicetag/SunConnection.java
+10
-4
src/share/classes/com/sun/servicetag/Util.java
src/share/classes/com/sun/servicetag/Util.java
+8
-5
src/share/classes/com/sun/servicetag/WindowsSystemEnvironment.java
.../classes/com/sun/servicetag/WindowsSystemEnvironment.java
+11
-5
src/share/classes/javax/crypto/Cipher.java
src/share/classes/javax/crypto/Cipher.java
+1
-1
src/share/classes/javax/management/MBeanServerNotification.java
...are/classes/javax/management/MBeanServerNotification.java
+61
-7
未找到文件。
src/share/classes/com/sun/servicetag/Installer.java
浏览文件 @
7bc415b1
...
...
@@ -475,7 +475,7 @@ public class Installer {
String
filename
=
"/com/sun/servicetag/resources/javase_"
+
version
+
"_swordfish.properties"
;
InputStream
in
=
Installer
.
class
.
get
Class
().
get
ResourceAsStream
(
filename
);
InputStream
in
=
Installer
.
class
.
getResourceAsStream
(
filename
);
if
(
in
==
null
)
{
return
null
;
}
...
...
@@ -813,7 +813,7 @@ public class Installer {
locale
,
String
.
valueOf
(
version
)).
toString
();
try
{
in
=
Installer
.
class
.
get
Class
().
get
ResourceAsStream
(
resource
+
".html"
);
in
=
Installer
.
class
.
getResourceAsStream
(
resource
+
".html"
);
if
(
in
==
null
)
{
// if the resource file is missing
if
(
isVerbose
())
{
...
...
@@ -825,34 +825,39 @@ public class Installer {
System
.
out
.
println
(
"Generating "
+
f
+
" from "
+
resource
+
".html"
);
}
br
=
new
BufferedReader
(
new
InputStreamReader
(
in
,
"UTF-8"
));
pw
=
new
PrintWriter
(
f
,
"UTF-8"
);
String
line
=
null
;
while
((
line
=
br
.
readLine
())
!=
null
)
{
String
output
=
line
;
if
(
line
.
contains
(
JDK_VERSION_KEY
))
{
output
=
line
.
replace
(
JDK_VERSION_KEY
,
jdkVersion
);
}
else
if
(
line
.
contains
(
JDK_HEADER_PNG_KEY
))
{
output
=
line
.
replace
(
JDK_HEADER_PNG_KEY
,
headerImageSrc
);
}
else
if
(
line
.
contains
(
REGISTRATION_URL_KEY
))
{
output
=
line
.
replace
(
REGISTRATION_URL_KEY
,
registerURL
);
}
else
if
(
line
.
contains
(
REGISTRATION_PAYLOAD_KEY
))
{
output
=
line
.
replace
(
REGISTRATION_PAYLOAD_KEY
,
payload
.
toString
());
try
{
br
=
new
BufferedReader
(
new
InputStreamReader
(
in
,
"UTF-8"
));
pw
=
new
PrintWriter
(
f
,
"UTF-8"
);
String
line
=
null
;
while
((
line
=
br
.
readLine
())
!=
null
)
{
String
output
=
line
;
if
(
line
.
contains
(
JDK_VERSION_KEY
))
{
output
=
line
.
replace
(
JDK_VERSION_KEY
,
jdkVersion
);
}
else
if
(
line
.
contains
(
JDK_HEADER_PNG_KEY
))
{
output
=
line
.
replace
(
JDK_HEADER_PNG_KEY
,
headerImageSrc
);
}
else
if
(
line
.
contains
(
REGISTRATION_URL_KEY
))
{
output
=
line
.
replace
(
REGISTRATION_URL_KEY
,
registerURL
);
}
else
if
(
line
.
contains
(
REGISTRATION_PAYLOAD_KEY
))
{
output
=
line
.
replace
(
REGISTRATION_PAYLOAD_KEY
,
payload
.
toString
());
}
pw
.
println
(
output
);
}
f
.
setReadOnly
();
pw
.
flush
();
}
finally
{
// It's safe for this finally block to have two close statements
// consecutively as PrintWriter.close doesn't throw IOException.
if
(
pw
!=
null
)
{
pw
.
close
();
}
if
(
br
!=
null
)
{
br
.
close
();
}
pw
.
println
(
output
);
}
f
.
setReadOnly
();
pw
.
flush
();
}
finally
{
if
(
pw
!=
null
)
{
pw
.
close
();
}
if
(
in
!=
null
)
{
in
.
close
();
}
if
(
br
!=
null
)
{
br
.
close
();
}
}
}
}
...
...
src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java
浏览文件 @
7bc415b1
...
...
@@ -62,8 +62,8 @@ class SolarisSystemEnvironment extends SystemEnvironment {
return
"Sun Microsystems, Inc"
;
}
// if we're here, then we'll try smbios (type
3
)
return
getSmbiosData
(
"
3
"
,
"Manufacturer: "
);
// if we're here, then we'll try smbios (type
4
)
return
getSmbiosData
(
"
4
"
,
"Manufacturer: "
);
}
/**
...
...
src/share/classes/com/sun/servicetag/SunConnection.java
浏览文件 @
7bc415b1
...
...
@@ -213,10 +213,16 @@ class SunConnection {
con
.
setRequestProperty
(
"Content-Type"
,
"text/xml;charset=\"utf-8\""
);
con
.
connect
();
OutputStream
out
=
con
.
getOutputStream
();
registration
.
storeToXML
(
out
);
out
.
flush
();
out
.
close
();
OutputStream
out
=
null
;
try
{
out
=
con
.
getOutputStream
();
registration
.
storeToXML
(
out
);
out
.
flush
();
}
finally
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
int
returnCode
=
con
.
getResponseCode
();
if
(
Util
.
isVerbose
())
{
...
...
src/share/classes/com/sun/servicetag/Util.java
浏览文件 @
7bc415b1
...
...
@@ -140,11 +140,14 @@ class Util {
}
return
e
.
getMessage
();
}
finally
{
if
(
r
!=
null
)
{
r
.
close
();
}
if
(
err
!=
null
)
{
err
.
close
();
try
{
if
(
r
!=
null
)
{
r
.
close
();
}
}
finally
{
if
(
err
!=
null
)
{
err
.
close
();
}
}
}
}
...
...
src/share/classes/com/sun/servicetag/WindowsSystemEnvironment.java
浏览文件 @
7bc415b1
...
...
@@ -107,11 +107,17 @@ class WindowsSystemEnvironment extends SystemEnvironment {
Process
p
=
pb
.
start
();
// need this for executing windows commands (at least
// needed for executing wmic command)
BufferedWriter
bw
=
new
BufferedWriter
(
new
OutputStreamWriter
(
p
.
getOutputStream
()));
bw
.
write
(
13
);
bw
.
flush
();
bw
.
close
();
BufferedWriter
bw
=
null
;
try
{
bw
=
new
BufferedWriter
(
new
OutputStreamWriter
(
p
.
getOutputStream
()));
bw
.
write
(
13
);
bw
.
flush
();
}
finally
{
if
(
bw
!=
null
)
{
bw
.
close
();
}
}
p
.
waitFor
();
if
(
p
.
exitValue
()
==
0
)
{
...
...
src/share/classes/javax/crypto/Cipher.java
浏览文件 @
7bc415b1
...
...
@@ -2377,7 +2377,7 @@ public class Cipher {
* For more information on default key size in JCE jurisdiction
* policy files, please see Appendix E in the
* <a href=
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#App
E
">
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#App
C
">
* Java Cryptography Architecture Reference Guide</a>.
*
* @param transformation the cipher transformation.
...
...
src/share/classes/javax/management/MBeanServerNotification.java
浏览文件 @
7bc415b1
...
...
@@ -57,15 +57,55 @@ package javax.management;
* what = "Unknown type " + n.getType();
* System.out.println("Received MBean Server notification: " + what + ": " +
* mbsn.getMBeanName());
* }
* };
*
* ...
* mbeanServer.addNotificationListener(
* MBeanServerDelegate.DELEGATE_NAME, printListener, null, null);
* </pre>
*
* <p>The following code prints a message every time an MBean is registered
* or unregistered in the MBean Server {@code mbeanServer}:</p>
* <p id="group">
* An MBean which is not an {@link MBeanServerDelegate} may also emit
* MBeanServerNotifications. In particular, a custom subclass of the
* {@link javax.management.namespace.JMXDomain JMXDomain} MBean or a custom
* subclass of the {@link javax.management.namespace.JMXNamespace JMXNamespace}
* MBean may emit an MBeanServerNotification for a group of MBeans.<br>
* An MBeanServerNotification emitted to denote the registration or
* unregistration of a group of MBeans has the following characteristics:
* <ul><li>Its {@linkplain Notification#getType() notification type} is
* {@code "JMX.mbean.registered.group"} or
* {@code "JMX.mbean.unregistered.group"}, which can also be written {@link
* MBeanServerNotification#REGISTRATION_NOTIFICATION}{@code + ".group"} or
* {@link
* MBeanServerNotification#UNREGISTRATION_NOTIFICATION}{@code + ".group"}.
* </li>
* <li>Its {@linkplain #getMBeanName() MBean name} is an ObjectName pattern
* that selects the set (or a superset) of the MBeans being registered
* or unregistered</li>
* <li>Its {@linkplain Notification#getUserData() user data} can optionally
* be set to an array of ObjectNames containing the names of all MBeans
* being registered or unregistered.</li>
* </ul>
* </p>
* <p>
* MBeans which emit these group registration/unregistration notifications will
* declare them in their {@link MBeanInfo#getNotifications()
* MBeanNotificationInfo}.
* </p>
* <P>
* To receive a group MBeanServerNotification, you need to register a listener
* with the MBean that emits it. For instance, assuming that the {@link
* javax.management.namespace.JMXNamespace JMXNamespace} MBean handling
* namespace {@code "foo"} has declared that it emits such a notification,
* you will need to register your notification listener with that MBean, which
* will be named {@link
* javax.management.namespace.JMXNamespaces#getNamespaceObjectName(java.lang.String)
* foo//:type=JMXNamespace}.
* </p>
* <p>The following code prints a message every time a group of MBean is
* registered or unregistered in the namespace {@code "foo"}, assumimg its
* {@link javax.management.namespace.JMXNamespace handler} supports
* group MBeanServerNotifications:</p>
*
* <pre>
* private static final NotificationListener printListener = new NotificationListener() {
...
...
@@ -76,19 +116,33 @@ package javax.management;
* }
* MBeanServerNotification mbsn = (MBeanServerNotification) n;
* String what;
* if (n.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION))
* ObjectName[] names = null;
* if (n.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION)) {
* what = "MBean registered";
*
else if (n.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION))
*
} else if (n.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
* what = "MBean unregistered";
* else
* } else if (n.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION+".group")) {
* what = "Group of MBeans registered matching";
* if (mbsn.getUserData() instanceof ObjectName[])
* names = (ObjectName[]) mbsn.getUserData();
* } else if (n.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION+".group")) {
* what = "Group of MBeans unregistered matching";
* if (mbsn.getUserData() instanceof ObjectName[])
* names = (ObjectName[]) mbsn.getUserData();
* } else
* what = "Unknown type " + n.getType();
* System.out.println("Received MBean Server notification: " + what + ": " +
* mbsn.getMBeanName());
* if (names != null) {
* for (ObjectName mb : names)
* System.out.println("\t"+mb);
* }
* }
* };
*
* ...
* mbeanServer.addNotificationListener(
*
MBeanServerDelegate.DELEGATE_NAME
, printListener, null, null);
*
JMXNamespaces.getNamespaceObjectName("foo")
, printListener, null, null);
* </pre>
*
* @since 1.5
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录