This is an automated email from the ASF dual-hosted git repository.

samt pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit c768a14fb138639c83117665adea27bfd99bfc7a
Merge: 439e0b0 bbe09d4
Author: Sam Tunnicliffe <s...@beobal.com>
AuthorDate: Wed Mar 25 17:38:25 2020 +0000

    Merge branch 'cassandra-3.11' into trunk

 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/utils/JMXServerUtils.java | 61 +++++++++++++++++++---
 2 files changed, 56 insertions(+), 6 deletions(-)

diff --cc src/java/org/apache/cassandra/utils/JMXServerUtils.java
index c8f4464,48d02f7..12036f9
--- a/src/java/org/apache/cassandra/utils/JMXServerUtils.java
+++ b/src/java/org/apache/cassandra/utils/JMXServerUtils.java
@@@ -286,15 -274,51 +292,58 @@@ public class JMXServerUtil
  
          public Subject authenticate(Object credentials)
          {
 -            JMXPluggableAuthenticator authenticator = new 
JMXPluggableAuthenticator(env);
 -            return authenticator.authenticate(credentials);
 +            try
 +            {
 +                JMXAuthenticator authenticator = (JMXAuthenticator) 
ctorHandle.invoke(env);
 +                return authenticator.authenticate(credentials);
 +            }
 +            catch (Throwable e)
 +            {
 +                throw new RuntimeException(e);
 +            }
          }
      }
+ 
+     /*
+      * Better to use the internal API than re-invent the wheel.
+      */
+     @SuppressWarnings("restriction")
+     private static class JmxRegistry extends sun.rmi.registry.RegistryImpl {
+         private final String lookupName;
+         private Remote remoteServerStub;
+ 
+         JmxRegistry(final int port,
+                     final RMIClientSocketFactory csf,
+                     RMIServerSocketFactory ssf,
+                     final String lookupName) throws RemoteException {
+             super(port, csf, ssf);
+             this.lookupName = lookupName;
+         }
+ 
+         @Override
+         public Remote lookup(String s) throws RemoteException, 
NotBoundException {
+             return lookupName.equals(s) ? remoteServerStub : null;
+         }
+ 
+         @Override
+         public void bind(String s, Remote remote) throws RemoteException, 
AlreadyBoundException, AccessException {
+         }
+ 
+         @Override
+         public void unbind(String s) throws RemoteException, 
NotBoundException, AccessException {
+         }
+ 
+         @Override
+         public void rebind(String s, Remote remote) throws RemoteException, 
AccessException {
+         }
+ 
+         @Override
+         public String[] list() throws RemoteException {
+             return new String[] {lookupName};
+         }
+ 
+         public void setRemoteServerStub(Remote remoteServerStub) {
+             this.remoteServerStub = remoteServerStub;
+         }
+     }
  }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to