jfluid-server

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

import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.text.MessageFormat;
import java.util.ResourceBundle;

public class CalibrationDataFileIO
{
  private static final ResourceBundle messages = ResourceBundle.getBundle("org.netbeans.lib.profiler.global.Bundle");
  private static final String CALIBRATION_FILE_NOT_EXIST_MSG = messages.getString("CalibrationDataFileIO_CalibrationFileNotExistMsg");
  private static final String CALIBRATION_FILE_NOT_READABLE_MSG = messages.getString("CalibrationDataFileIO_CalibrationFileNotReadableMsg");
  private static final String CALIBRATION_DATA_CORRUPTED_PREFIX = messages.getString("CalibrationDataFileIO_CalibrationDataCorruptedPrefix");
  private static final String SHORTER_THAN_EXPECTED_STRING = messages.getString("CalibrationDataFileIO_ShorterThanExpectedString");
  private static final String ORIGINAL_MESSAGE_STRING = messages.getString("CalibrationDataFileIO_OriginalMessageString");
  private static final String RERUN_CALIBRATION_MSG = messages.getString("CalibrationDataFileIO_ReRunCalibrationMsg");
  private static final String ERROR_WRITING_CALIBRATION_FILE_PREFIX = messages.getString("CalibrationDataFileIO_ErrorWritingCalibrationFilePrefix");
  private static final String REEXECUTE_CALIBRATION_MSG = messages.getString("CalibrationDataFileIO_ReExecuteCalibrationMsg");
  private static String errorMessage;
  
  public static String getErrorMessage()
  {
    String str = errorMessage;
    errorMessage = null;
    
    return str;
  }
  
  public static int readSavedCalibrationData(ProfilingSessionStatus paramProfilingSessionStatus)
  {
    String str1 = null;
    try
    {
      str1 = getCalibrationDataFileName(targetJDKVersionString);
    }
    catch (IOException localIOException)
    {
      errorMessage = localIOException.getMessage();
      
      return -1;
    }
    File localFile = new File(str1);
    if (!localFile.exists())
    {
      errorMessage = CALIBRATION_FILE_NOT_EXIST_MSG;
      
      return 1;
    }
    if (!localFile.canRead())
    {
      errorMessage = MessageFormat.format(CALIBRATION_FILE_NOT_READABLE_MSG, new Object[] { localFile.toString() });
      
      return -1;
    }
    try
    {
      FileInputStream localFileInputStream = new FileInputStream(localFile);
      localObject = new ObjectInputStream(localFileInputStream);
      
      methodEntryExitCallTime = ((double[])((ObjectInputStream)localObject).readObject());
      methodEntryExitInnerTime = ((double[])((ObjectInputStream)localObject).readObject());
      methodEntryExitOuterTime = ((double[])((ObjectInputStream)localObject).readObject());
      timerCountsInSecond = ((long[])((ObjectInputStream)localObject).readObject());
      
      localFileInputStream.close();
    }
    catch (Exception localException)
    {
      Object localObject = localException.getMessage();
      String str2 = CALIBRATION_DATA_CORRUPTED_PREFIX;
      if (localObject == null)
      {
        if ((localException instanceof EOFException)) {
          localObject = str2 + " " + SHORTER_THAN_EXPECTED_STRING;
        }
      }
      else {
        localObject = str2 + "\n" + ORIGINAL_MESSAGE_STRING + " " + (String)localObject;
      }
      localObject = (String)localObject + "\n" + RERUN_CALIBRATION_MSG + "\n";
      
      return -2;
    }
    return 0;
  }
  
  public static boolean saveCalibrationData(ProfilingSessionStatus paramProfilingSessionStatus)
  {
    try
    {
      FileOutputStream localFileOutputStream = new FileOutputStream(getCalibrationDataFileName(targetJDKVersionString));
      localObject = new ObjectOutputStream(localFileOutputStream);
      
      ((ObjectOutputStream)localObject).writeObject(methodEntryExitCallTime);
      ((ObjectOutputStream)localObject).writeObject(methodEntryExitInnerTime);
      ((ObjectOutputStream)localObject).writeObject(methodEntryExitOuterTime);
      ((ObjectOutputStream)localObject).writeObject(timerCountsInSecond);
      
      localFileOutputStream.close();
    }
    catch (IOException localIOException)
    {
      Object localObject = localIOException.getMessage();
      String str = ERROR_WRITING_CALIBRATION_FILE_PREFIX;
      localObject = str + "\n" + ORIGINAL_MESSAGE_STRING + "\n" + (String)localObject;
      if (!remoteProfiling) {
        localObject = (String)localObject + "\n" + REEXECUTE_CALIBRATION_MSG + "\n";
      }
      return false;
    }
    return true;
  }
  
  public static boolean validateCalibrationInput(String paramString1, String paramString2)
  {
    if ((paramString1 != null) && (paramString2 != null) && (
      ("jdk15".equals(paramString1)) || ("jdk16".equals(paramString1)) || ("jdk17".equals(paramString1)))) {
      if (new File(paramString2).exists()) {
        return true;
      }
    }
    return false;
  }
  
  private static String getCalibrationDataFileName(String paramString)
    throws IOException
  {
    String str = "machinedata." + paramString;
    
    return Platform.getProfilerUserDir() + File.separator + str;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.global.CalibrationDataFileIO
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.global;

import java.awt.Color;
import java.util.ResourceBundle;

public abstract interface CommonConstants
{
  public static final ResourceBundle messages = ResourceBundle.getBundle("org.netbeans.lib.profiler.global.Bundle");
  public static final String THREAD_STATUS_UNKNOWN_STRING = messages.getString("CommonConstants_ThreadStatusUnknownString");
  public static final String THREAD_STATUS_ZOMBIE_STRING = messages.getString("CommonConstants_ThreadStatusZombieString");
  public static final String THREAD_STATUS_RUNNING_STRING = messages.getString("CommonConstants_ThreadStatusRunningString");
  public static final String THREAD_STATUS_SLEEPING_STRING = messages.getString("CommonConstants_ThreadStatusSleepingString");
  public static final String THREAD_STATUS_MONITOR_STRING = messages.getString("CommonConstants_ThreadStatusMonitorString");
  public static final String THREAD_STATUS_WAIT_STRING = messages.getString("CommonConstants_ThreadStatusWaitString");
  public static final String PROFILER_SERVER_SLASHED_CLASS_PREFIX = "org/netbeans/lib/profiler/server/";
  public static final String PROFILER_DOTTED_CLASS_PREFIX = "org.netbeans.lib.profiler.";
  public static final int AGENT_STATE_NOT_RUNNING = 0;
  public static final int AGENT_STATE_READY_DYNAMIC = 1;
  public static final int AGENT_STATE_READY_DIRECT = 2;
  public static final int AGENT_STATE_CONNECTED = 3;
  public static final int AGENT_STATE_DIFFERENT_ID = 4;
  public static final int AGENT_STATE_OTHER_SESSION_IN_PROGRESS = 5;
  public static final int AGENT_ID_ANY = -1;
  public static final int JDK_15 = 2;
  public static final int JDK_16 = 3;
  public static final int JDK_17 = 4;
  public static final int JDK_CVM = 5;
  public static final int JDK_UNSUPPORTED = -1;
  public static final String JDK_15_STRING = "jdk15";
  public static final String JDK_16_STRING = "jdk16";
  public static final String JDK_17_STRING = "jdk17";
  public static final String JDK_CVM_STRING = "cvm";
  public static final String JDK_UNSUPPORTED_STRING = "UNSUPPORTED_JDK";
  public static final int ARCH_32 = 32;
  public static final int ARCH_64 = 64;
  public static final int EVENT_BUFFER_SIZE_IN_BYTES = 1200000;
  public static final byte ROOT_ENTRY = 1;
  public static final byte ROOT_EXIT = 2;
  public static final byte MARKER_ENTRY = 3;
  public static final byte MARKER_EXIT = 4;
  public static final byte ADJUST_TIME = 5;
  public static final byte METHOD_ENTRY = 6;
  public static final byte METHOD_EXIT = 7;
  public static final byte THREADS_SUSPENDED = 8;
  public static final byte THREADS_RESUMED = 9;
  public static final byte RESET_COLLECTORS = 10;
  public static final byte NEW_THREAD = 11;
  public static final byte OBJ_ALLOC_STACK_TRACE = 12;
  public static final byte SET_FOLLOWING_EVENTS_THREAD = 13;
  public static final byte OBJ_LIVENESS_STACK_TRACE = 14;
  public static final byte OBJ_GC_HAPPENED = 15;
  public static final byte METHOD_ENTRY_UNSTAMPED = 16;
  public static final byte METHOD_EXIT_UNSTAMPED = 17;
  public static final byte MARKER_ENTRY_UNSTAMPED = 18;
  public static final byte MARKER_EXIT_UNSTAMPED = 19;
  public static final byte METHOD_ENTRY_WAIT = 20;
  public static final byte METHOD_EXIT_WAIT = 21;
  public static final byte METHOD_ENTRY_MONITOR = 22;
  public static final byte METHOD_EXIT_MONITOR = 23;
  public static final byte METHOD_ENTRY_SLEEP = 24;
  public static final byte METHOD_EXIT_SLEEP = 25;
  public static final byte BUFFEREVENT_PROFILEPOINT_HIT = 26;
  public static final byte SERVLET_DO_METHOD = 27;
  public static final char MAX_METHOD_ID_FOR_COMPACT_FORMAT = '?';
  public static final byte COMPACT_EVENT_FORMAT_BYTE_MASK = -128;
  public static final char METHOD_ENTRY_COMPACT_MASK = '?';
  public static final byte METHOD_ENTRY_COMPACT_BYTE_MASK = -128;
  public static final char METHOD_EXIT_COMPACT_MASK = '?';
  public static final byte METHOD_EXIT_COMPACT_BYTE_MASK = -64;
  public static final char COMPACT_EVENT_METHOD_ID_MASK = '?';
  public static final int INSTR_NONE = 0;
  public static final int INSTR_CODE_REGION = 1;
  public static final int INSTR_RECURSIVE_FULL = 2;
  public static final int INSTR_RECURSIVE_SAMPLED = 3;
  public static final int INSTR_OBJECT_ALLOCATIONS = 4;
  public static final int INSTR_OBJECT_LIVENESS = 5;
  public static final int INSTR_MEMORY_BASE = 4;
  public static final int INSTR_MAXNUMBER = 6;
  public static final int CPU_INSTR_FULL = 0;
  public static final int CPU_INSTR_SAMPLED = 1;
  public static final int INSTRSCHEME_LAZY = 1;
  public static final int INSTRSCHEME_EAGER = 2;
  public static final int INSTRSCHEME_TOTAL = 3;
  public static final String PROFILER_SERVER_THREAD_NAME = "*** Profiler Agent Communication Thread";
  public static final String PROFILER_SPECIAL_EXEC_THREAD_NAME = "*** Profiler Agent Special Execution Thread";
  public static final String PROFILER_SEPARATE_EXEC_THREAD_NAME = "*** JFluid Separate Command Execution Thread";
  public static final String CALIBRATION_PSEUDO_CLASS_NAME = "____Profiler+Calibration+Run____";
  public static final String NO_CLASS_NAME = "*NO_CLASS_NAME*";
  public static final String NO_METHOD_NAME = "*NO_METHOD_NAME*";
  public static final String NO_METHOD_SIGNATURE = "*NO_METHOD_SIGNATURE*";
  public static final String JAVA_LANG_REFLECT_METHOD_DOTTED_CLASS_NAME = "java.lang.reflect.Method";
  public static final String JAVA_LANG_REFLECT_METHOD_SLASHED_CLASS_NAME = "java/lang/reflect/Method";
  public static final String INVOKE_METHOD_NAME = "invoke";
  public static final String INVOKE_METHOD_SIGNATURE = "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;";
  public static final int INJ_RECURSIVE_NORMAL_METHOD = 0;
  public static final int INJ_RECURSIVE_ROOT_METHOD = 1;
  public static final int INJ_RECURSIVE_MARKER_METHOD = 2;
  public static final int INJ_RECURSIVE_SAMPLED_NORMAL_METHOD = 3;
  public static final int INJ_RECURSIVE_SAMPLED_ROOT_METHOD = 4;
  public static final int INJ_RECURSIVE_SAMPLED_MARKER_METHOD = 5;
  public static final int INJ_REFLECT_METHOD_INVOKE = 6;
  public static final int INJ_SERVLET_DO_METHOD = 7;
  public static final int INJ_CODE_REGION = 8;
  public static final int INJ_OBJECT_ALLOCATIONS = 9;
  public static final int INJ_OBJECT_LIVENESS = 10;
  public static final int INJ_STACKMAP = 11;
  public static final int INJ_THROWABLE = 12;
  public static final int INJ_MAXNUMBER = 13;
  public static final byte THREAD_STATUS_UNKNOWN = -1;
  public static final byte THREAD_STATUS_ZOMBIE = 0;
  public static final byte THREAD_STATUS_RUNNING = 1;
  public static final byte THREAD_STATUS_SLEEPING = 2;
  public static final byte THREAD_STATUS_MONITOR = 3;
  public static final byte THREAD_STATUS_WAIT = 4;
  public static final Color THREAD_STATUS_UNKNOWN_COLOR = Color.LIGHT_GRAY;
  public static final Color THREAD_STATUS_ZOMBIE_COLOR = Color.BLACK;
  public static final Color THREAD_STATUS_RUNNING_COLOR = new Color(58, 228, 103);
  public static final Color THREAD_STATUS_SLEEPING_COLOR = new Color(155, 134, 221);
  public static final Color THREAD_STATUS_MONITOR_COLOR = new Color(255, 114, 102);
  public static final Color THREAD_STATUS_WAIT_COLOR = new Color(255, 228, 90);
  public static final int FILTER_NONE = 0;
  public static final int FILTER_STARTS_WITH = 10;
  public static final int FILTER_CONTAINS = 20;
  public static final int FILTER_ENDS_WITH = 30;
  public static final int FILTER_EQUALS = 40;
  public static final int FILTER_REGEXP = 50;
  public static final int SORTING_COLUMN_DEFAULT = -1;
  public static final String ENGINE_WARNING = "*** Profiler engine warning: ";
  public static final String PLEASE_REPORT_PROBLEM = "*** Please report this problem to feedback@profiler.netbeans.org";
  public static final int AGENT_VERSION_10_M9 = 1;
  public static final int AGENT_VERSION_10_M10 = 2;
  public static final int AGENT_VERSION_60_M5 = 3;
  public static final int AGENT_VERSION_60_M6 = 4;
  public static final int AGENT_VERSION_60_M7 = 5;
  public static final int AGENT_VERSION_60_M8 = 6;
  public static final int AGENT_VERSION_60_M10 = 7;
  public static final int AGENT_VERSION_60_BETA1 = 8;
  public static final int AGENT_VERSION_67_BETA = 9;
  public static final int AGENT_VERSION_69 = 10;
  public static final int CURRENT_AGENT_VERSION = 10;
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.global.CommonConstants
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.global;

import java.io.PrintStream;

public class InstrumentationFilter
  implements Cloneable
{
  public static final int INSTR_FILTER_NONE = 0;
  public static final int INSTR_FILTER_EXCLUSIVE = 10;
  public static final int INSTR_FILTER_INCLUSIVE = 20;
  private static InstrumentationFilter defaultInstance;
  private String[] instrFilterStrings;
  private int instrFilterType;
  
  public InstrumentationFilter()
  {
    clearFilter();
  }
  
  public static InstrumentationFilter getDefault()
  {
    if (defaultInstance == null) {
      defaultInstance = new InstrumentationFilter();
    }
    return defaultInstance;
  }
  
  public void setFilterStrings(String paramString)
  {
    paramString = paramString.replace(',', ' ');
    paramString = paramString.replace('.', '/');
    
    setSlashedFilterStrings(paramString.trim().split(" +"));
  }
  
  public String[] getFilterStrings()
  {
    return instrFilterStrings;
  }
  
  public void setFilterType(int paramInt)
  {
    instrFilterType = paramInt;
  }
  
  public int getFilterType()
  {
    return instrFilterType;
  }
  
  public void setSlashedFilterStrings(String[] paramArrayOfString)
  {
    instrFilterStrings = paramArrayOfString;
    for (int i = 0; i < instrFilterStrings.length; i++)
    {
      String str = instrFilterStrings[i];
      if (str.endsWith("*")) {
        instrFilterStrings[i] = str.substring(0, str.length() - 1);
      }
    }
  }
  
  public void clearFilter()
  {
    instrFilterType = 0;
    instrFilterStrings = new String[0];
  }
  
  public Object clone()
    throws CloneNotSupportedException
  {
    InstrumentationFilter localInstrumentationFilter = (InstrumentationFilter)super.clone();
    instrFilterStrings = new String[instrFilterStrings.length];
    for (int i = 0; i < instrFilterStrings.length; i++) {
      instrFilterStrings[i] = instrFilterStrings[i];
    }
    return localInstrumentationFilter;
  }
  
  public String debug()
  {
    StringBuffer localStringBuffer = new StringBuffer();
    switch (instrFilterType)
    {
    case 0: 
      localStringBuffer.append("  Filter type: None\n");
      
      break;
    case 10: 
      localStringBuffer.append("  Filter type: Exclusive\n");
      
      break;
    case 20: 
      localStringBuffer.append("  Filter type: Inclusive\n");
    }
    localStringBuffer.append("  Filter value: ");
    for (int i = 0; i < instrFilterStrings.length; i++)
    {
      localStringBuffer.append(instrFilterStrings[i]);
      localStringBuffer.append(" ");
    }
    localStringBuffer.append("\n");
    
    return localStringBuffer.toString();
  }
  
  public void debugDump()
  {
    System.err.println("----------------------------------");
    System.err.println("Instrumentation filter debug dump:");
    switch (instrFilterType)
    {
    case 0: 
      System.err.println("  Filter type: None");
      
      break;
    case 10: 
      System.err.println("  Filter type: Exclusive");
      
      break;
    case 20: 
      System.err.println("  Filter type: Inclusive");
    }
    StringBuffer localStringBuffer = new StringBuffer();
    for (int i = 0; i < instrFilterStrings.length; i++)
    {
      localStringBuffer.append(instrFilterStrings[i]);
      localStringBuffer.append(" ");
    }
    System.err.println("  Filter strings: " + localStringBuffer.toString());
  }
  
  public boolean passesFilter(String paramString)
  {
    if (instrFilterType == 0) {
      return true;
    }
    if (instrFilterStrings.length == 0) {
      return true;
    }
    int i = instrFilterType == 20 ? 1 : 0;
    int j;
    if (i != 0) {
      for (j = 0; j < instrFilterStrings.length; j++) {
        if (matches(paramString, instrFilterStrings[j])) {
          return true;
        }
      }
    } else {
      for (j = 0; j < instrFilterStrings.length; j++) {
        if (matches(paramString, instrFilterStrings[j])) {
          return false;
        }
      }
    }
    if (i != 0) {
      return false;
    }
    return true;
  }
  
  private static boolean matches(String paramString1, String paramString2)
  {
    return paramString1.startsWith(paramString2);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.global.InstrumentationFilter
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.global;

import java.io.File;
import java.io.IOException;
import java.io.PrintStream;

public class Platform
  implements CommonConstants
{
  public static final int OS_WINNT = 1;
  public static final int OS_WIN95 = 2;
  public static final int OS_WIN98 = 4;
  public static final int OS_SOLARIS = 8;
  public static final int OS_LINUX = 16;
  public static final int OS_HP = 32;
  public static final int OS_AIX = 64;
  public static final int OS_IRIX = 128;
  public static final int OS_SUNOS = 256;
  public static final int OS_TRU64 = 512;
  public static final int OS_OS2 = 1024;
  public static final int OS_MAC = 2048;
  public static final int OS_WIN2000 = 4096;
  public static final int OS_VMS = 8192;
  public static final int OS_WIN_OTHER = 16384;
  public static final int OS_OTHER = 65536;
  public static final int OS_WINDOWS_MASK = 20487;
  public static final int OS_UNIX_MASK = 3064;
  private static int operatingSystem = -1;
  private static String jdkDenoteString;
  private static int jdkVersion;
  private static int sysArch;
  
  public static String getAgentNativeLibFullName(String paramString1, boolean paramBoolean, String paramString2, int paramInt)
  {
    if (paramString2 == null) {
      paramString2 = getJDKVersionString();
    }
    if (paramInt == -1) {
      paramInt = getSystemArchitecture();
    }
    int i = paramInt == 64 ? 1 : 0;
    if (paramString2.equals("jdk17")) {
      paramString2 = "jdk16";
    }
    String str1 = "";
    if (!isWindows()) {
      str1 = "lib";
    }
    String str2 = "";
    if (isWindows()) {
      str2 = ".dll";
    } else if (isMac()) {
      str2 = ".jnilib";
    } else if (isHpux()) {
      str2 = ".sl";
    } else {
      str2 = ".so";
    }
    String str3 = "/";
    if (!paramBoolean)
    {
      if (isWindows()) {
        str4 = "windows";
      } else if (isMac()) {
        str4 = "mac";
      } else if (isLinux()) {
        str4 = "linux";
      } else if (isHpux()) {
        str4 = "hpux";
      } else {
        str4 = "solaris";
      }
      String str5 = null;
      if (i != 0)
      {
        if ((isLinux()) || (isWindows()) || (isSolarisIntel())) {
          str5 = "amd64";
        } else if (isSolarisSparc()) {
          str5 = "sparcv9";
        } else if (isHpux()) {
          str5 = "pa_risc2.0w";
        }
      }
      else if (isSolarisIntel()) {
        str5 = "i386";
      } else if (isSolarisSparc()) {
        str5 = "sparc";
      } else if (isHpux()) {
        str5 = "pa_risc2.0";
      }
      if (str5 != null) {
        str4 = str4 + "-" + str5;
      }
      str3 = "/deployed/" + paramString2 + "/" + str4 + "/";
    }
    String str4 = paramString1;
    if (paramString1.startsWith("\"")) {
      str4 = paramString1.substring(1, paramString1.length() - 1);
    }
    str4 = str4.replace('\\', '/');
    
    return str4 + str3 + str1 + "profilerinterface" + str2;
  }
  
  public static int getJDKMinorNumber(String paramString)
  {
    if (paramString == null) {
      return 0;
    }
    int i = paramString.lastIndexOf('_');
    if ((i > 0) && (i < paramString.length() - 1))
    {
      String str = paramString.substring(i + 1);
      int j = str.indexOf('-');
      if (j != -1) {
        str = str.substring(0, j);
      }
      return Integer.parseInt(str);
    }
    return 0;
  }
  
  private static int getJDKVersionNumber(String paramString)
  {
    int i;
    if (paramString.startsWith("1.5")) {
      i = 2;
    } else if (paramString.startsWith("1.6")) {
      i = 3;
    } else if (paramString.startsWith("1.7")) {
      i = 4;
    } else if (paramString.equals("CVM")) {
      i = 5;
    } else {
      i = -1;
    }
    return i;
  }
  
  public static int getJDKVersionNumber()
  {
    if (jdkVersion == 0) {
      jdkVersion = getJDKVersionNumber(getJavaVersionString());
    }
    return jdkVersion;
  }
  
  public static String getJDKVersionString(String paramString)
  {
    int i = getJDKVersionNumber(paramString);
    switch (i)
    {
    case 2: 
      return "jdk15";
    case 3: 
      return "jdk16";
    case 4: 
      return "jdk17";
    case 5: 
      return "cvm";
    case -1: 
      return "UNSUPPORTED_JDK";
    }
    System.err.println("Unsupported java " + paramString);
    return "UNSUPPORTED_JDK";
  }
  
  public static String getJDKVersionString()
  {
    if (jdkDenoteString == null) {
      jdkDenoteString = getJDKVersionString(getJavaVersionString());
    }
    return jdkDenoteString;
  }
  
  public static String getJavaVersionString()
  {
    String str = System.getProperty("java.vm.name");
    if ("CVM".equals(str)) {
      return str;
    }
    return System.getProperty("java.version");
  }
  
  public static String getJFluidNativeLibDirName(String paramString1, String paramString2, int paramInt)
  {
    String str = getAgentNativeLibFullName(paramString1, false, paramString2, paramInt);
    
    return str.substring(0, str.lastIndexOf('/'));
  }
  
  public static boolean isLinux()
  {
    return getOperatingSystem() == 16;
  }
  
  public static boolean isLinux(String paramString)
  {
    return getOperatingSystem(paramString) == 16;
  }
  
  public static boolean isMac()
  {
    return getOperatingSystem() == 2048;
  }
  
  public static boolean isHpux()
  {
    return getOperatingSystem() == 32;
  }
  
  public static int getOperatingSystem()
  {
    if (operatingSystem == -1)
    {
      String str = System.getProperty("os.name");
      operatingSystem = getOperatingSystem(str);
    }
    return operatingSystem;
  }
  
  public static int getOperatingSystem(String paramString)
  {
    if ("Windows NT".equals(paramString)) {
      return 1;
    }
    if ("Windows 95".equals(paramString)) {
      return 2;
    }
    if ("Windows 98".equals(paramString)) {
      return 4;
    }
    if ("Windows 2000".equals(paramString)) {
      return 4096;
    }
    if (paramString.startsWith("Windows ")) {
      return 16384;
    }
    if ("Solaris".equals(paramString)) {
      return 8;
    }
    if (paramString.startsWith("SunOS")) {
      return 8;
    }
    if (paramString.endsWith("Linux")) {
      return 16;
    }
    if ("HP-UX".equals(paramString)) {
      return 32;
    }
    if ("AIX".equals(paramString)) {
      return 64;
    }
    if ("Irix".equals(paramString)) {
      return 128;
    }
    if ("SunOS".equals(paramString)) {
      return 8;
    }
    if ("Digital UNIX".equals(paramString)) {
      return 512;
    }
    if ("OS/2".equals(paramString)) {
      return 1024;
    }
    if ("OpenVMS".equals(paramString)) {
      return 8192;
    }
    if (paramString.equalsIgnoreCase("mac os x")) {
      return 2048;
    }
    if (paramString.startsWith("Darwin")) {
      return 2048;
    }
    return 65536;
  }
  
  public static String getProfilerUserDir()
    throws IOException
  {
    String str = System.getProperty("nbprofiler.home");
    if (str != null)
    {
      localObject = new File(str);
      if ((!((File)localObject).exists()) && 
        (!((File)localObject).mkdir())) {
        throw new IOException("Could not create directory" + str);
      }
      return str;
    }
    Object localObject = System.getProperty("user.home") + File.separator + ".nbprofiler";
    File localFile = new File((String)localObject);
    if ((!localFile.exists()) && 
      (!localFile.mkdir())) {
      throw new IOException("Could not create directory" + (String)localObject);
    }
    return (String)localObject;
  }
  
  public static boolean isSolaris()
  {
    return getOperatingSystem() == 8;
  }
  
  public static boolean isSolarisIntel()
  {
    String str = System.getProperty("os.arch");
    
    return (isSolaris()) && ((str.endsWith("86")) || (str.equals("amd64")));
  }
  
  public static boolean isSolarisSparc()
  {
    String str = System.getProperty("os.arch");
    
    return (isSolaris()) && (str.startsWith("sparc"));
  }
  
  public static int getSystemArchitecture()
  {
    if (sysArch == 0)
    {
      String str = System.getProperty("sun.arch.data.model");
      if (str == null) {
        sysArch = 32;
      } else if ("32".equals(str)) {
        sysArch = 32;
      } else if ("64".equals(str)) {
        sysArch = 64;
      } else {
        sysArch = 32;
      }
    }
    return sysArch;
  }
  
  public static boolean isUnix()
  {
    return (getOperatingSystem() & 0xBF8) != 0;
  }
  
  public static boolean isWindows()
  {
    return (getOperatingSystem() & 0x5007) != 0;
  }
  
  public static boolean isWindows(String paramString)
  {
    return (getOperatingSystem(paramString) & 0x5007) != 0;
  }
  
  public static boolean is32bitArchitecture()
  {
    return getSystemArchitecture() == 32;
  }
  
  public static boolean is64bitArchitecture()
  {
    return getSystemArchitecture() == 64;
  }
  
  public static boolean supportsDynamicAttach(String paramString)
  {
    return ("jdk16".equals(paramString)) || ("jdk17".equals(paramString));
  }
  
  public static boolean supportsThreadSleepingStateMonitoring(String paramString)
  {
    return (paramString != null) && ((paramString.equals("jdk15")) || (paramString.equals("jdk16")) || (paramString.equals("jdk17")) || (paramString.equals("cvm")));
  }
  
  public static boolean thisVMSupportsThreadSleepingStateMonitoring()
  {
    return supportsThreadSleepingStateMonitoring(getJDKVersionNumber());
  }
  
  private static boolean supportsThreadSleepingStateMonitoring(int paramInt)
  {
    return (paramInt == 2) || (paramInt == 3) || (paramInt == 4) || (paramInt == 5);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.global.Platform
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.global;

import java.lang.reflect.Method;
import org.netbeans.lib.profiler.server.ProfilerRuntime;
import org.netbeans.lib.profiler.server.system.Timers;

public class ProfilingPointServerHandler
{
  private static ProfilingPointServerHandler instance;
  
  public static synchronized ProfilingPointServerHandler getInstance(String paramString)
  {
    if (instance == null) {
      instance = new ProfilingPointServerHandler();
    }
    return instance;
  }
  
  public static synchronized ProfilingPointServerHandler[] getInstances(String[] paramArrayOfString1, String[] paramArrayOfString2)
  {
    ProfilingPointServerHandler[] arrayOfProfilingPointServerHandler = new ProfilingPointServerHandler[paramArrayOfString1.length];
    for (int i = 0; i < paramArrayOfString1.length; i++) {
      try
      {
        Method localMethod = Class.forName(paramArrayOfString1[i]).getMethod("getInstance", new Class[] { String.class });
        arrayOfProfilingPointServerHandler[i] = ((ProfilingPointServerHandler)localMethod.invoke(null, new Object[] { paramArrayOfString2[i] }));
      }
      catch (Exception localException)
      {
        localException.printStackTrace(System.err);
      }
    }
    return arrayOfProfilingPointServerHandler;
  }
  
  public void profilingPointHit(int paramInt)
  {
    long l = Timers.getCurrentTimeInCounts();
    profilingPointHit(paramInt, l);
  }
  
  public void profilingPointHit(int paramInt, long paramLong)
  {
    ProfilerRuntime.writeProfilingPointHitEvent(paramInt, paramLong);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.lib.profiler.global.ProfilingPointServerHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.lib.profiler.global;

import org.netbeans.lib.profiler.wireprotocol.InternalStatsResponse;

public class ProfilingSessionStatus
{
  public static final int N_TIMER_CONSTANTS = 5;
  public static final int CODE_REGION_CLASS_IDX = 0;
  public InternalStatsResponse savedInternalStats;
  public String fullTargetJDKVersionString;
  public String instrClassLoaderName;
  public String javaCommand;
  public String jvmArguments;
  public String targetJDKVersionString;
  public String targetMachineOSName;
  public double[] methodEntryExitCallTime = new double[5];
  public double[] methodEntryExitInnerTime = new double[5];
  public double[] methodEntryExitOuterTime = new double[5];
  public ProfilingPointServerHandler[] profilingPointHandlers;
  public int[] profilingPointIDs;
  public long[] timerCountsInSecond = new long[2];
  public boolean absoluteTimerOn;
  public boolean remoteProfiling = false;
  public boolean runningInAttachedMode;
  public boolean startProfilingPointsActive;
  public volatile boolean targetAppRunning;
  public boolean threadCPUTimerOn;
  public int currentInstrType;
  public int instrEndLine;
  public int instrScheme;
  public int instrStartLine;
  public long dumpAbsTimeStamp;
  public long maxHeapSize;
  public long startupTimeInCounts;
  public long startupTimeMillis;
  private TransactionalSupport transaction = new TransactionalSupport();
  private int[] allocatedInstancesCount;
  private int[] classLoaderIds;
  private String[] classNames;
  private String[] instrMethodClasses;
  private boolean[] instrMethodInvoked;
  private String[] instrMethodNames;
  private String[] instrMethodSignatures;
  private int nInstrClasses;
  private int nInstrMethods;
  
  public int[] getAllocatedInstancesCount()
  {
    beginTrans(false);
    try
    {
      return allocatedInstancesCount;
    }
    finally
    {
      endTrans();
    }
  }
  
  public int[] getClassLoaderIds()
  {
    beginTrans(false);
    try
    {
      return classLoaderIds;
    }
    finally
    {
      endTrans();
    }
  }
  
  public String[] getClassNames()
  {
    beginTrans(false);
    try
    {
      return classNames;
    }
    finally
    {
      endTrans();
    }
  }
  
  public String[] getInstrMethodClasses()
  {
    beginTrans(false);
    try
    {
      return instrMethodClasses;
    }
    finally
    {
      endTrans();
    }
  }
  
  public boolean[] getInstrMethodInvoked()
  {
    beginTrans(false);
    try
    {
      return instrMethodInvoked;
    }
    finally
    {
      endTrans();
    }
  }
  
  public void setInstrMethodNames(String[] paramArrayOfString)
  {
    beginTrans(true);
    try
    {
      instrMethodNames = paramArrayOfString;
    }
    finally
    {
      endTrans();
    }
  }
  
  public String[] getInstrMethodNames()
  {
    beginTrans(false);
    try
    {
      return instrMethodNames;
    }
    finally
    {
      endTrans();
    }
  }
  
  public void setInstrMethodSignatures(String[] paramArrayOfString)
  {
    beginTrans(true);
    try
    {
      instrMethodSignatures = paramArrayOfString;
    }
    finally
    {
      endTrans();
    }
  }
  
  public String[] getInstrMethodSignatures()
  {
    beginTrans(false);
    try
    {
      return instrMethodSignatures;
    }
    finally
    {
      endTrans();
    }
  }
  
  public int getNInstrClasses()
  {
    beginTrans(false);
    try
    {
      return nInstrClasses;
    }
    finally
    {
      endTrans();
    }
  }
  
  public int getNInstrMethods()
  {
    beginTrans(false);
    try
    {
      return nInstrMethods;
    }
    finally
    {
      endTrans();
    }
  }
  
  public int getStartingMethodId()
  {
    beginTrans(false);
    try
    {
      int i;
      if (nInstrMethods > 0) {
        return nInstrMethods;
      }
      return 1;
    }
    finally
    {
      endTrans();
    }
  }
  
  public void setTimerTypes(boolean paramBoolean1, boolean paramBoolean2)
  {
    absoluteTimerOn = paramBoolean1;
    threadCPUTimerOn = paramBoolean2;
  }
  
  public void beginTrans(boolean paramBoolean)
  {
    transaction.beginTrans(paramBoolean);
  }
  
  public boolean collectingTwoTimeStamps()
  {
    return (absoluteTimerOn) && (threadCPUTimerOn);
  }
  
  public void endTrans()
  {
    transaction.endTrans();
  }
  
  public void resetInstrClassAndMethodInfo()
  {
    beginTrans(true);
    try
    {
      nInstrMethods = 0;
      instrMethodClasses = (instrMethodNames = instrMethodSignatures = null);
      instrMethodInvoked = null;
      nInstrClasses = 0;
      allocatedInstancesCount = null;
      classNames = new String[0];
    }
    finally
    {
      endTrans();
    }
  }
  
  public void updateAllocatedInstancesCountInfoInClient(String paramString)
  {
    beginTrans(true);
    try
    {
      if ((nInstrClasses == 0) || (nInstrClasses == classNames.length))
      {
        int i = nInstrClasses == 0 ? 1 : 0;
        int j = i != 0 ? 50 : nInstrClasses * 3 / 2;
        int[] arrayOfInt = new int[j];
        String[] arrayOfString = new String[j];
        if (i == 0)
        {
          System.arraycopy(allocatedInstancesCount, 0, arrayOfInt, 0, nInstrClasses);
          System.arraycopy(classNames, 0, arrayOfString, 0, nInstrClasses);
        }
        allocatedInstancesCount = arrayOfInt;
        classNames = arrayOfString;
      }
      classNames[(nInstrClasses++)] = paramString;
    }
    finally
    {
      endTrans();
    }
  }
  
  public void updateAllocatedInstancesCountInfoInServer(int paramInt)
  {
    beginTrans(true);
    try
    {
      int i = nInstrClasses == 0 ? 1 : 0;
      int j = i != 0 ? 0 : allocatedInstancesCount.length;
      int k = paramInt;
      if (j < k)
      {
        int m = k * 2;
        int[] arrayOfInt = new int[m];
        if (i == 0) {
          System.arraycopy(allocatedInstancesCount, 0, arrayOfInt, 0, nInstrClasses);
        }
        allocatedInstancesCount = arrayOfInt;
      }
      nInstrClasses = paramInt;
    }
    finally
    {
      endTrans();
    }
  }
  
  public void updateInstrMethodsInfo(int paramInt1, int paramInt2, String[] paramArrayOfString1, int[] paramArrayOfInt1, int[] paramArrayOfInt2, String[] paramArrayOfString2, String[] paramArrayOfString3, boolean[] paramArrayOfBoolean)
  {
    if (paramInt1 == 0) {
      return;
    }
    beginTrans(true);
    try
    {
      int i = nInstrMethods == 0 ? 1 : 0;
      int j = paramArrayOfString1 != null ? instrMethodNames.length : i != 0 ? 0 : instrMethodInvoked.length;
      int k = nInstrMethods + paramInt2;
      int m = i != 0 ? 1 : 0;
      int n = paramInt2 + m;
      int i1;
      if (j < k)
      {
        i1 = k * 2;
        Object localObject1;
        if (paramArrayOfString1 != null)
        {
          localObject1 = new String[i1];
          int[] arrayOfInt = new int[i1];
          String[] arrayOfString1 = new String[i1];
          String[] arrayOfString2 = new String[i1];
          if (i == 0)
          {
            System.arraycopy(instrMethodClasses, 0, localObject1, 0, nInstrMethods);
            System.arraycopy(classLoaderIds, 0, arrayOfInt, 0, nInstrMethods);
            System.arraycopy(instrMethodNames, 0, arrayOfString1, 0, nInstrMethods);
            System.arraycopy(instrMethodSignatures, 0, arrayOfString2, 0, nInstrMethods);
          }
          instrMethodClasses = ((String[])localObject1);
          classLoaderIds = arrayOfInt;
          instrMethodNames = arrayOfString1;
          instrMethodSignatures = arrayOfString2;
        }
        else
        {
          localObject1 = new boolean[i1];
          if (i == 0) {
            System.arraycopy(instrMethodInvoked, 0, localObject1, 0, nInstrMethods);
          }
          instrMethodInvoked = ((boolean[])localObject1);
        }
      }
      if (paramArrayOfString1 != null)
      {
        if (i != 0)
        {
          instrMethodClasses[0] = "Thread";
          classLoaderIds[0] = 0;
          instrMethodNames[0] = "";
          instrMethodSignatures[0] = "";
        }
        i1 = nInstrMethods + m;
        for (int i2 = 0; i2 < paramInt1; i2++) {
          for (int i3 = 0; i3 < paramArrayOfInt2[i2]; i3++)
          {
            instrMethodClasses[i1] = paramArrayOfString1[i2];
            classLoaderIds[i1] = paramArrayOfInt1[i2];
            i1++;
          }
        }
        System.arraycopy(paramArrayOfString2, 0, instrMethodNames, nInstrMethods + m, paramInt2);
        System.arraycopy(paramArrayOfString3, 0, instrMethodSignatures, nInstrMethods + m, paramInt2);
      }
      else
      {
        if (paramArrayOfBoolean != null) {
          System.arraycopy(paramArrayOfBoolean, 0, instrMethodInvoked, nInstrMethods + m, paramInt2);
        }
        if (instrScheme == 2) {
          for (i1 = nInstrMethods; i1 < nInstrMethods + n; i1++) {
            instrMethodInvoked[i1] = true;
          }
        }
      }
      nInstrMethods += n;
    }
    finally
    {
      endTrans();
    }
  }
  
  public void updateInstrMethodsInfo(String paramString1, int paramInt, String paramString2, String paramString3)
  {
    beginTrans(true);
    try
    {
      int i = nInstrMethods == 0 ? 1 : 0;
      int j = i != 0 ? 0 : instrMethodNames.length;
      int k = nInstrMethods + 1;
      int m = i != 0 ? 1 : 0;
      int n = 1 + m;
      if (j < k)
      {
        i1 = k * 2;
        
        String[] arrayOfString1 = new String[i1];
        int[] arrayOfInt = new int[i1];
        String[] arrayOfString2 = new String[i1];
        String[] arrayOfString3 = new String[i1];
        if (i == 0)
        {
          System.arraycopy(instrMethodClasses, 0, arrayOfString1, 0, nInstrMethods);
          System.arraycopy(classLoaderIds, 0, arrayOfInt, 0, nInstrMethods);
          System.arraycopy(instrMethodNames, 0, arrayOfString2, 0, nInstrMethods);
          System.arraycopy(instrMethodSignatures, 0, arrayOfString3, 0, nInstrMethods);
        }
        instrMethodClasses = arrayOfString1;
        classLoaderIds = arrayOfInt;
        instrMethodNames = arrayOfString2;
        instrMethodSignatures = arrayOfString3;
      }
      if (i != 0)
      {
        instrMethodClasses[0] = "Thread";
        classLoaderIds[0] = 0;
        instrMethodNames[0] = "";
        instrMethodSignatures[0] = "";
      }
      int i1 = nI
1 2 3 4 5 6 7 8 9 10 11

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