Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
9ae3169a
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9ae3169a
编写于
5月 16, 2008
作者:
E
emcmanus
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6703552: Missing files from changeset for 6701459
Summary: Previous push missed a small number of files. Reviewed-by: dfuchs
上级
97d68fb4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
115 addition
and
3 deletion
+115
-3
jdk/src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java
...x/management/openmbean/OpenMBeanOperationInfoSupport.java
+1
-1
jdk/src/share/classes/javax/management/relation/RelationService.java
...re/classes/javax/management/relation/RelationService.java
+1
-1
jdk/src/share/classes/javax/management/timer/Timer.java
jdk/src/share/classes/javax/management/timer/Timer.java
+1
-1
jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java
...ax/management/relation/RelationNotificationSeqNoTest.java
+112
-0
未找到文件。
jdk/src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java
浏览文件 @
9ae3169a
...
...
@@ -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)
...
...
jdk/src/share/classes/javax/management/relation/RelationService.java
浏览文件 @
9ae3169a
...
...
@@ -3221,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
(),
...
...
jdk/src/share/classes/javax/management/timer/Timer.java
浏览文件 @
9ae3169a
...
...
@@ -455,7 +455,7 @@ public class Timer extends NotificationBroadcasterSupport
// Create and add the timer notification into the timer table.
//
Integer
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.
...
...
jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java
0 → 100644
浏览文件 @
9ae3169a
/*
* 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录