2007-02-15 Gary Benson <gbenson@redhat.com>
* gnu/javax/management/Server.java (registerMBean): Always register objects that implement the MBeanRegistration interface, and check the name returned by preRegister before using it. From-SVN: r121995
This commit is contained in:
parent
b102a4f7e8
commit
02bba3c417
@ -1,3 +1,10 @@
|
|||||||
|
2007-02-15 Gary Benson <gbenson@redhat.com>
|
||||||
|
|
||||||
|
* gnu/javax/management/Server.java
|
||||||
|
(registerMBean): Always register objects that implement the
|
||||||
|
MBeanRegistration interface, and check the name returned by
|
||||||
|
preRegister before using it.
|
||||||
|
|
||||||
2007-02-15 Gary Benson <gbenson@redhat.com>
|
2007-02-15 Gary Benson <gbenson@redhat.com>
|
||||||
|
|
||||||
* javax/management/ObjectName.java:
|
* javax/management/ObjectName.java:
|
||||||
|
@ -1657,9 +1657,7 @@ public class Server
|
|||||||
MBeanRegistration register = null;
|
MBeanRegistration register = null;
|
||||||
if (obj instanceof MBeanRegistration)
|
if (obj instanceof MBeanRegistration)
|
||||||
register = (MBeanRegistration) obj;
|
register = (MBeanRegistration) obj;
|
||||||
if (name == null)
|
if (name == null && register == null)
|
||||||
{
|
|
||||||
if (register == null)
|
|
||||||
{
|
{
|
||||||
RuntimeException e =
|
RuntimeException e =
|
||||||
new IllegalArgumentException("The name was null and " +
|
new IllegalArgumentException("The name was null and " +
|
||||||
@ -1667,9 +1665,19 @@ public class Server
|
|||||||
"MBeanRegistration.");
|
"MBeanRegistration.");
|
||||||
throw new RuntimeOperationsException(e);
|
throw new RuntimeOperationsException(e);
|
||||||
}
|
}
|
||||||
|
if (register != null)
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
name = register.preRegister(this, null);
|
name = register.preRegister(this, name);
|
||||||
|
if (name == null)
|
||||||
|
{
|
||||||
|
RuntimeException e =
|
||||||
|
new NullPointerException("The name returned by " +
|
||||||
|
"MBeanRegistration.preRegister() " +
|
||||||
|
"was null");
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
if (sm != null)
|
if (sm != null)
|
||||||
sm.checkPermission(new MBeanPermission(className, null, name,
|
sm.checkPermission(new MBeanPermission(className, null, name,
|
||||||
"registerMBean"));
|
"registerMBean"));
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user