org.eclipse.osgi_3.8.2.v20130124-134944

onditions.get(bundlePermissions);
          boolean isEmpty = true;
          for (int i = 0; i < rowConditions.length; i++)
          {
            if ((rowConditions[i] == condition) && 
              (isSatisfied)) {
              rowConditions[i] = null;
            }
            isEmpty &= rowConditions[i] == null;
          }
          if (isEmpty) {
            row.bundleConditions.put(bundlePermissions, SecurityRow.SATISFIED_LIST);
          }
        }
      }
      synchronized (row.bundleConditions)
      {
        row.bundleConditions.put(bundlePermissions, SecurityRow.ABSTAIN_LIST);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.permadmin.SecurityRow
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.permadmin;

import org.osgi.service.condpermadmin.ConditionInfo;
import org.osgi.service.condpermadmin.ConditionalPermissionInfo;
import org.osgi.service.permissionadmin.PermissionInfo;

public class SecurityRowSnapShot
  implements ConditionalPermissionInfo
{
  private final String name;
  private final ConditionInfo[] conditionInfos;
  private final PermissionInfo[] permissionInfos;
  private final String decision;
  
  public SecurityRowSnapShot(String name, ConditionInfo[] conditionInfos, PermissionInfo[] permissionInfos, String decision)
  {
    if ((permissionInfos == null) || (permissionInfos.length == 0)) {
      throw new IllegalArgumentException("It is invalid to have empty permissionInfos");
    }
    decision = decision.toLowerCase();
    boolean d = "deny".equals(decision);
    boolean a = "allow".equals(decision);
    if (!(d | a)) {
      throw new IllegalArgumentException("Invalid decision: " + decision);
    }
    conditionInfos = conditionInfos == null ? new ConditionInfo[0] : conditionInfos;
    this.name = name;
    
    this.conditionInfos = ((ConditionInfo[])SecurityRow.cloneArray(conditionInfos));
    this.permissionInfos = ((PermissionInfo[])SecurityRow.cloneArray(permissionInfos));
    this.decision = decision;
  }
  
  public ConditionInfo[] getConditionInfos()
  {
    return (ConditionInfo[])SecurityRow.cloneArray(conditionInfos);
  }
  
  public String getAccessDecision()
  {
    return decision;
  }
  
  public String getName()
  {
    return name;
  }
  
  public PermissionInfo[] getPermissionInfos()
  {
    return (PermissionInfo[])SecurityRow.cloneArray(permissionInfos);
  }
  
  /**
   * @deprecated
   */
  public void delete()
  {
    throw new UnsupportedOperationException();
  }
  
  public String toString()
  {
    return getEncoded();
  }
  
  public String getEncoded()
  {
    return SecurityRow.getEncoded(name, conditionInfos, permissionInfos, "deny".equalsIgnoreCase(decision));
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof ConditionalPermissionInfo)) {
      return false;
    }
    return getEncoded().equals(((ConditionalPermissionInfo)obj).getEncoded());
  }
  
  public int hashCode()
  {
    return SecurityRow.getHashCode(name, conditionInfos, permissionInfos, getAccessDecision());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.permadmin.SecurityRowSnapShot
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.permadmin;

import java.security.Permission;
import java.security.PermissionCollection;
import java.util.Enumeration;

public class SecurityTable
  extends PermissionCollection
{
  private static final long serialVersionUID = -1800193310096318060L;
  static final int GRANTED = 1;
  static final int DENIED = 2;
  static final int ABSTAIN = 4;
  static final int POSTPONED = 8;
  private final SecurityRow[] rows;
  private final SecurityAdmin securityAdmin;
  
  public SecurityTable(SecurityAdmin securityAdmin, SecurityRow[] rows)
  {
    if (rows == null) {
      throw new NullPointerException("rows cannot be null!!");
    }
    this.rows = rows;
    this.securityAdmin = securityAdmin;
  }
  
  boolean isEmpty()
  {
    return rows.length == 0;
  }
  
  int evaluate(BundlePermissions bundlePermissions, Permission permission)
  {
    if (isEmpty()) {
      return 4;
    }
    boolean postponed = false;
    SecurityRow.Decision[] results = new SecurityRow.Decision[rows.length];
    int immediateDecisionIdx = -1;
    for (int i = 0; i < rows.length; i++)
    {
      try
      {
        results[i] = rows[i].evaluate(bundlePermissions, permission);
      }
      catch (Throwable localThrowable)
      {
        results[i] = SecurityRow.DECISION_ABSTAIN;
      }
      if ((decision & 0x4) == 0) {
        if ((decision & 0x8) != 0)
        {
          postponed = true;
        }
        else
        {
          if (!postponed) {
            return decision;
          }
          immediateDecisionIdx = i;
          break;
        }
      }
    }
    if (postponed)
    {
      int immediateDecision = immediateDecisionIdx < 0 ? 2 : decision;
      
      boolean allSameDecision = true;
      for (int i = immediateDecisionIdx < 0 ? results.length - 1 : immediateDecisionIdx - 1; (i >= 0) && (allSameDecision); i--) {
        if (results[i] != null) {
          if ((decision & 0x8) != 0) {
            if ((decision & immediateDecision) == 0) {
              allSameDecision = false;
            } else {
              results[i] = SecurityRow.DECISION_ABSTAIN;
            }
          }
        }
      }
      if (allSameDecision) {
        return immediateDecision;
      }
      EquinoxSecurityManager equinoxManager = securityAdmin.getSupportedSecurityManager();
      if (equinoxManager == null) {
        return 4;
      }
      equinoxManager.addConditionsForDomain(results);
    }
    return postponed ? 8 : 4;
  }
  
  SecurityRow getRow(int i)
  {
    return (rows.length <= i) || (i < 0) ? null : rows[i];
  }
  
  SecurityRow getRow(String name)
  {
    for (int i = 0; i < rows.length; i++) {
      if (name.equals(rows[i].getName())) {
        return rows[i];
      }
    }
    return null;
  }
  
  SecurityRow[] getRows()
  {
    return rows;
  }
  
  String[] getEncodedRows()
  {
    String[] encoded = new String[rows.length];
    for (int i = 0; i < rows.length; i++) {
      encoded[i] = rows[i].getEncoded();
    }
    return encoded;
  }
  
  public void add(Permission permission)
  {
    throw new SecurityException();
  }
  
  public Enumeration<Permission> elements()
  {
    return BundlePermissions.EMPTY_ENUMERATION;
  }
  
  public boolean implies(Permission permission)
  {
    return (evaluate(null, permission) & 0x1) != 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.permadmin.SecurityTable
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.permadmin;

import java.util.ArrayList;
import java.util.List;
import org.osgi.service.condpermadmin.ConditionalPermissionInfo;
import org.osgi.service.condpermadmin.ConditionalPermissionUpdate;

public class SecurityTableUpdate
  implements ConditionalPermissionUpdate
{
  private final SecurityAdmin securityAdmin;
  private final List<ConditionalPermissionInfo> rows;
  private final long timeStamp;
  
  public SecurityTableUpdate(SecurityAdmin securityAdmin, SecurityRow[] rows, long timeStamp)
  {
    this.securityAdmin = securityAdmin;
    this.timeStamp = timeStamp;
    
    this.rows = new ArrayList(rows.length);
    for (int i = 0; i < rows.length; i++) {
      this.rows.add(new SecurityRowSnapShot(rows[i].getName(), rows[i].internalGetConditionInfos(), rows[i].internalGetPermissionInfos(), rows[i].getAccessDecision()));
    }
  }
  
  public boolean commit()
  {
    return securityAdmin.commit(rows, timeStamp);
  }
  
  public List<ConditionalPermissionInfo> getConditionalPermissionInfos()
  {
    return rows;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.permadmin.SecurityTableUpdate
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.profile;

public class DefaultProfileLogger$AccumPerfData
{
  public String scope;
  public long time;
  public long enters;
  
  public DefaultProfileLogger$AccumPerfData(String scope)
  {
    this.scope = scope;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.profile.DefaultProfileLogger.AccumPerfData
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.profile;

public class DefaultProfileLogger$AccumPerfScope
{
  public String scope;
  public long enter;
  
  public DefaultProfileLogger$AccumPerfScope(String scope, long enter)
  {
    this.scope = scope;
    this.enter = enter;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.profile.DefaultProfileLogger.AccumPerfScope
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.profile;

public class DefaultProfileLogger$TimeEntry
{
  public long time;
  public String id;
  public String msg;
  public String description;
  public int flag;
  final DefaultProfileLogger this$0;
  
  protected DefaultProfileLogger$TimeEntry(DefaultProfileLogger paramDefaultProfileLogger) {}
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.profile.DefaultProfileLogger.TimeEntry
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.profile;

import java.io.File;
import java.io.PrintStream;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Stack;
import java.util.TreeMap;
import org.eclipse.osgi.framework.debug.FrameworkDebugOptions;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;

public class DefaultProfileLogger
  implements ProfileLogger
{
  protected static final String DEFAULTPROFILE_PROP = "osgi.defaultprofile.";
  protected static final String PROP_FILENAME = "osgi.defaultprofile.logfilename";
  protected static final String PROP_LOGSYNCHRONOUSLY = "osgi.defaultprofile.logsynchronously";
  protected static final String PROP_BUFFERSIZE = "osgi.defaultprofile.buffersize";
  protected static final String DEFAULTPROFILE_OPTION = "org.eclipse.osgi/defaultprofile/";
  protected static final String OPTION_FILENAME = "org.eclipse.osgi/defaultprofile/logfilename";
  protected static final String OPTION_LOGSYNCHRONOUSLY = "org.eclipse.osgi/defaultprofile/logsynchronously";
  protected static final String OPTION_BUFFERSIZE = "org.eclipse.osgi/defaultprofile/buffersize";
  protected boolean logSynchronously = false;
  protected long startTime = 0L;
  protected static final int DEFAULT_BUFFER_SIZE = 256;
  protected TimeEntry[] timeLogEntries = null;
  protected int timeEntriesIndex = 0;
  protected StringBuffer timelog = null;
  protected long launchTime = -1L;
  protected int bufferSize = 256;
  protected String logFileName = null;
  protected File logFile = null;
  private StringBuffer entryReport = new StringBuffer(120);
  private StringBuffer padsb = new StringBuffer(16);
  protected int indent;
  protected int timePaddingLength;
  protected Stack<AccumPerfScope> scopeStack;
  protected Map<String, AccumPerfData> scopeToAccumPerfDataMap;
  
  public DefaultProfileLogger()
  {
    initProps();
    
    int size = getBufferSize();
    timeLogEntries = new TimeEntry[size];
    timelog = new StringBuffer(4096);
    for (int i = 0; i < size; i++) {
      timeLogEntries[i] = timeEntryFactory();
    }
    timeEntriesIndex = 0;
    
    launchTime = getLaunchTime();
    if (launchTime == -1L) {
      startTime = getMainStartTime();
    } else {
      startTime = launchTime;
    }
    long freq = getTimerFrequency();
    for (timePaddingLength = 3; freq > 9L; timePaddingLength += 1) {
      freq /= 10L;
    }
    logInitMessages();
  }
  
  protected void logInitMessages()
  {
    int index = 0;
    if (launchTime != -1L)
    {
      logTime(0, "DefaultProfileLogger.init()", "launch time initialized", null);
      timeLogEntries[(index++)].time = launchTime;
    }
    logTime(0, "DefaultProfileLogger.init()", "start time initialized", null);
    timeLogEntries[(index++)].time = getMainStartTime();
  }
  
  protected long getLaunchTime()
  {
    String launchTimeString = FrameworkProperties.getProperty("launch.startMillis");
    if (launchTimeString != null) {
      return Long.parseLong(launchTimeString);
    }
    return -1L;
  }
  
  protected long getMainStartTime()
  {
    String timeString = FrameworkProperties.getProperty("eclipse.startTime");
    if (timeString != null) {
      return Long.parseLong(timeString);
    }
    return System.currentTimeMillis();
  }
  
  public void initProps()
  {
    FrameworkDebugOptions dbgOptions = null;
    if (FrameworkProperties.getProperty("osgi.debug") != null)
    {
      dbgOptions = FrameworkDebugOptions.getDefault();
      if (dbgOptions != null)
      {
        logFileName = dbgOptions.getOption("org.eclipse.osgi/defaultprofile/logfilename");
        logSynchronously = dbgOptions.getBooleanOption("org.eclipse.osgi/defaultprofile/logsynchronously", false);
        int size = dbgOptions.getIntegerOption("org.eclipse.osgi/defaultprofile/buffersize", 0);
        if (size > 0) {
          bufferSize = size;
        }
      }
    }
    String prop;
    if ((prop = FrameworkProperties.getProperty("osgi.defaultprofile.logfilename")) != null)
    {
      logFileName = prop;
      if (dbgOptions != null) {
        dbgOptions.setOption("org.eclipse.osgi/defaultprofile/logfilename", logFileName);
      }
    }
    if ((prop = FrameworkProperties.getProperty("osgi.defaultprofile.logsynchronously")) != null)
    {
      logSynchronously = Boolean.valueOf(prop).booleanValue();
      if (dbgOptions != null) {
        dbgOptions.setOption("org.eclipse.osgi/defaultprofile/logsynchronously", new Boolean(logSynchronously).toString());
      }
    }
    if ((prop = FrameworkProperties.getProperty("osgi.defaultprofile.buffersize")) != null) {
      try
      {
        int value = Integer.parseInt(prop);
        if (value > 0)
        {
          bufferSize = value;
          if (dbgOptions != null) {
            dbgOptions.setOption("org.eclipse.osgi/defaultprofile/buffersize", Integer.toString(bufferSize));
          }
        }
      }
      catch (NumberFormatException localNumberFormatException) {}
    }
  }
  
  public synchronized void logTime(int flag, String id, String msg, String description)
  {
    if (timeEntriesIndex == timeLogEntries.length)
    {
      makeLog();
      logTime(0, "Profile.logTime()", "log entries rolled", null);
    }
    TimeEntry entry = timeLogEntries[(timeEntriesIndex++)];
    time = getTime();
    id = id;
    msg = msg;
    flag = flag;
    description = description;
    if (logSynchronously) {
      System.out.print(getProfileLog().substring(2));
    }
  }
  
  public synchronized String getProfileLog()
  {
    String log = getProfileLogReport();
    writeToProfileLogFile(log);
    return log;
  }
  
  public synchronized void accumLogEnter(String scope)
  {
    if (scopeStack == null) {
      scopeStack = new Stack();
    }
    if (scopeToAccumPerfDataMap == null) {
      scopeToAccumPerfDataMap = new TreeMap();
    }
    scopeStack.push(new AccumPerfScope(scope, getTime()));
  }
  
  public synchronized void accumLogExit(String scope)
  {
    long exit = getTime();
    if (scopeStack == null) {
      scopeStack = new Stack();
    }
    if (scopeToAccumPerfDataMap == null) {
      scopeToAccumPerfDataMap = new TreeMap();
    }
    AccumPerfScope then = (AccumPerfScope)scopeStack.pop();
    if (then == null)
    {
      System.err.println("ACCUM PERF ERROR: Scope stack empty: " + scope);
    }
    else
    {
      if (!scope.equals(scope)) {
        System.err.println("ACCUM PERF ERROR: Scope mismatch: then='" + scope + "', now='" + scope + "'");
      }
      AccumPerfData now = (AccumPerfData)scopeToAccumPerfDataMap.get(scope);
      if (now == null)
      {
        now = new AccumPerfData(scope);
        scopeToAccumPerfDataMap.put(scope, now);
      }
      time += exit - enter;
      enters += 1L;
    }
  }
  
  protected long getTime()
  {
    return System.currentTimeMillis();
  }
  
  protected long getTimerFrequency()
  {
    return 1000L;
  }
  
  protected TimeEntry findCompareEntry(int index, String id, int flag)
  {
    if (index > 0) {
      index--;
    }
    int prev = index;
    if (flag != 1) {
      while (index >= 0)
      {
        TimeEntry entry = timeLogEntries[index];
        if (id.equals(id)) {
          switch (flag)
          {
          case 0: 
            return entry;
          case 2: 
            if (flag == 1) {
              return entry;
            }
            break;
          }
        }
        index--;
      }
    }
    return timeLogEntries[prev];
  }
  
  protected String entryReport(TimeEntry entry, TimeEntry compareWith)
  {
    entryReport.setLength(0);
    if (flag == 1) {
      indent += 1;
    }
    long zeroTime = getRelativeTime(getStartTime());
    
    entryReport.append('-');
    long entryTime = getRelativeTime(time);
    long diff = entryTime - zeroTime;
    entryReport.append(pad(Long.toString(diff), timePaddingLength));
    entryReport.append(" :");
    diff = time - time;
    entryReport.append(pad(Long.toString(diff), timePaddingLength));
    entryReport.append(pad("", indent * 2));
    if (flag == 1) {
      entryReport.append(" >> ");
    } else if (flag == 2) {
      entryReport.append(" << ");
    } else if (flag == 0) {
      entryReport.append(" -- ");
    }
    entryReport.append(id);
    entryReport.append(" > ");
    entryReport.append(msg);
    if (description != null)
    {
      entryReport.append(" :: ");
      entryReport.append(description);
    }
    entryReport.append("\r\n");
    if (flag == 2) {
      indent -= 1;
    }
    return entryReport.toString();
  }
  
  protected String accumEntryReport(AccumPerfData d)
  {
    return "     " + scope + ":enters=" + enters + ";time=" + time + ";\r\n";
  }
  
  protected void makeLog()
  {
    indent = 0;
    timelog.append("\r\n");
    for (int i = 0; i < timeEntriesIndex; i++)
    {
      entry = timeLogEntries[i];
      TimeEntry cmpEntry = findCompareEntry(i, id, flag);
      timelog.append(entryReport(entry, cmpEntry));
    }
    timeEntriesIndex = 0;
    if ((scopeToAccumPerfDataMap == null) || (scopeToAccumPerfDataMap.isEmpty())) {
      return;
    }
    timelog.append("\r\n");
    timelog.append("Cumulative Log:\r\n");
    for (TimeEntry entry = scopeToAccumPerfDataMap.values().iterator(); entry.hasNext();)
    {
      AccumPerfData d = (AccumPerfData)entry.next();
      timelog.append(accumEntryReport(d));
    }
    scopeToAccumPerfDataMap.clear();
  }
  
  protected String pad(String str, int size)
  {
    padsb.setLength(0);
    int len = str.length();
    int count = size - len;
    for (int i = 0; i < count; i++) {
      padsb.append(' ');
    }
    padsb.append(str);
    return padsb.toString();
  }
  
  protected String getProfileLogReport()
  {
    if (timelog == null) {
      return "";
    }
    makeLog();
    String log = timelog.toString();
    timelog.setLength(0);
    return log;
  }
  
  /* Error */
  protected void writeToProfileLogFile(String log)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 463	org/eclipse/osgi/internal/profile/DefaultProfileLogger:getProfileLogFile	()Ljava/io/File;
    //   4: astore_2
    //   5: aload_2
    //   6: ifnonnull +4 -> 10
    //   9: return
    //   10: aconst_null
    //   11: astore_3
    //   12: new 229	java/io/FileWriter
    //   15: dup
    //   16: aload_2
    //   17: invokevirtual 415	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   20: iconst_1
    //   21: invokespecial 419	java/io/FileWriter:<init>	(Ljava/lang/String;Z)V
    //   24: astore_3
    //   25: aload_3
    //   26: aload_1
    //   27: invokevirtual 418	java/io/FileWriter:write	(Ljava/lang/String;)V
    //   30: goto +42 -> 72
    //   33: astore 4
    //   35: aload 4
    //   37: invokevirtual 420	java/io/IOException:printStackTrace	()V
    //   40: aload_3
    //   41: ifnull +43 -> 84
    //   44: aload_3
    //   45: invokevirtual 417	java/io/FileWriter:close	()V
    //   48: goto +36 -> 84
    //   51: pop
    //   52: goto +32 -> 84
    //   55: astore 5
    //   57: aload_3
    //   58: ifnull +11 -> 69
    //   61: aload_3
    //   62: invokevirtual 417	java/io/FileWriter:close	()V
    //   65: goto +4 -> 69
    //   68: pop
    //   69: aload 5
    //   71: athrow
    //   72: aload_3
    //   73: ifnull +11 -> 84
    //   76: aload_3
    //   77: invokevirtual 417	java/io/FileWriter:close	()V
    //   80: goto +4 -> 84
    //   83: pop
    //   84: return
    // Line number table:
    //   Java source line #320	-> byte code offset #0
    //   Java source line #321	-> byte code offset #5
    //   Java source line #322	-> byte code offset #9
    //   Java source line #323	-> byte code offset #10
    //   Java source line #325	-> byte code offset #12
    //   Java source line #326	-> byte code offset #25
    //   Java source line #327	-> byte code offset #30
    //   Java source line #328	-> byte code offset #35
    //   Java source line #330	-> byte code offset #40
    //   Java source line #332	-> byte code offset #44
    //   Java source line #333	-> byte code offset #48
    //   Java source line #329	-> byte code offset #55
    //   Java source line #330	-> byte code offset #57
    //   Java source line #332	-> byte code offset #61
    //   Java source line #333	-> byte code offset #65
    //   Java source line #336	-> byte code offset #69
    //   Java source line #330	-> byte code offset #72
    //   Java source line #332	-> byte code offset #76
    //   Java source line #333	-> byte code offset #80
    //   Java source line #337	-> byte code offset #84
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	85	0	this	DefaultProfileLogger
    //   0	85	1	log	String
    //   4	13	2	profileLog	File
    //   11	66	3	fw	java.io.FileWriter
    //   33	3	4	e	java.io.IOException
    //   55	15	5	localObject	Object
    //   51	1	6	localIOException1	java.io.IOException
    //   68	1	7	localIOException2	java.io.IOException
    //   83	1	8	localIOException3	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   12	30	33	java/io/IOException
    //   44	48	51	java/io/IOException
    //   12	40	55	finally
    //   61	65	68	java/io/IOException
    //   76	80	83	java/io/IOException
  }
  
  protected File getProfileLogFile()
  {
    if ((logFile == null) && 
      (logFileName != null) && (logFileName.length() > 0)) {
      logFile = new File(logFileName);
    }
    return logFile;
  }
  
  protected long getStartTime()
  {
    return startTime;
  }
  
  protected long getRelativeTime(long absoluteTime)
  {
    return absoluteTime;
  }
  
  protected int getBufferSize()
  {
    if (bufferSize < 2) {
      return 256;
    }
    return bufferSize;
  }
  
  protected TimeEntry timeEntryFactory()
  {
    return new TimeEntry();
  }
  
  protected static class AccumPerfData
  {
    public String scope;
    public long time;
    public long enters;
    
    public AccumPerfData(String scope)
    {
      this.scope = scope;
    }
  }
  
  protected static class AccumPerfScope
  {
    public String scope;
    public long enter;
    
    public AccumPerfScope(String scope, long enter)
    {
      this.scope = scope;
      this.enter = enter;
    }
  }
  
  protected class TimeEntry
  {
    public long time;
    public String id;
    public String msg;
    public String description;
    public int flag;
    
    protected TimeEntry() {}
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.profile.DefaultProfileLogger
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.profile;

import org.eclipse.osgi.framework.debug.FrameworkDebugOptions;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;

public class Profile
{
  public static final boolean PROFILE = true;
  public static boolean STARTUP = false;
  public static boolean BENCHMARK = false;
  public static boolean DEBUG = false;
  private static final String OSGI_PROP = "osgi.profile.";
  private static final String PROP_STARTUP = "osgi.profile.startup";
  private static final String PROP_BENCHMARK = "osgi.profile.benchmark";
  private static final String PROP_DEBUG = "osgi.profile.debug";
  private static final String PROP_IMPL = "osgi.profile.impl";
  private static final String OSGI_OPTION = "org.eclipse.osgi/profile/";
  private static final String OPTION_STARTUP = "org.eclipse.osgi/profile/startup";
  private static final String OPTION_BENCHMARK = "org.eclipse.osgi/profile/benchmark";
  private static final String OPTION_DEBUG = "org.eclipse.osgi/profile/debug";
  private static final String OPTION_IMPL = "org.eclipse.osgi/profile/impl";
  public static final int FLAG_NONE = 0;
  public static final int FLAG_ENTER = 1;
  public static final int FLAG_EXIT = 2;
  public static final String ENTER_DESCRIPTION = "enter";
  public static final String EXIT_DESCRIPTION = "exit";
  private static ProfileLogger profileLogger = null;
  private static String profileLoggerClassName = null;
  
  static
  {
    initProps();
  }
  
  public static void initProps()
  {
    FrameworkDebugOptions dbgOptions = null;
    if (FrameworkProperties.getProperty("osgi.debug") != null)
    {
      dbgOptions = FrameworkDebugOptions.getDefault();
      if (dbgOptions != null)
      {
        STARTUP = dbgOptions.getBooleanOption("org.eclipse.osgi/profile/startup", false);
        BENCHMARK = dbgOptions.getBooleanOption("org.eclipse.osgi/profile/benchmark", false);
        DEBUG = dbgOptions.getBooleanOption("org.eclipse.osgi/profile/debug", false);
        if (profileLogger == null) {
          profileLoggerClassName = dbgOptions.getOption("org.eclipse.osgi/profile/impl");
        }
      }
    }
    String prop;
    if ((prop = FrameworkProperties.getProperty("osgi.profile.startup")) != null)
    {
      STARTUP = Boolean.valueOf(prop).booleanValue();
      if (dbgOptions != null) {
        dbgOptions.setOption("org.eclipse.osgi/profile/startup", new Boolean(STARTUP).toString());
      }
    }
    if ((prop = FrameworkProperties.getProperty("osgi.profile.benchmark")) != null)
    {
      BENCHMARK = Boolean.valueOf(prop).booleanValue();
      if (dbgOptions != null) {
        dbgOptions.setOption("org.eclipse.osgi/profile/benchmark", new Boolean(BENCHMARK).toString());
      }
    }
    if ((prop = FrameworkProperties.getProperty("osgi.profile.debug")) != null)
    {
      DEBUG = Boolean.valueOf(prop).booleanValue();
      if (dbgOptions != null) {
        dbgOptions.setOption("org.eclipse.osgi/profile/debug", new Boolean(DEBUG).toString());
      }
    }
    if (profileLogger == null)
    {
      if ((prop = FrameworkProperties.getProperty("osgi.profile.impl")) != null)
      {
        profileLoggerClassName = prop;
        if (dbgOptions != null) {
          dbgOptions.setOption("org.eclipse.osgi/profile/impl", profileLoggerClassName);
        }
      }
    }
    else {
      profileLogger.initProps();
    }
  }
  
  public static void logEnter(String id)
  {
    logTime(1, id, "enter", null);
  }
  
  public static void logEnter(String id, String description)
  {
    logTime(1, id, "enter", description);
  }
  
  public static void logExit(String id)
  {
    logTime(2, id, "exit", null);
  }
  
  public static void logExit(String id, String description)
  {
    logTime(2, id, "exit", description);
  }
  
  public static void logTime(String id, String msg)
  {
    logTime(0, id, msg, null);
  }
  
  public static void logTime(String id, String msg, String description)
  {
    logTime(0, id, msg, description);
  }
  
  public static void logTime(int flag, String id, String msg, String description)
  {
    if (profileLogger == null) {
      profileLogger = createProfileLogger();
    }
    profileLogger.logTime(flag, id, msg, description);
  }
  
  public static void accumLogEnter(String scope)
  {
    if (profileLogger == null) {
      profileLogger = createProfileLogger();
    }
    profileLogger.accumLogEnter(scope);
  }
  
  public static void accumLogExit(String scope)
  {
    if (profileLogger == null) {
      profileLogger = createProfileLogger();
    }
    profileLogger.accumLogExit(scope);
  }
  
  public static String getProfileLog()
  {
    if (profileLogger != null) {
      return profileLogger.getProfileLog();
    }
    return "";
  }
  
  private static ProfileLogger createProfileLogger()
  {
    ProfileLogger result = null;
    if (profileLoggerClassName != null)
    {
      Class<?> profileImplClass = null;
      try
      {
        profileImplClass = Class.forName(profileLoggerClassName);
        result = (ProfileLogger)profileImplClass.newInstance();
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
    }
    if (result == null) {
      result = new DefaultProfileLogger();
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.profile.Profile
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.profile;

public abstract interface ProfileLogger
{
  public abstract void initProps();
  
  public abstract void logTime(int paramInt, String paramString1, String paramString2, String paramString3);
  
  public abstract void accumLogEnter(String paramString);
  
  public abstract void accumLogExit(String paramString);
  
  public abstract String getProfileLog();
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.profile.ProfileLogger
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.service.security;

import org.eclipse.osgi.framework.eventmgr.EventDispatcher;

class AuthorizationEngine$AuthEventDispatcher
  implements EventDispatcher<AuthorizationListener, Object, AuthorizationEvent>
{
  final AuthorizationEngine this$0;
  
  AuthorizationEngine$AuthEventDispatcher(AuthorizationEngine paramAuthorizationEngine) {}
  
  public void dispatchEvent(AuthorizationListener eventListener, Object listenerObject, int eventAction, AuthorizationEvent eventObject)
  {
    eventListener.authorizationEvent(eventObject);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.service.security.AuthorizationEngine.AuthEventDispatcher
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.service.security;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.osgi.framework.eventmgr.EventDispatcher;
import org.eclipse.osgi.framework.eventmgr.EventManager;
import org.eclipse.osgi.framework.eventmgr.ListenerQueue;
import org.eclipse.osgi.signedcontent.SignedContent;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;

public abstract class AuthorizationEngine
{
  private EventManager manager = new EventManager();
  private EventDispatcher<AuthorizationListener, Object, AuthorizationEvent> dispatcher = new AuthEventDispatcher();
  private final ServiceTracker<AuthorizationListener, AuthorizationListener> listenerTracker;
  
  public AuthorizationEngine(BundleContext context)
  {
    listenerTracker = new ServiceTracker(context, AuthorizationListener.class.getName(), null);
    listenerTracker.open();
  }
  
  public final void authorize(SignedContent content, Object context)
  {
    fireEvent(doAuthorize(content, context));
  }
  
  private void fireEvent(AuthorizationEvent event)
  {
    if (event == null) {
      return;
    }
    Object[] services = listenerTracker.getServices();
    if (services == null) {
      return;
    }
    Map<AuthorizationListener, Object> listeners = new HashMap();
    Object[] arrayOfObject1;
    int j = (arrayOfObject1 = services).length;
    for (int i = 0; i < j; i++)
    {
      Object service = arrayOfObject1[i];
      listeners.put((AuthorizationListener)service, service);
    }
    ListenerQueue<AuthorizationListener, Object, AuthorizationEvent> queue = new ListenerQueue(manager);
    queue.queueListeners(listeners.entrySet(), dispatcher);
    queue.dispatchEventSynchronous(0, event);
  }
  
  protected abstract AuthorizationEvent doAuthorize(SignedContent paramSignedContent, Object paramObject);
  
  public abstract int getStatus();
  
  class AuthEventDispatcher
    implements EventDispatcher<AuthorizationListener, Object, AuthorizationEvent>
  {
    AuthEventDispatcher() {}
    
    public void dispatchEvent(AuthorizationListener eventListener, Object listenerObject, int eventAction, AuthorizationEvent eventObject)
    {
      eventListener.authorizationEvent(eventObject);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.service.security.AuthorizationEngine
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.service.security;

import org.eclipse.osgi.signedcontent.SignedContent;

public class AuthorizationEvent
{
  public static final int ALLOWED = 0;
  public static final int DENIED = 1;
  private final int result;
  private final SignedContent content;
  private final Object context;
  private final int severity;
  
  public AuthorizationEvent(int result, SignedContent content, Object context, int severity)
  {
    this.result = result;
    this.content = content;
    this.context = context;
    this.severity = severity;
  }
  
  public int getResult()
  {
    return result;
  }
  
  public int getSeverity()
  {
    return severity;
  }
  
  public SignedContent getSignedContent()
  {
    return content;
  }
  
  public Object getContext()
  {
    return context;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.service.security.AuthorizationEvent
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.service.security;

import java.util.EventListener;

public abstract interface AuthorizationListener
  extends EventListener
{
  public abstract void authorizationEvent(AuthorizationEvent paramAuthorizationEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.service.security.AuthorizationListener
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.service.security;

public class AuthorizationStatus
{
  public static final int OK = 0;
  public static final int ERROR = 1;
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.service.security.AuthorizationStatus
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.verifier;

import java.security.cert.Certificate;
import java.util.Date;

public abstract interface CertificateChain
{
  public abstract String getChain();
  
  public abstract Certificate[] getCertificates();
  
  public abstract Certificate getSigner();
  
  public abstract Certificate getRoot();
  
  public abstract boolean isTrusted();
  
  public abstract Date getSigningTime();
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.verifier.CertificateChain
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.verifier;

import java.security.cert.Certificate;
import java.security.cert.CertificateException;

public abstract interface CertificateTrustAuthority
{
  public abstract void checkTrust(Certificate[] paramArrayOfCertificate)
    throws CertificateException;
  
  public abstract void addTrusted(Certificate[] paramArrayOfCertificate)
    throws CertificateException;
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.verifier.CertificateTrustAuthority
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.verifier;

import java.security.SignatureException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateExpiredException;

public abstract interface CertificateVerifier
{
  public abstract void checkContent()
    throws CertificateException, CertificateExpiredException, SignatureException;
  
  public abstract String[] verifyContent();
  
  public abstract boolean isSigned();
  
  public abstract CertificateChain[] getChains();
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.verifier.CertificateVerifier
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.provisional.verifier;

import java.io.File;
import java.io.IOException;
import org.osgi.framework.Bundle;

public abstract interface CertificateVerifierFactory
{
  public abstract CertificateVerifier getVerifier(File paramFile)
    throws IOException;
  
  public abstract CertificateVerifier getVerifier(Bundle paramBundle)
    throws IOException;
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.provisional.verifier.CertificateVerifierFactory
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.resolver;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.osgi.service.resolver.BaseDescription;
import org.eclipse.osgi.service.resolver.extras.DescriptionReference;
import org.osgi.framework.wiring.BundleCapability;
import org.osgi.framework.wiring.BundleRevision;

class BaseDescriptionImpl$BaseCapability
  implements BundleCapability, DescriptionReference
{
  private final String namespace;
  final BaseDescriptionImpl this$0;
  
  public BaseDescriptionImpl$BaseCapability(BaseDescriptionImpl paramBaseDescriptionImpl, String namespace)
  {
    this.namespace = namespace;
  }
  
  public BundleRevision getRevision()
  {
    return this$0.getSupplier();
  }
  
  public String getNamespace()
  {
    return namespace;
  }
  
  public Map<String, String> getDirectives()
  {
    return this$0.getDeclaredDirectives();
  }
  
  public Map<String, Object> getAttributes()
  {
    Map<String, Object> attrs = this$0.getDeclaredAttributes();
    String internalName = this$0.getInternalNameSpace();
    if (namespace.equals(internalName)) {
      return attrs;
    }
    attrs = new HashMap(attrs);
    Object nameValue = attrs.remove(internalName);
    if (nameValue != null) {
      attrs.put(namespace, nameValue);
    }
    return Collections.unmodifiableMap(attrs);
  }
  
  public int hashCode()
  {
    return System.identityHashCode(this$0);
  }
  
  protected BaseDescriptionImpl getBaseDescription()
  {
    return this$0;
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof BaseCapability)) {
      return false;
    }
    return (((BaseCapability)obj).getBaseDescription() == this$0) && (namespace.equals(((BaseCapability)obj).getNamespace()));
  }
  
  public String toString()
  {
    return getNamespace() + BaseDescriptionImpl.toString(getAttributes(), false) + BaseDescriptionImpl.toString(getDirectives(), true);
  }
  
  public BundleRevision getResource()
  {
    return getRevision();
  }
  
  public BaseDescription getDescription()
  {
    return this$0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.resolver.BaseDescriptionImpl.BaseCapability
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.resolver;

import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.osgi.service.resolver.BaseDescription;
import org.eclipse.osgi.service.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

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-2019. Infinite Loop Ltd