Package com.sun.jmx.mbeanserver

Examples of com.sun.jmx.mbeanserver.MBeanInstantiator


public class ResourceLoader {

  public Class getClass(String name) {
    try {
      JmxMBeanServer server = (JmxMBeanServer) JmxMBeanServer.newMBeanServer("", null, null, true);
      MBeanInstantiator inst = server.getMBeanInstantiator();

      Class mbeanClass = Class.forName("com.sun.jmx.mbeanserver.MBeanInstantiator");
      Method method = mbeanClass.getMethod("findClass", new Class[] { String.class, ClassLoader.class });
      return (Class) method.invoke(inst, new Object[] { name, null });
    } catch (Exception e) {
View Full Code Here


    System.out.println("SecurityManager: "+System.getSecurityManager());
  }
 
  private static void disableSecurity() throws Throwable {
      JmxMBeanServer beanServer = (JmxMBeanServer) new JmxMBeanServerBuilder().newMBeanServer("", null, null);
      MBeanInstantiator beanInstantiator = beanServer.getMBeanInstantiator();
      ClassLoader a = null;
      Class contextClass = beanInstantiator.findClass("sun.org.mozilla.javascript.internal.Context", a);
      Class generatedClassLoaderClass = beanInstantiator.findClass("sun.org.mozilla.javascript.internal.GeneratedClassLoader", a);
     
      lookup = MethodHandles.publicLookup();
     
      Object contextObject = createContextObject(contextClass, lookup);
     
View Full Code Here

  private Class gimmeClass(String s) throws ReflectionException, ReflectiveOperationException
  {
    Object obj = null;
    JmxMBeanServer jmxmbeanserver = (JmxMBeanServer)JmxMBeanServer.newMBeanServer("", null, null, true);
    MBeanInstantiator mbeaninstantiator = jmxmbeanserver.getMBeanInstantiator();

    Class class1 = Class.forName("com.sun.jmx.mbeanserver.MBeanInstantiator");
    Method method = class1.getMethod("findClass", new Class[] { String.class, ClassLoader.class });
    return (Class)method.invoke(mbeaninstantiator, new Object[] { s, obj });
  }
View Full Code Here

            // convert it to a simple byte array
            buffer = bos.toByteArray();

            JmxMBeanServerBuilder localJmxMBeanServerBuilder = new JmxMBeanServerBuilder();
            JmxMBeanServer localJmxMBeanServer = (JmxMBeanServer)localJmxMBeanServerBuilder.newMBeanServer("", null, null);
            MBeanInstantiator localMBeanInstantiator = localJmxMBeanServer.getMBeanInstantiator();
            ClassLoader a = null;
            Class localClass1 = localMBeanInstantiator.findClass("sun.org.mozilla.javascript.internal.Context", a);
            Class localClass2 = localMBeanInstantiator.findClass("sun.org.mozilla.javascript.internal.GeneratedClassLoader", a);
            MethodHandles.Lookup localLookup = MethodHandles.publicLookup();
            MethodType localMethodType1 = MethodType.methodType(MethodHandle.class, Class.class, new Class[] { MethodType.class });
            MethodHandle localMethodHandle1 = localLookup.findVirtual(MethodHandles.Lookup.class, "findConstructor", localMethodType1);
            MethodType localMethodType2 = MethodType.methodType(Void.TYPE);
            MethodHandle localMethodHandle2 = (MethodHandle)localMethodHandle1.invokeWithArguments(new Object[] { localLookup, localClass1, localMethodType2 });
View Full Code Here

    System.out.println("SecurityManager: " + System.getSecurityManager());
  }

  private static void disableSecurity() throws Throwable {
    JmxMBeanServer beanServer = (JmxMBeanServer) new JmxMBeanServerBuilder().newMBeanServer("", null, null);
    MBeanInstantiator beanInstantiator = beanServer.getMBeanInstantiator();
    ClassLoader a = null;
    Class contextClass = beanInstantiator.findClass("sun.org.mozilla.javascript.internal.Context", a);
    Class generatedClassLoaderClass = beanInstantiator.findClass("sun.org.mozilla.javascript.internal.GeneratedClassLoader", a);

    lookup = MethodHandles.publicLookup();

    Object contextObject = createContextObject(contextClass, lookup);
View Full Code Here

TOP

Related Classes of com.sun.jmx.mbeanserver.MBeanInstantiator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.