javax.management.remote.MBeanServerForwarder Java Examples

The following examples show how to use javax.management.remote.MBeanServerForwarder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommunicatorServer.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #2
Source File: CommunicatorServer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #3
Source File: CommunicatorServer.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #4
Source File: CommunicatorServer.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #5
Source File: TestJMXServer.java    From JPPF with Apache License 2.0 6 votes vote down vote up
/**
 * Test without an MBeanServerForwarder.
 * @throws Exception if any error occurs
 */
@Test(timeout = 10000)
public void testNoMBeanForwarder() throws Exception {
  JMXServer server = null;
  try {
    JPPFConfiguration.set(JPPFProperties.MANAGEMENT_PORT, PORT)
      .set(JPPFProperties.JMX_REMOTE_PROTOCOL, JMXHelper.JPPF_JMX_PROTOCOL)
      .remove(JPPFProperties.MANAGEMENT_SERVER_FORWARDER);
    server = JMXServerFactory.createServer(JPPFConfiguration.getProperties(), "clientTest", false, JPPFProperties.MANAGEMENT_PORT);
    server.start(getClass().getClassLoader());
    final MBeanServerForwarder mbsf = server.getMBeanServerForwarder();
    assertNull(mbsf);
  } finally {
    if (server != null) {
      try {
        server.stop();
      } catch (final Exception e) {
        e.printStackTrace();
      }
    }
  }
}
 
Example #6
Source File: CommunicatorServer.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #7
Source File: CommunicatorServer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #8
Source File: CommunicatorServer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #9
Source File: CommunicatorServer.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #10
Source File: CommunicatorServer.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the <code>MBeanServer</code> object to which incoming
 * requests are sent.  This must be either the MBean server in
 * which this connector is registered, or an
 * <code>MBeanServerForwarder</code> leading to that server.  An
 * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
 * MBean server <code>mbs</code> if
 * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
 * or an <code>MBeanServerForwarder</code> leading to
 * <code>mbs</code>.
 *
 * @exception IllegalArgumentException if <code>newMBS</code> is neither
 * the MBean server in which this connector is registered nor an
 * <code>MBeanServerForwarder</code> leading to that server.
 *
 * @exception IllegalStateException This method has been invoked
 * while the communicator was ONLINE or STARTING.
 */
public synchronized void setMBeanServer(MBeanServer newMBS)
        throws IllegalArgumentException, IllegalStateException {
    synchronized (stateLock) {
        if (state == ONLINE || state == STARTING)
            throw new IllegalStateException("Stop server before " +
                                            "carrying out this operation");
    }
    final String error =
        "MBeanServer argument must be MBean server where this " +
        "server is registered, or an MBeanServerForwarder " +
        "leading to that server";
    Vector<MBeanServer> seenMBS = new Vector<>();
    for (MBeanServer mbs = newMBS;
         mbs != bottomMBS;
         mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
        if (!(mbs instanceof MBeanServerForwarder))
            throw new IllegalArgumentException(error);
        if (seenMBS.contains(mbs))
            throw new IllegalArgumentException("MBeanServerForwarder " +
                                               "loop");
        seenMBS.addElement(mbs);
    }
    topMBS = newMBS;
}
 
Example #11
Source File: MBSFPreStartPostStartTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

            final InvocationHandler handler = new MBSFInvocationHandler();

            final Class[] interfaces =
                new Class[] {MBeanServerForwarder.class};

            Object proxy = Proxy.newProxyInstance(
                                 MBeanServerForwarder.class.getClassLoader(),
                                 interfaces,
                                 handler);

            return MBeanServerForwarder.class.cast(proxy);
        }
 
Example #12
Source File: MBeanServerMXBeanUnsupportedTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

            final InvocationHandler handler =
                    new MBeanServerForwarderInvocationHandler();

            final Class[] interfaces =
                    new Class[] {MBeanServerForwarder.class};

            Object proxy = Proxy.newProxyInstance(
                    MBeanServerForwarder.class.getClassLoader(),
                    interfaces,
                    handler);

            return MBeanServerForwarder.class.cast(proxy);
        }
 
Example #13
Source File: MBeanServerForwarderInvocationHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

        final InvocationHandler handler =
            new MBeanServerForwarderInvocationHandler();

        final Class[] interfaces =
            new Class[] {MBeanServerForwarder.class};

        Object proxy = Proxy.newProxyInstance(
                             MBeanServerForwarder.class.getClassLoader(),
                             interfaces,
                             handler);

        return MBeanServerForwarder.class.cast(proxy);
    }
 
Example #14
Source File: MBeanServerForwarderInvocationHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

        final InvocationHandler handler =
            new MBeanServerForwarderInvocationHandler();

        final Class[] interfaces =
            new Class[] {MBeanServerForwarder.class};

        Object proxy = Proxy.newProxyInstance(
                             MBeanServerForwarder.class.getClassLoader(),
                             interfaces,
                             handler);

        return MBeanServerForwarder.class.cast(proxy);
    }
 
Example #15
Source File: MBSFPreStartPostStartTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

            final InvocationHandler handler = new MBSFInvocationHandler();

            final Class[] interfaces =
                new Class[] {MBeanServerForwarder.class};

            Object proxy = Proxy.newProxyInstance(
                                 MBeanServerForwarder.class.getClassLoader(),
                                 interfaces,
                                 handler);

            return MBeanServerForwarder.class.cast(proxy);
        }
 
Example #16
Source File: MBeanServerMXBeanUnsupportedTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

            final InvocationHandler handler =
                    new MBeanServerForwarderInvocationHandler();

            final Class[] interfaces =
                    new Class[] {MBeanServerForwarder.class};

            Object proxy = Proxy.newProxyInstance(
                    MBeanServerForwarder.class.getClassLoader(),
                    interfaces,
                    handler);

            return MBeanServerForwarder.class.cast(proxy);
        }
 
Example #17
Source File: MBeanServerMXBeanUnsupportedTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public MBeanServer newMBeanServer(
        String defaultDomain,
        MBeanServer outer,
        MBeanServerDelegate delegate) {
    final MBeanServerForwarder mbsf =
            MBeanServerForwarderInvocationHandler.newProxyInstance();

    final MBeanServer innerMBeanServer =
            inner.newMBeanServer(defaultDomain,
            (outer == null ? mbsf : outer),
            delegate);

    mbsf.setMBeanServer(innerMBeanServer);
    return mbsf;
}
 
Example #18
Source File: MBeanServerMXBeanUnsupportedTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

            final InvocationHandler handler =
                    new MBeanServerForwarderInvocationHandler();

            final Class[] interfaces =
                    new Class[] {MBeanServerForwarder.class};

            Object proxy = Proxy.newProxyInstance(
                    MBeanServerForwarder.class.getClassLoader(),
                    interfaces,
                    handler);

            return MBeanServerForwarder.class.cast(proxy);
        }
 
Example #19
Source File: MBeanServerBuilderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public MBeanServer newMBeanServer(String defaultDomain,
                                  MBeanServer outer,
                                  MBeanServerDelegate delegate) {
    final MBeanServerForwarder mbsf =
        MBeanServerForwarderInvocationHandler.newProxyInstance();

    final MBeanServer innerMBeanServer =
        inner.newMBeanServer(defaultDomain,
                             (outer == null ? mbsf : outer),
                             delegate);

    mbsf.setMBeanServer(innerMBeanServer);
    return mbsf;
}
 
Example #20
Source File: MBeanServerBuilderImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public MBeanServer newMBeanServer(String defaultDomain,
                                  MBeanServer outer,
                                  MBeanServerDelegate delegate) {
    final MBeanServerForwarder mbsf =
        MBeanServerForwarderInvocationHandler.newProxyInstance();

    final MBeanServer innerMBeanServer =
        inner.newMBeanServer(defaultDomain,
                             (outer == null ? mbsf : outer),
                             delegate);

    mbsf.setMBeanServer(innerMBeanServer);
    return mbsf;
}
 
Example #21
Source File: MBeanServerForwarderInvocationHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

        final InvocationHandler handler =
            new MBeanServerForwarderInvocationHandler();

        final Class[] interfaces =
            new Class[] {MBeanServerForwarder.class};

        Object proxy = Proxy.newProxyInstance(
                             MBeanServerForwarder.class.getClassLoader(),
                             interfaces,
                             handler);

        return MBeanServerForwarder.class.cast(proxy);
    }
 
Example #22
Source File: MBeanServerMXBeanUnsupportedTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

            final InvocationHandler handler =
                    new MBeanServerForwarderInvocationHandler();

            final Class[] interfaces =
                    new Class[] {MBeanServerForwarder.class};

            Object proxy = Proxy.newProxyInstance(
                    MBeanServerForwarder.class.getClassLoader(),
                    interfaces,
                    handler);

            return MBeanServerForwarder.class.cast(proxy);
        }
 
Example #23
Source File: MBeanServerMXBeanUnsupportedTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public MBeanServer newMBeanServer(
        String defaultDomain,
        MBeanServer outer,
        MBeanServerDelegate delegate) {
    final MBeanServerForwarder mbsf =
            MBeanServerForwarderInvocationHandler.newProxyInstance();

    final MBeanServer innerMBeanServer =
            inner.newMBeanServer(defaultDomain,
            (outer == null ? mbsf : outer),
            delegate);

    mbsf.setMBeanServer(innerMBeanServer);
    return mbsf;
}
 
Example #24
Source File: RMIConnectorServer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public synchronized
    void setMBeanServerForwarder(MBeanServerForwarder mbsf) {
    super.setMBeanServerForwarder(mbsf);
    if (rmiServerImpl != null)
        rmiServerImpl.setMBeanServer(getMBeanServer());
}
 
Example #25
Source File: RMIConnectorServer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public synchronized
    void setMBeanServerForwarder(MBeanServerForwarder mbsf) {
    super.setMBeanServerForwarder(mbsf);
    if (rmiServerImpl != null)
        rmiServerImpl.setMBeanServer(getMBeanServer());
}
 
Example #26
Source File: RMIConnectorServer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public synchronized
    void setMBeanServerForwarder(MBeanServerForwarder mbsf) {
    super.setMBeanServerForwarder(mbsf);
    if (rmiServerImpl != null)
        rmiServerImpl.setMBeanServer(getMBeanServer());
}
 
Example #27
Source File: MBeanServerMXBeanUnsupportedTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public MBeanServer newMBeanServer(
        String defaultDomain,
        MBeanServer outer,
        MBeanServerDelegate delegate) {
    final MBeanServerForwarder mbsf =
            MBeanServerForwarderInvocationHandler.newProxyInstance();

    final MBeanServer innerMBeanServer =
            inner.newMBeanServer(defaultDomain,
            (outer == null ? mbsf : outer),
            delegate);

    mbsf.setMBeanServer(innerMBeanServer);
    return mbsf;
}
 
Example #28
Source File: MBSFPreStartPostStartTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

            final InvocationHandler handler = new MBSFInvocationHandler();

            final Class[] interfaces =
                new Class[] {MBeanServerForwarder.class};

            Object proxy = Proxy.newProxyInstance(
                                 MBeanServerForwarder.class.getClassLoader(),
                                 interfaces,
                                 handler);

            return MBeanServerForwarder.class.cast(proxy);
        }
 
Example #29
Source File: MBSFPreStartPostStartTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

            final InvocationHandler handler = new MBSFInvocationHandler();

            final Class[] interfaces =
                new Class[] {MBeanServerForwarder.class};

            Object proxy = Proxy.newProxyInstance(
                                 MBeanServerForwarder.class.getClassLoader(),
                                 interfaces,
                                 handler);

            return MBeanServerForwarder.class.cast(proxy);
        }
 
Example #30
Source File: MBeanServerForwarderInvocationHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static MBeanServerForwarder newProxyInstance() {

        final InvocationHandler handler =
            new MBeanServerForwarderInvocationHandler();

        final Class[] interfaces =
            new Class[] {MBeanServerForwarder.class};

        Object proxy = Proxy.newProxyInstance(
                             MBeanServerForwarder.class.getClassLoader(),
                             interfaces,
                             handler);

        return MBeanServerForwarder.class.cast(proxy);
    }