Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8580fa1f
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
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看板
提交
8580fa1f
编写于
5月 22, 2008
作者:
T
tbell
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
6f6e9d4c
04964bc7
变更
41
隐藏空白更改
内联
并排
Showing
41 changed file
with
285 addition
and
249 deletion
+285
-249
src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java
...om/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java
+4
-9
src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
...re/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
+5
-6
src/share/classes/com/sun/jmx/mbeanserver/Repository.java
src/share/classes/com/sun/jmx/mbeanserver/Repository.java
+5
-9
src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
...ses/com/sun/jmx/remote/internal/ClientNotifForwarder.java
+0
-4
src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java
...ses/com/sun/jmx/remote/internal/ServerNotifForwarder.java
+3
-3
src/share/classes/com/sun/jmx/remote/security/FileLoginModule.java
.../classes/com/sun/jmx/remote/security/FileLoginModule.java
+9
-5
src/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java
...om/sun/jmx/remote/security/JMXPluggableAuthenticator.java
+1
-1
src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
.../jmx/remote/security/MBeanServerFileAccessController.java
+7
-4
src/share/classes/javax/management/NumericValueExp.java
src/share/classes/javax/management/NumericValueExp.java
+3
-3
src/share/classes/javax/management/ObjectName.java
src/share/classes/javax/management/ObjectName.java
+2
-2
src/share/classes/javax/management/StandardMBean.java
src/share/classes/javax/management/StandardMBean.java
+1
-1
src/share/classes/javax/management/loading/MLet.java
src/share/classes/javax/management/loading/MLet.java
+15
-26
src/share/classes/javax/management/loading/MLetParser.java
src/share/classes/javax/management/loading/MLetParser.java
+1
-3
src/share/classes/javax/management/modelmbean/DescriptorSupport.java
...lasses/javax/management/modelmbean/DescriptorSupport.java
+4
-8
src/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java
.../javax/management/modelmbean/ModelMBeanAttributeInfo.java
+1
-1
src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java
...avax/management/modelmbean/ModelMBeanConstructorInfo.java
+1
-1
src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java
...es/javax/management/modelmbean/ModelMBeanInfoSupport.java
+1
-1
src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java
...vax/management/modelmbean/ModelMBeanNotificationInfo.java
+1
-1
src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java
.../javax/management/modelmbean/ModelMBeanOperationInfo.java
+1
-1
src/share/classes/javax/management/modelmbean/RequiredModelMBean.java
...asses/javax/management/modelmbean/RequiredModelMBean.java
+11
-16
src/share/classes/javax/management/monitor/CounterMonitor.java
...hare/classes/javax/management/monitor/CounterMonitor.java
+8
-8
src/share/classes/javax/management/monitor/GaugeMonitor.java
src/share/classes/javax/management/monitor/GaugeMonitor.java
+12
-12
src/share/classes/javax/management/monitor/Monitor.java
src/share/classes/javax/management/monitor/Monitor.java
+4
-4
src/share/classes/javax/management/openmbean/ArrayType.java
src/share/classes/javax/management/openmbean/ArrayType.java
+1
-1
src/share/classes/javax/management/openmbean/CompositeType.java
...are/classes/javax/management/openmbean/CompositeType.java
+1
-1
src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java
...x/management/openmbean/OpenMBeanAttributeInfoSupport.java
+0
-1
src/share/classes/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java
...management/openmbean/OpenMBeanConstructorInfoSupport.java
+1
-1
src/share/classes/javax/management/openmbean/OpenMBeanInfoSupport.java
...sses/javax/management/openmbean/OpenMBeanInfoSupport.java
+1
-1
src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java
...x/management/openmbean/OpenMBeanOperationInfoSupport.java
+1
-1
src/share/classes/javax/management/openmbean/SimpleType.java
src/share/classes/javax/management/openmbean/SimpleType.java
+1
-1
src/share/classes/javax/management/openmbean/TabularType.java
...share/classes/javax/management/openmbean/TabularType.java
+1
-1
src/share/classes/javax/management/relation/RelationNotification.java
...asses/javax/management/relation/RelationNotification.java
+3
-3
src/share/classes/javax/management/relation/RelationService.java
...re/classes/javax/management/relation/RelationService.java
+31
-46
src/share/classes/javax/management/relation/RelationSupport.java
...re/classes/javax/management/relation/RelationSupport.java
+15
-22
src/share/classes/javax/management/remote/JMXConnectorFactory.java
.../classes/javax/management/remote/JMXConnectorFactory.java
+2
-2
src/share/classes/javax/management/remote/JMXConnectorServerFactory.java
...es/javax/management/remote/JMXConnectorServerFactory.java
+2
-4
src/share/classes/javax/management/remote/JMXServiceURL.java
src/share/classes/javax/management/remote/JMXServiceURL.java
+0
-7
src/share/classes/javax/management/remote/rmi/RMIConnector.java
...are/classes/javax/management/remote/rmi/RMIConnector.java
+5
-5
src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java
...asses/javax/management/remote/rmi/RMIConnectorServer.java
+1
-1
src/share/classes/javax/management/timer/Timer.java
src/share/classes/javax/management/timer/Timer.java
+7
-22
test/javax/management/relation/RelationNotificationSeqNoTest.java
...ax/management/relation/RelationNotificationSeqNoTest.java
+112
-0
未找到文件。
src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java
浏览文件 @
8580fa1f
...
...
@@ -233,7 +233,6 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
MBeanRegistrationException
,
MBeanException
,
NotCompliantMBeanException
,
InstanceNotFoundException
{
ObjectName
logicalName
=
name
;
Class
theClass
;
if
(
className
==
null
)
{
...
...
@@ -519,8 +518,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
QueryExp
query
)
{
// Query the MBeans on the repository
//
Set
<
NamedObject
>
list
=
null
;
list
=
repository
.
query
(
name
,
query
);
Set
<
NamedObject
>
list
=
repository
.
query
(
name
,
query
);
if
(
queryByRepo
)
{
// The repository performs the filtering
...
...
@@ -576,8 +574,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
private
Set
<
ObjectName
>
queryNamesImpl
(
ObjectName
name
,
QueryExp
query
)
{
// Query the MBeans on the repository
//
Set
<
NamedObject
>
list
=
null
;
list
=
repository
.
query
(
name
,
query
);
Set
<
NamedObject
>
list
=
repository
.
query
(
name
,
query
);
if
(
queryByRepo
)
{
// The repository performs the filtering
...
...
@@ -1042,7 +1039,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
if
(
registerFailed
&&
moi
instanceof
DynamicMBean2
)
((
DynamicMBean2
)
moi
).
registerFailed
();
try
{
moi
.
postRegister
(
new
Boolean
(
registrationDone
)
);
moi
.
postRegister
(
registrationDone
);
}
catch
(
RuntimeException
e
)
{
throw
new
RuntimeMBeanException
(
e
,
"RuntimeException thrown in postRegister method"
);
...
...
@@ -1094,8 +1091,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
IllegalArgumentException
(
"Object name cannot be null"
),
"Exception occurred trying to get an MBean"
);
}
DynamicMBean
obj
=
null
;
obj
=
repository
.
retrieve
(
name
);
DynamicMBean
obj
=
repository
.
retrieve
(
name
);
if
(
obj
==
null
)
{
if
(
MBEANSERVER_LOGGER
.
isLoggable
(
Level
.
FINER
))
{
MBEANSERVER_LOGGER
.
logp
(
Level
.
FINER
,
...
...
@@ -1568,7 +1564,6 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
query
.
setMBeanServer
(
server
);
try
{
for
(
NamedObject
no
:
list
)
{
final
DynamicMBean
obj
=
no
.
getObject
();
boolean
res
;
try
{
res
=
query
.
apply
(
no
.
getName
());
...
...
src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
浏览文件 @
8580fa1f
...
...
@@ -205,7 +205,7 @@ public class MBeanInstantiator {
*/
public
Object
instantiate
(
Class
theClass
)
throws
ReflectionException
,
MBeanException
{
Object
moi
=
null
;
Object
moi
;
// ------------------------------
...
...
@@ -265,7 +265,7 @@ public class MBeanInstantiator {
// ------------------------------
// ------------------------------
final
Class
[]
tab
;
Object
moi
=
null
;
Object
moi
;
try
{
// Build the signature of the method
//
...
...
@@ -283,8 +283,7 @@ public class MBeanInstantiator {
}
// Query the metadata service to get the right constructor
Constructor
cons
=
null
;
cons
=
findConstructor
(
theClass
,
tab
);
Constructor
cons
=
findConstructor
(
theClass
,
tab
);
if
(
cons
==
null
)
{
throw
new
ReflectionException
(
new
...
...
@@ -408,7 +407,7 @@ public class MBeanInstantiator {
throw
new
RuntimeOperationsException
(
new
IllegalArgumentException
(),
"Null className passed in parameter"
);
}
Class
theClass
=
null
;
Class
theClass
;
if
(
loaderName
==
null
)
{
// Load the class using the agent class loader
theClass
=
findClass
(
className
,
loader
);
...
...
@@ -621,7 +620,7 @@ public class MBeanInstantiator {
static
Class
loadClass
(
String
className
,
ClassLoader
loader
)
throws
ReflectionException
{
Class
theClass
=
null
;
Class
theClass
;
if
(
className
==
null
)
{
throw
new
RuntimeOperationsException
(
new
IllegalArgumentException
(
"The class name cannot be null"
),
...
...
src/share/classes/com/sun/jmx/mbeanserver/Repository.java
浏览文件 @
8580fa1f
...
...
@@ -89,7 +89,6 @@ public class Repository {
/* This class is used to match an ObjectName against a pattern. */
private
final
static
class
ObjectNamePattern
{
private
final
char
[]
domain
;
private
final
String
[]
keys
;
private
final
String
[]
values
;
private
final
String
properties
;
...
...
@@ -106,8 +105,7 @@ public class Repository {
* @param pattern The ObjectName pattern under examination.
**/
public
ObjectNamePattern
(
ObjectName
pattern
)
{
this
(
pattern
.
getDomain
(),
pattern
.
isPropertyListPattern
(),
this
(
pattern
.
isPropertyListPattern
(),
pattern
.
isPropertyValuePattern
(),
pattern
.
getCanonicalKeyPropertyListString
(),
pattern
.
getKeyPropertyList
(),
...
...
@@ -124,13 +122,11 @@ public class Repository {
* @param keyPropertyList pattern.getKeyPropertyList().
* @param pattern The ObjectName pattern under examination.
**/
ObjectNamePattern
(
String
domain
,
boolean
propertyListPattern
,
ObjectNamePattern
(
boolean
propertyListPattern
,
boolean
propertyValuePattern
,
String
canonicalProps
,
Map
<
String
,
String
>
keyPropertyList
,
ObjectName
pattern
)
{
this
.
domain
=
domain
.
toCharArray
();
this
.
isPropertyListPattern
=
propertyListPattern
;
this
.
isPropertyValuePattern
=
propertyValuePattern
;
this
.
properties
=
canonicalProps
;
...
...
@@ -538,7 +534,7 @@ public class Repository {
// "domain:*", "domain:[key=value],*" : names in the specified domain
// Surely one of the most frequent case ... query on the whole world
ObjectName
name
=
null
;
ObjectName
name
;
if
(
pattern
==
null
||
pattern
.
getCanonicalName
().
length
()
==
0
||
pattern
.
equals
(
ObjectName
.
WILDCARD
))
...
...
@@ -660,7 +656,7 @@ public class Repository {
* @return Number of MBeans.
*/
public
Integer
getCount
()
{
return
n
ew
Integer
(
nbElements
)
;
return
n
bElements
;
}
/**
...
...
@@ -669,7 +665,7 @@ public class Repository {
*
* @return A string giving the name of the default domain name.
*/
public
String
getDefaultDomain
()
{
public
String
getDefaultDomain
()
{
return
domain
;
}
...
...
src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
浏览文件 @
8580fa1f
...
...
@@ -435,7 +435,6 @@ public abstract class ClientNotifForwarder {
clientSequenceNumber
=
nr
.
getNextSequenceNumber
();
final
int
size
=
infoList
.
size
();
listeners
=
new
HashMap
<
Integer
,
ClientListenerInfo
>();
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
...
...
@@ -792,9 +791,6 @@ public abstract class ClientNotifForwarder {
private
Thread
currentFetchThread
;
// admin stuff
private
boolean
inited
=
false
;
// state
/**
* This state means that a thread is being created for fetching and forwarding notifications.
...
...
src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java
浏览文件 @
8580fa1f
...
...
@@ -269,7 +269,7 @@ public class ServerNotifForwarder {
", the maxNotifications is "
+
maxNotifications
);
}
NotificationResult
nr
=
null
;
NotificationResult
nr
;
final
long
t
=
Math
.
min
(
connectionTimeout
,
timeout
);
try
{
nr
=
notifBuffer
.
fetchNotifications
(
bufferFilter
,
...
...
@@ -322,7 +322,7 @@ public class ServerNotifForwarder {
private
Integer
getListenerID
()
{
synchronized
(
listenerCounterLock
)
{
return
new
Integer
(
listenerCounter
++)
;
return
listenerCounter
++
;
}
}
...
...
@@ -336,7 +336,7 @@ public class ServerNotifForwarder {
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
AccessControlContext
acc
=
AccessController
.
getContext
();
ObjectInstance
oi
=
null
;
ObjectInstance
oi
;
try
{
oi
=
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
ObjectInstance
>()
{
...
...
src/share/classes/com/sun/jmx/remote/security/FileLoginModule.java
浏览文件 @
8580fa1f
...
...
@@ -437,7 +437,7 @@ public class FileLoginModule implements LoginModule {
// get the username and password
getUsernamePassword
(
usePasswdFromSharedState
);
String
localPassword
=
null
;
String
localPassword
;
// userCredentials is initialized in login()
if
(((
localPassword
=
userCredentials
.
getProperty
(
username
))
==
null
)
||
...
...
@@ -487,10 +487,14 @@ public class FileLoginModule implements LoginModule {
throw
ace
;
}
}
BufferedInputStream
bis
=
new
BufferedInputStream
(
fis
);
userCredentials
=
new
Properties
();
userCredentials
.
load
(
bis
);
bis
.
close
();
try
{
BufferedInputStream
bis
=
new
BufferedInputStream
(
fis
);
userCredentials
=
new
Properties
();
userCredentials
.
load
(
bis
);
bis
.
close
();
}
finally
{
fis
.
close
();
}
}
/**
...
...
src/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java
浏览文件 @
8580fa1f
...
...
@@ -295,7 +295,7 @@ private final class JMXCallbackHandler implements CallbackHandler {
private
static
class
FileLoginConfig
extends
Configuration
{
// The JAAS configuration for file-based authentication
private
static
AppConfigurationEntry
[]
entries
;
private
AppConfigurationEntry
[]
entries
;
// The classname of the login module for file-based authentication
private
static
final
String
FILE_LOGIN_MODULE
=
...
...
src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
浏览文件 @
8580fa1f
...
...
@@ -231,10 +231,13 @@ public class MBeanServerFileAccessController
private
static
Properties
propertiesFromFile
(
String
fname
)
throws
IOException
{
FileInputStream
fin
=
new
FileInputStream
(
fname
);
Properties
p
=
new
Properties
();
p
.
load
(
fin
);
fin
.
close
();
return
p
;
try
{
Properties
p
=
new
Properties
();
p
.
load
(
fin
);
return
p
;
}
finally
{
fin
.
close
();
}
}
private
void
checkAccessLevel
(
String
accessLevel
)
{
...
...
src/share/classes/javax/management/NumericValueExp.java
浏览文件 @
8580fa1f
...
...
@@ -83,7 +83,7 @@ class NumericValueExp extends QueryEval implements ValueExp {
* <p>The <b>serialVersionUID</b> of this class is <code>-4679739485102359104L</code>.
*/
private
static
final
ObjectStreamField
[]
serialPersistentFields
;
private
Number
val
=
new
Double
(
0
)
;
private
Number
val
=
0.0
;
private
static
boolean
compat
=
false
;
static
{
...
...
@@ -213,11 +213,11 @@ class NumericValueExp extends QueryEval implements ValueExp {
}
if
(
isLong
)
{
this
.
val
=
new
Long
(
longVal
)
;
this
.
val
=
longVal
;
}
else
{
this
.
val
=
new
Double
(
doubleVal
)
;
this
.
val
=
doubleVal
;
}
}
else
...
...
src/share/classes/javax/management/ObjectName.java
浏览文件 @
8580fa1f
...
...
@@ -449,7 +449,7 @@ public class ObjectName implements Comparable<ObjectName>, QueryExp {
// parses domain part
domain_parsing:
while
(
index
<
len
)
{
switch
(
c
=
name_chars
[
index
])
{
switch
(
name_chars
[
index
])
{
case
':'
:
_domain_length
=
index
++;
break
domain_parsing
;
...
...
@@ -619,7 +619,7 @@ public class ObjectName implements Comparable<ObjectName>, QueryExp {
case
'\n'
:
final
String
ichar
=
((
c1
==
'\n'
)?
"\\n"
:
""
+
c1
);
throw
new
MalformedObjectNameException
(
"Invalid character '"
+
c1
+
"Invalid character '"
+
ichar
+
"' in value part of property"
);
default
:
in_index
++;
...
...
src/share/classes/javax/management/StandardMBean.java
浏览文件 @
8580fa1f
...
...
@@ -750,7 +750,7 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration {
* @return the Descriptor for the new MBeanInfo.
*/
Descriptor
getDescriptor
(
MBeanInfo
info
,
boolean
immutableInfo
)
{
ImmutableDescriptor
desc
=
null
;
ImmutableDescriptor
desc
;
if
(
info
==
null
||
info
.
getDescriptor
()
==
null
||
info
.
getDescriptor
().
getFieldNames
().
length
==
0
)
{
...
...
src/share/classes/javax/management/loading/MLet.java
浏览文件 @
8580fa1f
...
...
@@ -591,8 +591,8 @@ public class MLet extends java.net.URLClassLoader
// Instantiate the class specified in the
// CODE or OBJECT section of the MLet tag
//
Object
o
=
null
;
ObjectInstance
objInst
=
null
;
Object
o
;
ObjectInstance
objInst
;
if
(
code
!=
null
&&
serName
!=
null
)
{
final
String
msg
=
...
...
@@ -1131,11 +1131,17 @@ public class MLet extends java.net.URLClassLoader
return
null
;
}
finally
{
// Cleanup ...
if
(
tmpFile
!=
null
)
try
{
tmpFile
.
delete
();
}
catch
(
Exception
x
)
{
MLET_LOGGER
.
logp
(
Level
.
FINEST
,
MLet
.
class
.
getName
(),
"getTmpDir"
,
"Failed to delete temporary file"
,
x
);
if
(
tmpFile
!=
null
)
{
try
{
boolean
deleted
=
tmpFile
.
delete
();
if
(!
deleted
)
{
MLET_LOGGER
.
logp
(
Level
.
FINEST
,
MLet
.
class
.
getName
(),
"getTmpDir"
,
"Failed to delete temp file"
);
}
}
catch
(
Exception
x
)
{
MLET_LOGGER
.
logp
(
Level
.
FINEST
,
MLet
.
class
.
getName
(),
"getTmpDir"
,
"Failed to delete temporary file"
,
x
);
}
}
}
}
...
...
@@ -1178,25 +1184,8 @@ public class MLet extends java.net.URLClassLoader
* Removes any white space from a string. This is used to
* convert strings such as "Windows NT" to "WindowsNT".
*/
private
String
removeSpace
(
String
s
)
{
s
=
s
.
trim
();
int
j
=
s
.
indexOf
(
' '
);
if
(
j
==
-
1
)
{
return
s
;
}
String
temp
=
""
;
int
k
=
0
;
while
(
j
!=
-
1
)
{
s
=
s
.
substring
(
k
);
j
=
s
.
indexOf
(
' '
);
if
(
j
!=
-
1
)
{
temp
=
temp
+
s
.
substring
(
0
,
j
);
}
else
{
temp
=
temp
+
s
.
substring
(
0
);
}
k
=
j
+
1
;
}
return
temp
;
private
static
String
removeSpace
(
String
s
)
{
return
s
.
trim
().
replace
(
" "
,
""
);
}
/**
...
...
src/share/classes/javax/management/loading/MLetParser.java
浏览文件 @
8580fa1f
...
...
@@ -240,14 +240,12 @@ class MLetParser {
MLET_LOGGER
.
logp
(
Level
.
FINER
,
MLetParser
.
class
.
getName
(),
mth
,
requiresCodeWarning
);
atts
=
null
;
throw
new
IOException
(
requiresCodeWarning
);
}
if
(
atts
.
get
(
"archive"
)
==
null
)
{
MLET_LOGGER
.
logp
(
Level
.
FINER
,
MLetParser
.
class
.
getName
(),
mth
,
requiresJarsWarning
);
atts
=
null
;
throw
new
IOException
(
requiresJarsWarning
);
}
}
...
...
@@ -265,7 +263,7 @@ class MLetParser {
public
List
<
MLetContent
>
parseURL
(
String
urlname
)
throws
IOException
{
// Parse the document
//
URL
url
=
null
;
URL
url
;
if
(
urlname
.
indexOf
(
':'
)
<=
1
)
{
String
userDir
=
System
.
getProperty
(
"user.dir"
);
String
prot
;
...
...
src/share/classes/javax/management/modelmbean/DescriptorSupport.java
浏览文件 @
8580fa1f
...
...
@@ -591,8 +591,6 @@ public class DescriptorSupport
Set
returnedSet
=
descriptorMap
.
entrySet
();
int
i
=
0
;
Object
currValue
=
null
;
Map
.
Entry
currElement
=
null
;
if
(
MODELMBEAN_LOGGER
.
isLoggable
(
Level
.
FINEST
))
{
MODELMBEAN_LOGGER
.
logp
(
Level
.
FINEST
,
...
...
@@ -600,7 +598,7 @@ public class DescriptorSupport
"getFields()"
,
"Returning "
+
numberOfEntries
+
" fields"
);
}
for
(
Iterator
iter
=
returnedSet
.
iterator
();
iter
.
hasNext
();
i
++)
{
currElement
=
(
Map
.
Entry
)
iter
.
next
();
Map
.
Entry
currElement
=
(
Map
.
Entry
)
iter
.
next
();
if
(
currElement
==
null
)
{
if
(
MODELMBEAN_LOGGER
.
isLoggable
(
Level
.
FINEST
))
{
...
...
@@ -609,7 +607,7 @@ public class DescriptorSupport
"getFields()"
,
"Element is null"
);
}
}
else
{
currValue
=
currElement
.
getValue
();
Object
currValue
=
currElement
.
getValue
();
if
(
currValue
==
null
)
{
responseFields
[
i
]
=
currElement
.
getKey
()
+
"="
;
}
else
{
...
...
@@ -1127,7 +1125,7 @@ public class DescriptorSupport
final
char
c
=
entities
[
i
].
charAt
(
0
);
final
String
entity
=
entities
[
i
].
substring
(
1
);
charToEntityMap
[
c
]
=
entity
;
entityToCharMap
.
put
(
entity
,
new
Character
(
c
)
);
entityToCharMap
.
put
(
entity
,
c
);
}
}
...
...
@@ -1325,13 +1323,11 @@ public class DescriptorSupport
// utility to convert to int, returns -2 if bogus.
private
long
toNumeric
(
String
inStr
)
{
long
result
=
-
2
;
try
{
re
sult
=
java
.
lang
.
Long
.
parseLong
(
inStr
);
re
turn
java
.
lang
.
Long
.
parseLong
(
inStr
);
}
catch
(
Exception
e
)
{
return
-
2
;
}
return
result
;
}
...
...
src/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java
浏览文件 @
8580fa1f
...
...
@@ -432,7 +432,7 @@ public class ModelMBeanAttributeInfo
*/
private
Descriptor
validDescriptor
(
final
Descriptor
in
)
throws
RuntimeOperationsException
{
Descriptor
clone
=
null
;
Descriptor
clone
;
if
(
in
==
null
)
{
clone
=
new
DescriptorSupport
();
MODELMBEAN_LOGGER
.
finer
(
"Null Descriptor, creating new."
);
...
...
src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java
浏览文件 @
8580fa1f
...
...
@@ -393,7 +393,7 @@ public class ModelMBeanConstructorInfo
* @exception RuntimeOperationsException if Descriptor is invalid
*/
private
Descriptor
validDescriptor
(
final
Descriptor
in
)
throws
RuntimeOperationsException
{
Descriptor
clone
=
null
;
Descriptor
clone
;
if
(
in
==
null
)
{
clone
=
new
DescriptorSupport
();
MODELMBEAN_LOGGER
.
finer
(
"Null Descriptor, creating new."
);
...
...
src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java
浏览文件 @
8580fa1f
...
...
@@ -944,7 +944,7 @@ public class ModelMBeanInfoSupport extends MBeanInfo implements ModelMBeanInfo {
* @exception RuntimeOperationsException if Descriptor is invalid
*/
private
Descriptor
validDescriptor
(
final
Descriptor
in
)
throws
RuntimeOperationsException
{
Descriptor
clone
=
null
;
Descriptor
clone
;
if
(
in
==
null
)
{
clone
=
new
DescriptorSupport
();
MODELMBEAN_LOGGER
.
finer
(
"Null Descriptor, creating new."
);
...
...
src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java
浏览文件 @
8580fa1f
...
...
@@ -328,7 +328,7 @@ public class ModelMBeanNotificationInfo
* @exception RuntimeOperationsException if Descriptor is invalid
*/
private
Descriptor
validDescriptor
(
final
Descriptor
in
)
throws
RuntimeOperationsException
{
Descriptor
clone
=
null
;
Descriptor
clone
;
if
(
in
==
null
)
{
clone
=
new
DescriptorSupport
();
MODELMBEAN_LOGGER
.
finer
(
"Null Descriptor, creating new."
);
...
...
src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java
浏览文件 @
8580fa1f
...
...
@@ -424,7 +424,7 @@ public class ModelMBeanOperationInfo extends MBeanOperationInfo
*/
private
Descriptor
validDescriptor
(
final
Descriptor
in
)
throws
RuntimeOperationsException
{
Descriptor
clone
=
null
;
Descriptor
clone
;
if
(
in
==
null
)
{
clone
=
new
DescriptorSupport
();
MODELMBEAN_LOGGER
.
finer
(
"Null Descriptor, creating new."
);
...
...
src/share/classes/javax/management/modelmbean/RequiredModelMBean.java
浏览文件 @
8580fa1f
...
...
@@ -1425,9 +1425,7 @@ public class RequiredModelMBean
}
/* Check attributeDescriptor for getMethod */
ModelMBeanAttributeInfo
attrInfo
=
null
;
Descriptor
attrDescr
=
null
;
Object
response
=
null
;
Object
response
;
try
{
if
(
modelMBeanInfo
==
null
)
...
...
@@ -1435,14 +1433,14 @@ public class RequiredModelMBean
"getAttribute failed: ModelMBeanInfo not found for "
+
attrName
);
attrInfo
=
modelMBeanInfo
.
getAttribute
(
attrName
);
ModelMBeanAttributeInfo
attrInfo
=
modelMBeanInfo
.
getAttribute
(
attrName
);
Descriptor
mmbDesc
=
modelMBeanInfo
.
getMBeanDescriptor
();
if
(
attrInfo
==
null
)
throw
new
AttributeNotFoundException
(
"getAttribute failed:"
+
" ModelMBeanAttributeInfo not found for "
+
attrName
);
attrDescr
=
attrInfo
.
getDescriptor
();
Descriptor
attrDescr
=
attrInfo
.
getDescriptor
();
if
(
attrDescr
!=
null
)
{
if
(!
attrInfo
.
isReadable
())
throw
new
AttributeNotFoundException
(
...
...
@@ -1684,14 +1682,13 @@ public class RequiredModelMBean
"getAttributes(String[])"
,
"Entry"
);
}
AttributeList
responseList
=
null
;
if
(
attrNames
==
null
)
throw
new
RuntimeOperationsException
(
new
IllegalArgumentException
(
"attributeNames must not be null"
),
"Exception occurred trying to get attributes of a "
+
"RequiredModelMBean"
);
responseList
=
new
AttributeList
();
AttributeList
responseList
=
new
AttributeList
();
for
(
int
i
=
0
;
i
<
attrNames
.
length
;
i
++)
{
try
{
responseList
.
add
(
new
Attribute
(
attrNames
[
i
],
...
...
@@ -1833,8 +1830,6 @@ public class RequiredModelMBean
throw
new
AttributeNotFoundException
(
"setAttribute failed: "
+
attrName
+
" is not writable "
);
Object
setResponse
=
null
;
String
attrSetMethod
=
(
String
)
(
attrDescr
.
getFieldValue
(
"setMethod"
));
String
attrGetMethod
=
(
String
)
...
...
@@ -1873,9 +1868,9 @@ public class RequiredModelMBean
}
updateDescriptor
=
true
;
}
else
{
setResponse
=
invoke
(
attrSetMethod
,
(
new
Object
[]
{
attrValue
}),
(
new
String
[]
{
attrType
})
);
invoke
(
attrSetMethod
,
(
new
Object
[]
{
attrValue
}),
(
new
String
[]
{
attrType
})
);
}
/* change cached value */
...
...
@@ -2023,8 +2018,6 @@ public class RequiredModelMBean
private
synchronized
void
writeToLog
(
String
logFileName
,
String
logEntry
)
throws
Exception
{
PrintStream
logOut
=
null
;
FileOutputStream
fos
=
null
;
if
(
MODELMBEAN_LOGGER
.
isLoggable
(
Level
.
FINER
))
{
MODELMBEAN_LOGGER
.
logp
(
Level
.
FINER
,
RequiredModelMBean
.
class
.
getName
(),
...
...
@@ -2041,9 +2034,9 @@ public class RequiredModelMBean
return
;
}
FileOutputStream
fos
=
new
FileOutputStream
(
logFileName
,
true
);
try
{
fos
=
new
FileOutputStream
(
logFileName
,
true
);
logOut
=
new
PrintStream
(
fos
);
PrintStream
logOut
=
new
PrintStream
(
fos
);
logOut
.
println
(
logEntry
);
logOut
.
close
();
if
(
MODELMBEAN_LOGGER
.
isLoggable
(
Level
.
FINER
))
{
...
...
@@ -2062,6 +2055,8 @@ public class RequiredModelMBean
logFileName
);
}
throw
e
;
}
finally
{
fos
.
close
();
}
}
...
...
src/share/classes/javax/management/monitor/CounterMonitor.java
浏览文件 @
8580fa1f
...
...
@@ -740,16 +740,16 @@ public class CounterMonitor extends Monitor implements CounterMonitorMBean {
//
switch
(
o
.
getType
())
{
case
INTEGER:
o
.
setThreshold
(
new
Integer
((
int
)
threshold_value
));
o
.
setThreshold
(
Integer
.
valueOf
((
int
)
threshold_value
));
break
;
case
BYTE:
o
.
setThreshold
(
new
Byte
((
byte
)
threshold_value
));
o
.
setThreshold
(
Byte
.
valueOf
((
byte
)
threshold_value
));
break
;
case
SHORT:
o
.
setThreshold
(
new
Short
((
short
)
threshold_value
));
o
.
setThreshold
(
Short
.
valueOf
((
short
)
threshold_value
));
break
;
case
LONG:
o
.
setThreshold
(
new
Long
(
threshold_value
));
o
.
setThreshold
(
Long
.
valueOf
(
threshold_value
));
break
;
default
:
// Should never occur...
...
...
@@ -810,10 +810,10 @@ public class CounterMonitor extends Monitor implements CounterMonitorMBean {
derived
+=
modulus
.
longValue
();
switch
(
o
.
getType
())
{
case
INTEGER:
o
.
setDerivedGauge
(
new
Integer
((
int
)
derived
));
break
;
case
BYTE:
o
.
setDerivedGauge
(
new
Byte
((
byte
)
derived
));
break
;
case
SHORT:
o
.
setDerivedGauge
(
new
Short
((
short
)
derived
));
break
;
case
LONG:
o
.
setDerivedGauge
(
new
Long
(
derived
));
break
;
case
INTEGER:
o
.
setDerivedGauge
(
Integer
.
valueOf
((
int
)
derived
));
break
;
case
BYTE:
o
.
setDerivedGauge
(
Byte
.
valueOf
((
byte
)
derived
));
break
;
case
SHORT:
o
.
setDerivedGauge
(
Short
.
valueOf
((
short
)
derived
));
break
;
case
LONG:
o
.
setDerivedGauge
(
Long
.
valueOf
(
derived
));
break
;
default
:
// Should never occur...
MONITOR_LOGGER
.
logp
(
Level
.
FINEST
,
CounterMonitor
.
class
.
getName
(),
...
...
src/share/classes/javax/management/monitor/GaugeMonitor.java
浏览文件 @
8580fa1f
...
...
@@ -636,28 +636,28 @@ public class GaugeMonitor extends Monitor implements GaugeMonitorMBean {
Number
der
;
switch
(
o
.
getType
())
{
case
INTEGER:
der
=
new
Integer
(((
Integer
)
scanGauge
).
intValue
()
-
((
Integer
)
prev
).
intValue
());
der
=
Integer
.
valueOf
(((
Integer
)
scanGauge
).
intValue
()
-
((
Integer
)
prev
).
intValue
());
break
;
case
BYTE:
der
=
new
Byte
((
byte
)(((
Byte
)
scanGauge
).
byteValue
()
-
((
Byte
)
prev
).
byteValue
()));
der
=
Byte
.
valueOf
((
byte
)(((
Byte
)
scanGauge
).
byteValue
()
-
((
Byte
)
prev
).
byteValue
()));
break
;
case
SHORT:
der
=
new
Short
((
short
)(((
Short
)
scanGauge
).
shortValue
()
-
((
Short
)
prev
).
shortValue
()));
der
=
Short
.
valueOf
((
short
)(((
Short
)
scanGauge
).
shortValue
()
-
((
Short
)
prev
).
shortValue
()));
break
;
case
LONG:
der
=
new
Long
(((
Long
)
scanGauge
).
longValue
()
-
((
Long
)
prev
).
longValue
());
der
=
Long
.
valueOf
(((
Long
)
scanGauge
).
longValue
()
-
((
Long
)
prev
).
longValue
());
break
;
case
FLOAT:
der
=
new
Float
(((
Float
)
scanGauge
).
floatValue
()
-
((
Float
)
prev
).
floatValue
());
der
=
Float
.
valueOf
(((
Float
)
scanGauge
).
floatValue
()
-
((
Float
)
prev
).
floatValue
());
break
;
case
DOUBLE:
der
=
new
Double
(((
Double
)
scanGauge
).
doubleValue
()
-
((
Double
)
prev
).
doubleValue
());
der
=
Double
.
valueOf
(((
Double
)
scanGauge
).
doubleValue
()
-
((
Double
)
prev
).
doubleValue
());
break
;
default
:
// Should never occur...
...
...
src/share/classes/javax/management/monitor/Monitor.java
浏览文件 @
8580fa1f
...
...
@@ -367,7 +367,7 @@ public abstract class Monitor
/**
* Constant used to initialize all the numeric values.
*/
static
final
Integer
INTEGER_ZERO
=
new
Integer
(
0
)
;
static
final
Integer
INTEGER_ZERO
=
0
;
/*
...
...
@@ -1122,12 +1122,12 @@ public abstract class Monitor
*/
private
void
monitor
(
ObservedObject
o
,
int
index
,
int
an
[])
{
String
attribute
=
null
;
String
attribute
;
String
notifType
=
null
;
String
msg
=
null
;
Object
derGauge
=
null
;
Object
trigger
=
null
;
ObjectName
object
=
null
;
ObjectName
object
;
Comparable
<?>
value
=
null
;
MonitorNotification
alarm
=
null
;
...
...
@@ -1565,7 +1565,7 @@ public abstract class Monitor
final
ThreadGroup
group
;
final
AtomicInteger
threadNumber
=
new
AtomicInteger
(
1
);
final
String
namePrefix
;
final
String
nameSuffix
=
"]"
;
static
final
String
nameSuffix
=
"]"
;
public
DaemonThreadFactory
(
String
poolName
)
{
SecurityManager
s
=
System
.
getSecurityManager
();
...
...
src/share/classes/javax/management/openmbean/ArrayType.java
浏览文件 @
8580fa1f
...
...
@@ -726,7 +726,7 @@ public class ArrayType<T> extends OpenType<T> {
value
+=
dimension
;
value
+=
elementType
.
hashCode
();
value
+=
Boolean
.
valueOf
(
primitiveArray
).
hashCode
();
myHashCode
=
new
Integer
(
value
);
myHashCode
=
Integer
.
valueOf
(
value
);
}
// return always the same hash code for this instance (immutable)
...
...
src/share/classes/javax/management/openmbean/CompositeType.java
浏览文件 @
8580fa1f
...
...
@@ -426,7 +426,7 @@ public class CompositeType extends OpenType<CompositeData> {
value
+=
key
.
hashCode
();
value
+=
this
.
nameToType
.
get
(
key
).
hashCode
();
}
myHashCode
=
new
Integer
(
value
);
myHashCode
=
Integer
.
valueOf
(
value
);
}
// return always the same hash code for this instance (immutable)
...
...
src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java
浏览文件 @
8580fa1f
...
...
@@ -769,7 +769,6 @@ public class OpenMBeanAttributeInfoSupport
"array with same dimensions"
;
throw
new
IllegalArgumentException
(
msg
);
}
Class
<?>
targetComponentClass
=
targetArrayClass
.
getComponentType
();
OpenType
<?>
componentOpenType
;
if
(
dim
==
1
)
componentOpenType
=
baseType
;
...
...
src/share/classes/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java
浏览文件 @
8580fa1f
...
...
@@ -252,7 +252,7 @@ public class OpenMBeanConstructorInfoSupport
int
value
=
0
;
value
+=
this
.
getName
().
hashCode
();
value
+=
Arrays
.
asList
(
this
.
getSignature
()).
hashCode
();
myHashCode
=
new
Integer
(
value
);
myHashCode
=
Integer
.
valueOf
(
value
);
}
// return always the same hash code for this instance (immutable)
...
...
src/share/classes/javax/management/openmbean/OpenMBeanInfoSupport.java
浏览文件 @
8580fa1f
...
...
@@ -347,7 +347,7 @@ public class OpenMBeanInfoSupport
value
+=
arraySetHash
(
this
.
getConstructors
());
value
+=
arraySetHash
(
this
.
getOperations
());
value
+=
arraySetHash
(
this
.
getNotifications
());
myHashCode
=
new
Integer
(
value
);
myHashCode
=
Integer
.
valueOf
(
value
);
}
// return always the same hash code for this instance (immutable)
...
...
src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java
浏览文件 @
8580fa1f
...
...
@@ -352,7 +352,7 @@ public class OpenMBeanOperationInfoSupport
value
+=
Arrays
.
asList
(
this
.
getSignature
()).
hashCode
();
value
+=
this
.
getReturnOpenType
().
hashCode
();
value
+=
this
.
getImpact
();
myHashCode
=
new
Integer
(
value
);
myHashCode
=
Integer
.
valueOf
(
value
);
}
// return always the same hash code for this instance (immutable)
...
...
src/share/classes/javax/management/openmbean/SimpleType.java
浏览文件 @
8580fa1f
...
...
@@ -257,7 +257,7 @@ public final class SimpleType<T> extends OpenType<T> {
// Calculate the hash code value if it has not yet been done (ie 1st call to hashCode())
//
if
(
myHashCode
==
null
)
{
myHashCode
=
new
Integer
(
this
.
getClassName
().
hashCode
());
myHashCode
=
Integer
.
valueOf
(
this
.
getClassName
().
hashCode
());
}
// return always the same hash code for this instance (immutable)
...
...
src/share/classes/javax/management/openmbean/TabularType.java
浏览文件 @
8580fa1f
...
...
@@ -332,7 +332,7 @@ public class TabularType extends OpenType<TabularData> {
for
(
Iterator
k
=
indexNames
.
iterator
();
k
.
hasNext
();
)
{
value
+=
k
.
next
().
hashCode
();
}
myHashCode
=
new
Integer
(
value
);
myHashCode
=
Integer
.
valueOf
(
value
);
}
// return always the same hash code for this instance (immutable)
...
...
src/share/classes/javax/management/relation/RelationNotification.java
浏览文件 @
8580fa1f
...
...
@@ -369,7 +369,7 @@ public class RelationNotification extends Notification {
* @return a {@link List} of {@link ObjectName}.
*/
public
List
<
ObjectName
>
getMBeansToUnregister
()
{
List
<
ObjectName
>
result
=
null
;
List
<
ObjectName
>
result
;
if
(
unregisterMBeanList
!=
null
)
{
result
=
new
ArrayList
<
ObjectName
>(
unregisterMBeanList
);
}
else
{
...
...
@@ -397,7 +397,7 @@ public class RelationNotification extends Notification {
* @return the old value of the updated role.
*/
public
List
<
ObjectName
>
getOldRoleValue
()
{
List
<
ObjectName
>
result
=
null
;
List
<
ObjectName
>
result
;
if
(
oldRoleValue
!=
null
)
{
result
=
new
ArrayList
<
ObjectName
>(
oldRoleValue
);
}
else
{
...
...
@@ -412,7 +412,7 @@ public class RelationNotification extends Notification {
* @return the new value of the updated role.
*/
public
List
<
ObjectName
>
getNewRoleValue
()
{
List
<
ObjectName
>
result
=
null
;
List
<
ObjectName
>
result
;
if
(
newRoleValue
!=
null
)
{
result
=
new
ArrayList
<
ObjectName
>(
newRoleValue
);
}
else
{
...
...
src/share/classes/javax/management/relation/RelationService.java
浏览文件 @
8580fa1f
...
...
@@ -35,6 +35,7 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.logging.Level
;
import
javax.management.Attribute
;
...
...
@@ -122,7 +123,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Internal counter to provide sequence numbers for notifications sent by:
// - the Relation Service
// - a relation handled by the Relation Service
private
Long
myNtfSeqNbrCounter
=
new
Long
(
0
);
private
final
AtomicLong
atomicSeqNo
=
new
AtomicLong
(
);
// ObjectName used to register the Relation Service in the MBean Server
private
ObjectName
myObjName
=
null
;
...
...
@@ -256,19 +257,6 @@ public class RelationService extends NotificationBroadcasterSupport
return
;
}
// Returns internal counter to be used for Sequence Numbers of
// notifications to be raised by:
// - a relation handled by this Relation Service (when updated)
// - the Relation Service
private
Long
getNotificationSequenceNumber
()
{
Long
result
=
null
;
synchronized
(
myNtfSeqNbrCounter
)
{
result
=
new
Long
(
myNtfSeqNbrCounter
.
longValue
()
+
1
);
myNtfSeqNbrCounter
=
new
Long
(
result
.
longValue
());
}
return
result
;
}
//
// Relation type handling
//
...
...
@@ -369,7 +357,7 @@ public class RelationService extends NotificationBroadcasterSupport
* @return ArrayList of relation type names (Strings)
*/
public
List
<
String
>
getAllRelationTypeNames
()
{
ArrayList
<
String
>
result
=
null
;
ArrayList
<
String
>
result
;
synchronized
(
myRelType2ObjMap
)
{
result
=
new
ArrayList
<
String
>(
myRelType2ObjMap
.
keySet
());
}
...
...
@@ -684,7 +672,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw InstanceNotFoundException (but detected above)
// No MBeanException as no exception raised by this method, and no
// ReflectionException
String
relId
=
null
;
String
relId
;
try
{
relId
=
(
String
)(
myMBeanServer
.
getAttribute
(
relationObjectName
,
"RelationId"
));
...
...
@@ -707,7 +695,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw InstanceNotFoundException (but detected above)
// No MBeanException as no exception raised by this method, no
// ReflectionException
ObjectName
relServObjName
=
null
;
ObjectName
relServObjName
;
try
{
relServObjName
=
(
ObjectName
)
(
myMBeanServer
.
getAttribute
(
relationObjectName
,
...
...
@@ -737,7 +725,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw InstanceNotFoundException (but detected above)
// No MBeanException as no exception raised by this method, no
// ReflectionException
String
relTypeName
=
null
;
String
relTypeName
;
try
{
relTypeName
=
(
String
)(
myMBeanServer
.
getAttribute
(
relationObjectName
,
"RelationTypeName"
));
...
...
@@ -758,7 +746,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw InstanceNotFoundException (but detected above)
// No MBeanException as no exception raised by this method, no
// ReflectionException
RoleList
roleList
=
null
;
RoleList
roleList
;
try
{
roleList
=
(
RoleList
)(
myMBeanServer
.
invoke
(
relationObjectName
,
"retrieveAllRoles"
,
...
...
@@ -912,7 +900,7 @@ public class RelationService extends NotificationBroadcasterSupport
* @return ArrayList of String
*/
public
List
<
String
>
getAllRelationIds
()
{
List
<
String
>
result
=
null
;
List
<
String
>
result
;
synchronized
(
myRelId2ObjMap
)
{
result
=
new
ArrayList
<
String
>(
myRelId2ObjMap
.
keySet
());
}
...
...
@@ -948,7 +936,7 @@ public class RelationService extends NotificationBroadcasterSupport
RELATION_LOGGER
.
entering
(
RelationService
.
class
.
getName
(),
"checkRoleReading"
,
new
Object
[]
{
roleName
,
relationTypeName
});
Integer
result
=
null
;
Integer
result
;
// Can throw a RelationTypeNotFoundException
RelationType
relType
=
getRelationType
(
relationTypeName
);
...
...
@@ -965,7 +953,7 @@ public class RelationService extends NotificationBroadcasterSupport
false
);
}
catch
(
RoleInfoNotFoundException
exc
)
{
result
=
new
Integer
(
RoleStatus
.
NO_ROLE_WITH_NAME
);
result
=
Integer
.
valueOf
(
RoleStatus
.
NO_ROLE_WITH_NAME
);
}
RELATION_LOGGER
.
exiting
(
RelationService
.
class
.
getName
(),
...
...
@@ -1021,13 +1009,13 @@ public class RelationService extends NotificationBroadcasterSupport
writeChkFlag
=
false
;
}
RoleInfo
roleInfo
=
null
;
RoleInfo
roleInfo
;
try
{
roleInfo
=
relType
.
getRoleInfo
(
roleName
);
}
catch
(
RoleInfoNotFoundException
exc
)
{
RELATION_LOGGER
.
exiting
(
RelationService
.
class
.
getName
(),
"checkRoleWriting"
);
return
new
Integer
(
RoleStatus
.
NO_ROLE_WITH_NAME
);
return
Integer
.
valueOf
(
RoleStatus
.
NO_ROLE_WITH_NAME
);
}
Integer
result
=
checkRoleInt
(
2
,
...
...
@@ -1436,7 +1424,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Relation id to relation type name map
// First retrieves the relation type name
String
relTypeName
=
null
;
String
relTypeName
;
synchronized
(
myRelId2RelTypeMap
)
{
relTypeName
=
myRelId2RelTypeMap
.
get
(
relationId
);
myRelId2RelTypeMap
.
remove
(
relationId
);
...
...
@@ -1641,7 +1629,7 @@ public class RelationService extends NotificationBroadcasterSupport
// List of relation ids of interest regarding the selected
// relation type
List
<
String
>
relIdList
=
null
;
List
<
String
>
relIdList
;
if
(
relationTypeName
==
null
)
{
// Considers all relations
relIdList
=
new
ArrayList
<
String
>(
allRelIdSet
);
...
...
@@ -1655,7 +1643,7 @@ public class RelationService extends NotificationBroadcasterSupport
for
(
String
currRelId
:
allRelIdSet
)
{
// Retrieves its relation type
String
currRelTypeName
=
null
;
String
currRelTypeName
;
synchronized
(
myRelId2RelTypeMap
)
{
currRelTypeName
=
myRelId2RelTypeMap
.
get
(
currRelId
);
...
...
@@ -1952,7 +1940,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw a RelationNotFoundException
Object
relObj
=
getRelation
(
relationId
);
RoleResult
result
=
null
;
RoleResult
result
;
if
(
relObj
instanceof
RelationSupport
)
{
// Internal relation
...
...
@@ -2022,7 +2010,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw a RelationNotFoundException
Object
relObj
=
getRelation
(
relationId
);
RoleResult
result
=
null
;
RoleResult
result
;
if
(
relObj
instanceof
RelationSupport
)
{
// Internal relation
...
...
@@ -2073,7 +2061,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw a RelationNotFoundException
Object
relObj
=
getRelation
(
relationId
);
Integer
result
=
null
;
Integer
result
;
if
(
relObj
instanceof
RelationSupport
)
{
// Internal relation
...
...
@@ -2268,7 +2256,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw a RelationNotFoundException
Object
relObj
=
getRelation
(
relationId
);
RoleResult
result
=
null
;
RoleResult
result
;
if
(
relObj
instanceof
RelationSupport
)
{
// Internal relation
...
...
@@ -2390,7 +2378,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Can throw a RelationNotFoundException
Object
relObj
=
getRelation
(
relationId
);
String
result
=
null
;
String
result
;
if
(
relObj
instanceof
RelationSupport
)
{
// Internal relation
...
...
@@ -2473,7 +2461,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Note: do both tests as a relation can be an MBean and be
// itself referenced in another relation :)
String
relId
=
null
;
String
relId
;
synchronized
(
myRelMBeanObjName2RelIdMap
){
relId
=
myRelMBeanObjName2RelIdMap
.
get
(
mbeanName
);
}
...
...
@@ -2511,9 +2499,6 @@ public class RelationService extends NotificationBroadcasterSupport
RELATION_LOGGER
.
entering
(
RelationService
.
class
.
getName
(),
"getNotificationInfo"
);
MBeanNotificationInfo
[]
ntfInfoArray
=
new
MBeanNotificationInfo
[
1
];
String
ntfClass
=
"javax.management.relation.RelationNotification"
;
String
[]
ntfTypes
=
new
String
[]
{
...
...
@@ -2615,7 +2600,7 @@ public class RelationService extends NotificationBroadcasterSupport
"getRelationType"
,
relationTypeName
);
// No null relation type accepted, so can use get()
RelationType
relType
=
null
;
RelationType
relType
;
synchronized
(
myRelType2ObjMap
)
{
relType
=
(
myRelType2ObjMap
.
get
(
relationTypeName
));
}
...
...
@@ -2659,7 +2644,7 @@ public class RelationService extends NotificationBroadcasterSupport
"getRelation"
,
relationId
);
// No null relation accepted, so can use get()
Object
rel
=
null
;
Object
rel
;
synchronized
(
myRelId2ObjMap
)
{
rel
=
myRelId2ObjMap
.
get
(
relationId
);
}
...
...
@@ -3077,7 +3062,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Retrieves corresponding role info
// Can throw a RoleInfoNotFoundException to be converted into a
// RoleNotFoundException
RoleInfo
roleInfo
=
null
;
RoleInfo
roleInfo
;
try
{
roleInfo
=
relType
.
getRoleInfo
(
currRoleName
);
}
catch
(
RoleInfoNotFoundException
exc
)
{
...
...
@@ -3227,7 +3212,7 @@ public class RelationService extends NotificationBroadcasterSupport
if
(!(
roleName
.
equals
(
expName
)))
{
RELATION_LOGGER
.
exiting
(
RelationService
.
class
.
getName
(),
"checkRoleInt"
);
return
new
Integer
(
RoleStatus
.
NO_ROLE_WITH_NAME
);
return
Integer
.
valueOf
(
RoleStatus
.
NO_ROLE_WITH_NAME
);
}
// Checks read access if required
...
...
@@ -3236,7 +3221,7 @@ public class RelationService extends NotificationBroadcasterSupport
if
(!
isReadable
)
{
RELATION_LOGGER
.
exiting
(
RelationService
.
class
.
getName
(),
"checkRoleInt"
);
return
new
Integer
(
RoleStatus
.
ROLE_NOT_READABLE
);
return
Integer
.
valueOf
(
RoleStatus
.
ROLE_NOT_READABLE
);
}
else
{
// End of check :)
RELATION_LOGGER
.
exiting
(
RelationService
.
class
.
getName
(),
...
...
@@ -3572,7 +3557,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Relation type name
// Note: do not use getRelationTypeName() as if it is a relation MBean
// it is already unregistered.
String
relTypeName
=
null
;
String
relTypeName
;
synchronized
(
myRelId2RelTypeMap
)
{
relTypeName
=
(
myRelId2RelTypeMap
.
get
(
relationId
));
}
...
...
@@ -3609,7 +3594,7 @@ public class RelationService extends NotificationBroadcasterSupport
}
// Sequence number
Long
seqN
br
=
getNotificationSequenceNumber
();
Long
seqN
o
=
atomicSeqNo
.
incrementAndGet
();
// Timestamp
Date
currDate
=
new
Date
();
...
...
@@ -3625,7 +3610,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Creation or removal
ntf
=
new
RelationNotification
(
ntfType
,
this
,
seqN
br
.
longValue
(),
seqN
o
.
longValue
(),
timeStamp
,
message
,
relationId
,
...
...
@@ -3640,7 +3625,7 @@ public class RelationService extends NotificationBroadcasterSupport
// Update
ntf
=
new
RelationNotification
(
ntfType
,
this
,
seqN
br
.
longValue
(),
seqN
o
.
longValue
(),
timeStamp
,
message
,
relationId
,
...
...
@@ -3732,7 +3717,7 @@ public class RelationService extends NotificationBroadcasterSupport
//
// Shall not throw RelationTypeNotFoundException or
// RoleInfoNotFoundException
RoleInfo
currRoleInfo
=
null
;
RoleInfo
currRoleInfo
;
try
{
currRoleInfo
=
getRoleInfo
(
currRelTypeName
,
currRoleName
);
...
...
src/share/classes/javax/management/relation/RelationSupport.java
浏览文件 @
8580fa1f
...
...
@@ -34,6 +34,7 @@ import java.util.Iterator;
import
java.util.Map
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
static
com
.
sun
.
jmx
.
defaults
.
JmxProperties
.
RELATION_LOGGER
;
import
static
com
.
sun
.
jmx
.
mbeanserver
.
Util
.
cast
;
import
javax.management.InstanceNotFoundException
;
...
...
@@ -110,7 +111,7 @@ public class RelationSupport
private
Map
<
String
,
Role
>
myRoleName2ValueMap
=
new
HashMap
<
String
,
Role
>();
// Flag to indicate if the object has been added in the Relation Service
private
Boolean
myInRelServFlg
=
null
;
private
final
AtomicBoolean
myInRelServFlg
=
new
AtomicBoolean
()
;
//
// Constructors
...
...
@@ -403,7 +404,7 @@ public class RelationSupport
"getRoleCardinality"
,
roleName
);
// Try to retrieve the role
Role
role
=
null
;
Role
role
;
synchronized
(
myRoleName2ValueMap
)
{
// No null Role is allowed, so direct use of get()
role
=
(
myRoleName2ValueMap
.
get
(
roleName
));
...
...
@@ -427,7 +428,7 @@ public class RelationSupport
RELATION_LOGGER
.
exiting
(
RelationSupport
.
class
.
getName
(),
"getRoleCardinality"
);
return
new
Integer
(
roleValue
.
size
()
);
return
roleValue
.
size
(
);
}
/**
...
...
@@ -701,11 +702,7 @@ public class RelationSupport
* the Relation Service.
*/
public
Boolean
isInRelationService
()
{
Boolean
result
=
null
;
synchronized
(
myInRelServFlg
)
{
result
=
Boolean
.
valueOf
(
myInRelServFlg
.
booleanValue
());
}
return
result
;
return
myInRelServFlg
.
get
();
}
public
void
setRelationServiceManagementFlag
(
Boolean
flag
)
...
...
@@ -715,10 +712,7 @@ public class RelationSupport
String
excMsg
=
"Invalid parameter."
;
throw
new
IllegalArgumentException
(
excMsg
);
}
synchronized
(
myInRelServFlg
)
{
myInRelServFlg
=
Boolean
.
valueOf
(
flag
.
booleanValue
());
}
return
;
myInRelServFlg
.
set
(
flag
);
}
//
...
...
@@ -790,7 +784,7 @@ public class RelationSupport
int
pbType
=
0
;
Role
role
=
null
;
Role
role
;
synchronized
(
myRoleName2ValueMap
)
{
// No null Role is allowed, so direct use of get()
role
=
(
myRoleName2ValueMap
.
get
(
roleName
));
...
...
@@ -801,7 +795,7 @@ public class RelationSupport
}
else
{
// Checks if the role is readable
Integer
status
=
null
;
Integer
status
;
if
(
relationServCallFlg
)
{
...
...
@@ -851,7 +845,7 @@ public class RelationSupport
pbType
=
status
.
intValue
();
}
Object
result
=
null
;
Object
result
;
if
(
pbType
==
0
)
{
// Role can be retrieved
...
...
@@ -937,7 +931,7 @@ public class RelationSupport
for
(
int
i
=
0
;
i
<
roleNameArray
.
length
;
i
++)
{
String
currRoleName
=
roleNameArray
[
i
];
Object
currResult
=
null
;
Object
currResult
;
// Can throw RelationServiceNotRegisteredException
//
...
...
@@ -1102,13 +1096,13 @@ public class RelationSupport
// handle initialization of role when creating the relation
// (roles provided in the RoleList parameter are directly set but
// roles automatically initialized are set using setRole())
Role
role
=
null
;
Role
role
;
synchronized
(
myRoleName2ValueMap
)
{
role
=
(
myRoleName2ValueMap
.
get
(
roleName
));
}
List
<
ObjectName
>
oldRoleValue
;
Boolean
initFlg
=
null
;
Boolean
initFlg
;
if
(
role
==
null
)
{
initFlg
=
true
;
...
...
@@ -1122,7 +1116,7 @@ public class RelationSupport
// Checks if the role can be set: is writable (except if
// initialization) and correct value
try
{
Integer
status
=
null
;
Integer
status
;
if
(
relationServCallFlg
)
{
...
...
@@ -1314,7 +1308,7 @@ public class RelationSupport
Object
[]
params
=
new
Object
[
3
];
params
[
0
]
=
myRelId
;
params
[
1
]
=
newRole
;
params
[
2
]
=
((
ArrayList
)
oldRoleValue
)
;
params
[
2
]
=
oldRoleValue
;
String
[]
signature
=
new
String
[
3
];
signature
[
0
]
=
"java.lang.String"
;
signature
[
1
]
=
"javax.management.relation.Role"
;
...
...
@@ -1598,7 +1592,6 @@ public class RelationSupport
myRelTypeName
=
relationTypeName
;
// Can throw InvalidRoleValueException
initRoleMap
(
list
);
myInRelServFlg
=
Boolean
.
FALSE
;
RELATION_LOGGER
.
exiting
(
RelationSupport
.
class
.
getName
(),
"initMembers"
);
return
;
...
...
@@ -1710,7 +1703,7 @@ public class RelationSupport
roleName
,
relationServCallFlg
,
relationServ
});
// Retrieves current role value
Role
role
=
null
;
Role
role
;
synchronized
(
myRoleName2ValueMap
)
{
role
=
(
myRoleName2ValueMap
.
get
(
roleName
));
}
...
...
src/share/classes/javax/management/remote/JMXConnectorFactory.java
浏览文件 @
8580fa1f
...
...
@@ -435,7 +435,7 @@ public class JMXConnectorFactory {
Iterator
<
JMXConnectorProvider
>
providers
=
getProviderIterator
(
JMXConnectorProvider
.
class
,
loader
);
JMXConnector
connection
=
null
;
JMXConnector
connection
;
IOException
exception
=
null
;
while
(
providers
.
hasNext
())
{
try
{
...
...
@@ -450,7 +450,7 @@ public class JMXConnectorFactory {
"] Service provider exception: "
+
e
);
if
(!(
e
instanceof
MalformedURLException
))
{
if
(
exception
==
null
)
{
if
(
e
xception
instanceof
IOException
)
{
if
(
e
instanceof
IOException
)
{
exception
=
(
IOException
)
e
;
}
else
{
exception
=
EnvHelp
.
initCause
(
...
...
src/share/classes/javax/management/remote/JMXConnectorServerFactory.java
浏览文件 @
8580fa1f
...
...
@@ -215,12 +215,10 @@ public class JMXConnectorServerFactory {
JMXConnectorFactory
.
getProviderIterator
(
JMXConnectorServerProvider
.
class
,
loader
);
JMXConnectorServer
connection
=
null
;
IOException
exception
=
null
;
while
(
providers
.
hasNext
())
{
try
{
connection
=
providers
.
next
().
newJMXConnectorServer
(
url
,
map
,
mbs
);
return
connection
;
return
providers
.
next
().
newJMXConnectorServer
(
url
,
map
,
mbs
);
}
catch
(
JMXProviderException
e
)
{
throw
e
;
}
catch
(
Exception
e
)
{
...
...
@@ -230,7 +228,7 @@ public class JMXConnectorServerFactory {
"] Service provider exception: "
+
e
);
if
(!(
e
instanceof
MalformedURLException
))
{
if
(
exception
==
null
)
{
if
(
e
xception
instanceof
IOException
)
{
if
(
e
instanceof
IOException
)
{
exception
=
(
IOException
)
e
;
}
else
{
exception
=
EnvHelp
.
initCause
(
...
...
src/share/classes/javax/management/remote/JMXServiceURL.java
浏览文件 @
8580fa1f
...
...
@@ -162,8 +162,6 @@ public class JMXServiceURL implements Serializable {
requiredPrefix
);
}
int
[]
ptr
=
new
int
[
1
];
// Parse the protocol name
final
int
protoStart
=
requiredPrefixLength
;
final
int
protoEnd
=
indexOf
(
serviceURL
,
':'
,
protoStart
);
...
...
@@ -664,11 +662,6 @@ public class JMXServiceURL implements Serializable {
hostNameBitSet
.
set
(
'.'
);
}
private
static
void
addCharsToBitSet
(
BitSet
set
,
String
chars
)
{
for
(
int
i
=
0
;
i
<
chars
.
length
();
i
++)
set
.
set
(
chars
.
charAt
(
i
));
}
/**
* The value returned by {@link #getProtocol()}.
*/
...
...
src/share/classes/javax/management/remote/rmi/RMIConnector.java
浏览文件 @
8580fa1f
...
...
@@ -1376,12 +1376,12 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable
protected
Integer
addListenerForMBeanRemovedNotif
()
throws
IOException
,
InstanceNotFoundException
{
MarshalledObject
<
NotificationFilter
>
sFilter
=
null
;
NotificationFilterSupport
clientFilter
=
new
NotificationFilterSupport
();
clientFilter
.
enableType
(
MBeanServerNotification
.
UNREGISTRATION_NOTIFICATION
);
sFilter
=
new
MarshalledObject
<
NotificationFilter
>(
clientFilter
);
MarshalledObject
<
NotificationFilter
>
sFilter
=
new
MarshalledObject
<
NotificationFilter
>(
clientFilter
);
Integer
[]
listenerIDs
;
final
ObjectName
[]
names
=
...
...
@@ -1434,7 +1434,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable
connectionId
,
clientNotifCounter
++,
message
,
new
Long
(
number
));
Long
.
valueOf
(
number
));
sendNotification
(
n
);
}
}
...
...
@@ -1593,7 +1593,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable
protected
void
doStart
()
throws
IOException
{
// Get RMIServer stub from directory or URL encoding if needed.
RMIServer
stub
=
null
;
RMIServer
stub
;
try
{
stub
=
(
rmiServer
!=
null
)?
rmiServer:
findRMIServer
(
jmxServiceURL
,
env
);
...
...
@@ -2532,7 +2532,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable
* A static WeakReference to an {@link org.omg.CORBA.ORB ORB} to
* connect unconnected stubs.
**/
private
static
WeakReference
<
ORB
>
orb
=
null
;
private
static
volatile
WeakReference
<
ORB
>
orb
=
null
;
// TRACES & DEBUG
//---------------
...
...
src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java
浏览文件 @
8580fa1f
...
...
@@ -365,7 +365,7 @@ public class RMIConnectorServer extends JMXConnectorServer {
// Access file property specified, create an instance
// of the MBeanServerFileAccessController class
//
MBeanServerForwarder
mbsf
=
null
;
MBeanServerForwarder
mbsf
;
try
{
mbsf
=
new
MBeanServerFileAccessController
(
accessFile
);
}
catch
(
IOException
e
)
{
...
...
src/share/classes/javax/management/timer/Timer.java
浏览文件 @
8580fa1f
...
...
@@ -344,13 +344,11 @@ public class Timer extends NotificationBroadcasterSupport
//
if
(
isActive
==
true
)
{
TimerAlarmClock
alarmClock
;
for
(
Object
[]
obj
:
timerTable
.
values
())
{
// Stop all the TimerAlarmClock.
//
alarmClock
=
(
TimerAlarmClock
)
obj
[
ALARM_CLOCK_INDEX
];
TimerAlarmClock
alarmClock
=
(
TimerAlarmClock
)
obj
[
ALARM_CLOCK_INDEX
];
if
(
alarmClock
!=
null
)
{
// alarmClock.interrupt();
// try {
...
...
@@ -364,7 +362,6 @@ public class Timer extends NotificationBroadcasterSupport
// //
alarmClock
.
cancel
();
alarmClock
=
null
;
}
}
...
...
@@ -458,8 +455,7 @@ public class Timer extends NotificationBroadcasterSupport
// Create and add the timer notification into the timer table.
//
Integer
notifID
=
null
;
notifID
=
new
Integer
(++
counterID
);
Integer
notifID
=
Integer
.
valueOf
(++
counterID
);
// The sequenceNumber and the timeStamp attributes are updated
// when the notification is emitted by the timer.
...
...
@@ -486,8 +482,8 @@ public class Timer extends NotificationBroadcasterSupport
obj
[
TIMER_NOTIF_INDEX
]
=
(
Object
)
notif
;
obj
[
TIMER_DATE_INDEX
]
=
(
Object
)
d
;
obj
[
TIMER_PERIOD_INDEX
]
=
(
Object
)
new
Long
(
period
)
;
obj
[
TIMER_NB_OCCUR_INDEX
]
=
(
Object
)
n
ew
Long
(
nbOccurences
)
;
obj
[
TIMER_PERIOD_INDEX
]
=
(
Object
)
period
;
obj
[
TIMER_NB_OCCUR_INDEX
]
=
(
Object
)
n
bOccurences
;
obj
[
ALARM_CLOCK_INDEX
]
=
(
Object
)
alarmClock
;
obj
[
FIXED_RATE_INDEX
]
=
Boolean
.
valueOf
(
fixedRate
);
...
...
@@ -678,7 +674,6 @@ public class Timer extends NotificationBroadcasterSupport
// // Remove the reference on the TimerAlarmClock.
// //
alarmClock
.
cancel
();
alarmClock
=
null
;
}
// Remove the timer notification from the timer table.
...
...
@@ -755,7 +750,6 @@ public class Timer extends NotificationBroadcasterSupport
//
// }
alarmClock
.
cancel
();
alarmClock
=
null
;
}
// Remove all the timer notifications from the timer table.
...
...
@@ -906,8 +900,7 @@ public class Timer extends NotificationBroadcasterSupport
Object
[]
obj
=
timerTable
.
get
(
id
);
if
(
obj
!=
null
)
{
Long
period
=
(
Long
)
obj
[
TIMER_PERIOD_INDEX
];
return
(
new
Long
(
period
.
longValue
()));
return
(
Long
)
obj
[
TIMER_PERIOD_INDEX
];
}
return
null
;
}
...
...
@@ -924,8 +917,7 @@ public class Timer extends NotificationBroadcasterSupport
Object
[]
obj
=
timerTable
.
get
(
id
);
if
(
obj
!=
null
)
{
Long
nbOccurences
=
(
Long
)
obj
[
TIMER_NB_OCCUR_INDEX
];
return
(
new
Long
(
nbOccurences
.
longValue
()));
return
(
Long
)
obj
[
TIMER_NB_OCCUR_INDEX
];
}
return
null
;
}
...
...
@@ -1096,7 +1088,7 @@ public class Timer extends NotificationBroadcasterSupport
if
((
nbOccurences
.
longValue
()
==
0
)
||
(
nbOccurences
.
longValue
()
>
1
))
{
date
.
setTime
(
date
.
getTime
()
+
period
.
longValue
());
obj
[
TIMER_NB_OCCUR_INDEX
]
=
new
Long
(
java
.
lang
.
Math
.
max
(
0L
,
(
nbOccurences
.
longValue
()
-
1
)));
obj
[
TIMER_NB_OCCUR_INDEX
]
=
Long
.
valueOf
(
java
.
lang
.
Math
.
max
(
0L
,
(
nbOccurences
.
longValue
()
-
1
)));
nbOccurences
=
(
Long
)
obj
[
TIMER_NB_OCCUR_INDEX
];
if
(
isActive
==
true
)
{
...
...
@@ -1146,9 +1138,6 @@ public class Timer extends NotificationBroadcasterSupport
// // Ignore...
// }
alarmClock
.
cancel
();
// Remove the reference on the TimerAlarmClock.
//
alarmClock
=
null
;
}
timerTable
.
remove
(
notifID
);
}
...
...
@@ -1165,10 +1154,6 @@ public class Timer extends NotificationBroadcasterSupport
// }
alarmClock
.
cancel
();
// Remove the reference on the TimerAlarmClock.
//
alarmClock
=
null
;
}
timerTable
.
remove
(
notifID
);
}
...
...
test/javax/management/relation/RelationNotificationSeqNoTest.java
0 → 100644
浏览文件 @
8580fa1f
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6701459
* @summary Test sequence numbers in RelationService notifications.
* @author Eamonn McManus
*/
/*
* Bug 6701459 is for a synchronization problem that is very unlikely to occur
* in practice and it would be very hard to test it. Instead we just check that
* the fix has not introduced any obviously-wrong behavior in the sequence
* numbers.
*/
import
java.util.Arrays
;
import
java.util.concurrent.ArrayBlockingQueue
;
import
java.util.concurrent.BlockingQueue
;
import
javax.management.JMX
;
import
javax.management.MBeanServer
;
import
javax.management.MBeanServerFactory
;
import
javax.management.Notification
;
import
javax.management.NotificationListener
;
import
javax.management.ObjectName
;
import
javax.management.relation.RelationServiceMBean
;
import
javax.management.relation.Role
;
import
javax.management.relation.RoleInfo
;
import
javax.management.relation.RoleList
;
public
class
RelationNotificationSeqNoTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
MBeanServer
mbs
=
MBeanServerFactory
.
newMBeanServer
();
ObjectName
relSvcName
=
new
ObjectName
(
"a:type=relationService"
);
RelationServiceMBean
relSvc
=
JMX
.
newMBeanProxy
(
mbs
,
relSvcName
,
RelationServiceMBean
.
class
);
mbs
.
createMBean
(
"javax.management.relation.RelationService"
,
relSvcName
,
new
Object
[]
{
Boolean
.
TRUE
},
new
String
[]
{
"boolean"
});
final
BlockingQueue
<
Notification
>
q
=
new
ArrayBlockingQueue
<
Notification
>(
100
);
NotificationListener
qListener
=
new
NotificationListener
()
{
public
void
handleNotification
(
Notification
notification
,
Object
handback
)
{
q
.
add
(
notification
);
}
};
mbs
.
addNotificationListener
(
relSvcName
,
qListener
,
null
,
null
);
RoleInfo
leftInfo
=
new
RoleInfo
(
"left"
,
"javax.management.timer.TimerMBean"
);
RoleInfo
rightInfo
=
new
RoleInfo
(
"right"
,
"javax.management.timer.Timer"
);
relSvc
.
createRelationType
(
"typeName"
,
new
RoleInfo
[]
{
leftInfo
,
rightInfo
});
ObjectName
timer1
=
new
ObjectName
(
"a:type=timer,number=1"
);
ObjectName
timer2
=
new
ObjectName
(
"a:type=timer,number=2"
);
mbs
.
createMBean
(
"javax.management.timer.Timer"
,
timer1
);
mbs
.
createMBean
(
"javax.management.timer.Timer"
,
timer2
);
Role
leftRole
=
new
Role
(
"left"
,
Arrays
.
asList
(
new
ObjectName
[]
{
timer1
}));
Role
rightRole
=
new
Role
(
"right"
,
Arrays
.
asList
(
new
ObjectName
[]
{
timer2
}));
RoleList
roles
=
new
RoleList
(
Arrays
.
asList
(
new
Role
[]
{
leftRole
,
rightRole
}));
final
int
NREPEAT
=
10
;
for
(
int
i
=
0
;
i
<
NREPEAT
;
i
++)
{
relSvc
.
createRelation
(
"relationName"
,
"typeName"
,
roles
);
relSvc
.
removeRelation
(
"relationName"
);
}
Notification
firstNotif
=
q
.
remove
();
long
seqNo
=
firstNotif
.
getSequenceNumber
();
for
(
int
i
=
0
;
i
<
NREPEAT
*
2
-
1
;
i
++)
{
Notification
n
=
q
.
remove
();
long
nSeqNo
=
n
.
getSequenceNumber
();
if
(
nSeqNo
!=
seqNo
+
1
)
{
throw
new
Exception
(
"TEST FAILED: expected seqNo "
+
(
seqNo
+
1
)
+
"; got "
+
nSeqNo
);
}
seqNo
++;
}
System
.
out
.
println
(
"TEST PASSED: got "
+
(
NREPEAT
*
2
)
+
" notifications "
+
"with contiguous sequence numbers"
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录