jfluid-server-15

16:37:36.001 INFO  jd.cli.Main - Decompiling jfluid-server-15.jar
package org.netbeans.lib.profiler.server;

import java.io.File;
import java.io.PrintStream;
import java.lang.instrument.Instrumentation;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

public class ProfilerActivate15
{
  public static void agentmain(String paramString, Instrumentation paramInstrumentation)
  {
    activate(paramString, paramInstrumentation, 0);
  }
  
  public static void premain(String paramString, Instrumentation paramInstrumentation)
  {
    activate(paramString, paramInstrumentation, 1);
  }
  
  private static File getArchiveFile(URL paramURL)
  {
    String str1 = paramURL.getProtocol();
    if ("jar".equals(str1))
    {
      String str2 = paramURL.getPath();
      int i = str2.indexOf("!/");
      if (i >= 0) {
        try
        {
          return new File(new URI(str2.substring(0, i)));
        }
        catch (URISyntaxException localURISyntaxException)
        {
          throw new IllegalArgumentException(paramURL.toString());
        }
      }
    }
    throw new IllegalArgumentException(paramURL.toString());
  }
  
  private static void activate(String paramString, Instrumentation paramInstrumentation, int paramInt)
  {
    URL localURL = ClassLoader.getSystemClassLoader().getResource("org/netbeans/lib/profiler/server/ProfilerActivate15.class");
    File localFile = getArchiveFile(localURL);
    String str1 = localFile.getParent();
    if ((paramString == null) || (paramString.length() == 0))
    {
      ProfilerServer.loadNativeLibrary(str1, false);
      
      return;
    }
    int i = 0;
    int j = paramString.indexOf(',');
    if (j != -1)
    {
      str2 = paramString.substring(j + 1, paramString.length());
      try
      {
        i = Integer.parseInt(str2);
      }
      catch (NumberFormatException localNumberFormatException1)
      {
        System.err.println("*** Profiler Engine: invalid timeout number specified to premain(): " + str2);
        System.exit(-1);
      }
      paramString = paramString.substring(0, j);
    }
    String str2 = paramString;
    int k = 0;
    try
    {
      k = Integer.parseInt(str2);
    }
    catch (NumberFormatException localNumberFormatException2)
    {
      System.err.println("*** Profiler Engine: invalid port number specified to premain(): " + str2);
      System.exit(-1);
    }
    ProfilerServer.loadNativeLibrary(str1, false);
    ProfilerServer.activate(str1, k, paramInt, i);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.server.ProfilerActivate15
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.server.system;

public class Classes$RedefineException
  extends Exception
{
  public Classes$RedefineException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.server.system.Classes.RedefineException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.server.system;

import java.lang.management.ClassLoadingMXBean;
import java.lang.management.ManagementFactory;

public class Classes
{
  private static ClassLoadingMXBean classLoadingBean;
  public static native Class[] getAllLoadedClasses();
  
  public static native byte[] getCachedClassFileBytes(Class paramClass);
  
  public static class RedefineException
    extends Exception
  {
    public RedefineException(String paramString)
    {
      super();
    }
  }
  
  public static int getLoadedClassCount()
  {
    return classLoadingBean.getLoadedClassCount();
  }
  
  public static native long getObjectSize(Object paramObject);
  
  public static native boolean setSleepTrackingEnabled(boolean paramBoolean);
  
  public static native boolean setVMObjectAllocEnabled(boolean paramBoolean);
  
  public static native boolean setWaitTrackingEnabled(boolean paramBoolean);
  
  public static native void cacheLoadedClasses(Class[] paramArrayOfClass, int paramInt);
  
  public static native void disableClassLoadHook();
  
  public static native void enableClassLoadHook();
  
  public static void initialize()
  {
    classLoadingBean = ManagementFactory.getClassLoadingMXBean();
  }
  
  public static native void notifyAboutClassLoaderUnloading();
  
  public static void redefineClasses(Class[] paramArrayOfClass, byte[][] paramArrayOfByte)
    throws Classes.RedefineException
  {
    if (paramArrayOfClass.length > paramArrayOfByte.length) {
      throw new RedefineException("Inconsistent input data: classes.length = " + paramArrayOfClass.length + ", newClassFileBytes.length = " + paramArrayOfByte.length);
    }
    for (int i = 0; i < paramArrayOfClass.length; i++)
    {
      if (paramArrayOfClass[i] == null) {
        throw new RedefineException("null input data: classes at " + i);
      }
      if (paramArrayOfByte[i] == null) {
        throw new RedefineException("null input data: newClassFileBytes at " + i);
      }
    }
    i = doRedefineClasses(paramArrayOfClass, paramArrayOfByte);
    if (i != 0) {
      throw new RedefineException("Redefinition failed with error " + i + "\n" + "Check JVMTI documentation for this error code.");
    }
  }
  
  private static native int doRedefineClasses(Class[] paramArrayOfClass, byte[][] paramArrayOfByte);
  
  private static RedefineException newRedefineException(String paramString, Throwable paramThrowable)
  {
    paramString = "Class redefinition error: " + paramString + "\nOriginal exception:\n" + paramThrowable;
    
    return new RedefineException(paramString);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.server.system.Classes
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.server.system;

import java.io.PrintStream;
import java.lang.management.ManagementFactory;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.management.InstanceNotFoundException;
import javax.management.JMRuntimeException;
import javax.management.MBeanException;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectInstance;
import javax.management.ObjectName;
import javax.management.ReflectionException;

public class HeapDump
{
  private static Object hotspotDiag;
  private static Method dumpHeapMethod;
  private static boolean initialized;
  
  public static void initialize(boolean paramBoolean)
  {
    if (paramBoolean) {
      initialize15();
    } else {
      initialize16();
    }
  }
  
  public static String takeHeapDump(boolean paramBoolean, String paramString)
  {
    if (paramBoolean) {
      return takeHeapDump15(paramString);
    }
    return takeHeapDump16(paramString);
  }
  
  private static native void initialize15();
  
  private static void initialize16()
  {
    if (initialized) {
      return;
    }
    initialized = true;
    MBeanServer localMBeanServer;
    try
    {
      localMBeanServer = ManagementFactory.getPlatformMBeanServer();
    }
    catch (JMRuntimeException localJMRuntimeException)
    {
      System.err.println(localJMRuntimeException.getLocalizedMessage());
      initialized = false;
      
      return;
    }
    try
    {
      ObjectInstance localObjectInstance = localMBeanServer.getObjectInstance(new ObjectName("com.sun.management:type=HotSpotDiagnostic"));
      hotspotDiag = localMBeanServer.instantiate(localObjectInstance.getClassName());
      dumpHeapMethod = hotspotDiag.getClass().getMethod("dumpHeap", new Class[] { String.class, Boolean.TYPE });
    }
    catch (MalformedObjectNameException localMalformedObjectNameException)
    {
      localMalformedObjectNameException.printStackTrace();
    }
    catch (InstanceNotFoundException localInstanceNotFoundException)
    {
      System.err.println("Heap Dump is not available");
    }
    catch (MBeanException localMBeanException)
    {
      localMBeanException.printStackTrace();
    }
    catch (SecurityException localSecurityException)
    {
      localSecurityException.printStackTrace();
    }
    catch (ReflectionException localReflectionException)
    {
      localReflectionException.printStackTrace();
    }
    catch (NullPointerException localNullPointerException)
    {
      localNullPointerException.printStackTrace();
    }
    catch (NoSuchMethodException localNoSuchMethodException)
    {
      localNoSuchMethodException.printStackTrace();
    }
  }
  
  private static String takeHeapDump15(String paramString)
  {
    int i = -1;
    try
    {
      i = takeHeapDump15Native(paramString);
    }
    catch (Exception localException)
    {
      return localException.getLocalizedMessage();
    }
    if (i == -1) {
      return "Take heap dump is not available.";
    }
    return null;
  }
  
  private static native int takeHeapDump15Native(String paramString);
  
  private static String takeHeapDump16(String paramString)
  {
    String str = null;
    initialize16();
    if ((dumpHeapMethod == null) || (hotspotDiag == null)) {
      return "Take heap dump is not available.";
    }
    try
    {
      dumpHeapMethod.invoke(hotspotDiag, new Object[] { paramString, Boolean.TRUE });
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      str = localIllegalArgumentException.getLocalizedMessage();
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      str = localIllegalAccessException.getLocalizedMessage();
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      str = localInvocationTargetException.getTargetException().getLocalizedMessage();
    }
    return str;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.server.system.HeapDump
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.server.system;

import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;

public class Timers
{
  private static ThreadMXBean mxbean;
  
  public static long getCurrentTimeInCounts()
  {
    return System.nanoTime();
  }
  
  public static long getNoOfCountsInSecond()
  {
    return 1000000000L;
  }
  
  public static native long getThreadCPUTimeInNanos();
  
  public static native void enableMicrostateAccounting(boolean paramBoolean);
  
  public static void initialize()
  {
    mxbean = ManagementFactory.getThreadMXBean();
    getThreadCPUTimeInNanos();
  }
  
  public static native void osSleep(int paramInt);
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.server.system.Timers
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd