org.eclipse.osgi_3.8.2.v20130124-134944

 #997	-> byte code offset #1077
    //   Java source line #998	-> byte code offset #1082
    //   Java source line #999	-> byte code offset #1091
    //   Java source line #1000	-> byte code offset #1097
    //   Java source line #1001	-> byte code offset #1106
    //   Java source line #999	-> byte code offset #1117
    //   Java source line #1003	-> byte code offset #1128
    //   Java source line #1004	-> byte code offset #1131
    //   Java source line #1006	-> byte code offset #1140
    //   Java source line #1007	-> byte code offset #1143
    //   Java source line #1008	-> byte code offset #1153
    //   Java source line #1009	-> byte code offset #1158
    //   Java source line #1010	-> byte code offset #1167
    //   Java source line #1011	-> byte code offset #1173
    //   Java source line #1012	-> byte code offset #1182
    //   Java source line #1010	-> byte code offset #1193
    //   Java source line #1014	-> byte code offset #1204
    //   Java source line #1015	-> byte code offset #1207
    //   Java source line #1019	-> byte code offset #1216
    //   Java source line #1020	-> byte code offset #1226
    //   Java source line #1021	-> byte code offset #1229
    //   Java source line #1022	-> byte code offset #1234
    //   Java source line #1023	-> byte code offset #1240
    //   Java source line #1024	-> byte code offset #1254
    //   Java source line #1025	-> byte code offset #1261
    //   Java source line #1022	-> byte code offset #1264
    //   Java source line #1030	-> byte code offset #1275
    //   Java source line #1031	-> byte code offset #1280
    //   Java source line #1032	-> byte code offset #1289
    //   Java source line #1033	-> byte code offset #1298
    //   Java source line #1034	-> byte code offset #1301
    //   Java source line #1035	-> byte code offset #1310
    //   Java source line #1036	-> byte code offset #1319
    //   Java source line #1037	-> byte code offset #1328
    //   Java source line #1038	-> byte code offset #1336
    //   Java source line #1039	-> byte code offset #1346
    //   Java source line #1040	-> byte code offset #1355
    //   Java source line #1041	-> byte code offset #1358
    //   Java source line #1044	-> byte code offset #1367
    //   Java source line #1045	-> byte code offset #1370
    //   Java source line #1046	-> byte code offset #1376
    //   Java source line #1047	-> byte code offset #1386
    //   Java source line #1049	-> byte code offset #1389
    //   Java source line #1050	-> byte code offset #1401
    //   Java source line #1051	-> byte code offset #1406
    //   Java source line #1053	-> byte code offset #1409
    //   Java source line #1054	-> byte code offset #1415
    //   Java source line #1055	-> byte code offset #1424
    //   Java source line #1056	-> byte code offset #1429
    //   Java source line #1057	-> byte code offset #1438
    //   Java source line #1058	-> byte code offset #1447
    //   Java source line #1060	-> byte code offset #1450
    //   Java source line #1061	-> byte code offset #1459
    //   Java source line #1063	-> byte code offset #1470
    //   Java source line #1064	-> byte code offset #1482
    //   Java source line #1065	-> byte code offset #1491
    //   Java source line #1066	-> byte code offset #1499
    //   Java source line #1053	-> byte code offset #1508
    //   Java source line #1045	-> byte code offset #1519
    //   Java source line #1070	-> byte code offset #1530
    //   Java source line #1071	-> byte code offset #1535
    //   Java source line #1072	-> byte code offset #1544
    //   Java source line #1076	-> byte code offset #1553
    //   Java source line #1077	-> byte code offset #1558
    //   Java source line #1078	-> byte code offset #1570
    //   Java source line #1077	-> byte code offset #1573
    //   Java source line #1080	-> byte code offset #1585
    //   Java source line #1081	-> byte code offset #1588
    //   Java source line #1082	-> byte code offset #1597
    //   Java source line #1085	-> byte code offset #1606
    //   Java source line #1086	-> byte code offset #1611
    //   Java source line #1087	-> byte code offset #1616
    //   Java source line #1089	-> byte code offset #1622
    //   Java source line #1092	-> byte code offset #1630
    //   Java source line #837	-> byte code offset #1637
    //   Java source line #1094	-> byte code offset #1641
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	1642	0	this	FrameworkCommandProvider
    //   0	1642	1	intp	CommandInterpreter
    //   6	1632	2	nextArg	String
    //   30	1587	3	bundle	AbstractBundle
    //   39	62	4	id	long
    //   118	12	6	dataRoot	File
    //   169	144	6	services	ServiceReference[]
    //   134	7	7	root	String
    //   195	29	7	j	int
    //   282	29	7	j	int
    //   351	1227	7	packageAdminRef	ServiceReference<?>
    //   362	610	8	desc	BundleDescription
    //   1609	3	8	sm	SecurityManager
    //   370	1161	9	title	boolean
    //   1620	4	9	domain	java.security.ProtectionDomain
    //   379	165	10	exports	ExportPackageDescription[]
    //   417	125	11	i	int
    //   587	169	11	fragmentsImportPackages	List<ImportPackageSpecification>
    //   1038	179	11	packageAdmin	PackageAdmin
    //   596	56	12	fragments	BundleDescription[]
    //   1075	48	12	hosts	Bundle[]
    //   1151	48	12	fragments	Bundle[]
    //   1224	301	12	requiredBundles	org.osgi.service.packageadmin.RequiredBundle[]
    //   599	51	13	i	int
    //   690	41	13	importPackages	ImportPackageSpecification[]
    //   775	180	13	importPackages	ImportPackageSpecification[]
    //   1092	29	13	i	int
    //   1168	29	13	i	int
    //   1227	155	13	requiredBundle	org.osgi.service.packageadmin.RequiredBundle
    //   614	27	14	fragmentImports	ImportPackageSpecification[]
    //   674	46	14	directImportPackages	ImportPackageSpecification[]
    //   778	184	14	imports	ExportPackageDescription[]
    //   1235	33	14	i	int
    //   1371	152	14	i	int
    //   617	22	15	j	int
    //   693	19	15	i	int
    //   722	11	15	offset	int
    //   809	184	15	unresolvedImports	List<ImportPackageSpecification>
    //   1399	115	15	depBundles	Bundle[]
    //   725	29	16	i	int
    //   812	141	16	i	int
    //   1410	102	16	j	int
    //   891	41	17	isResolvable	boolean
    //   1480	13	17	provider	Bundle
    //   894	30	18	j	int
    //   1556	15	19	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   372	1556	1556	finally
  }
  
  private boolean printImportedPackages(ExportPackageDescription[] importedPkgs, CommandInterpreter intp, boolean title)
  {
    for (int i = 0; i < importedPkgs.length; i++)
    {
      if (title)
      {
        intp.print("  ");
        intp.println(ConsoleMsg.CONSOLE_IMPORTED_PACKAGES_MESSAGE);
        title = false;
      }
      intp.print("    ");
      intp.print(importedPkgs[i].getName());
      intp.print("; version=\"");
      intp.print(importedPkgs[i].getVersion());
      intp.print("\"");
      Bundle exporter = context.getBundle(importedPkgs[i].getSupplier().getBundleId());
      if (exporter != null)
      {
        intp.print("<");
        intp.print(exporter);
        intp.println(">");
      }
      else
      {
        intp.print("<");
        intp.print(ConsoleMsg.CONSOLE_STALE_MESSAGE);
        intp.println(">");
      }
    }
    return title;
  }
  
  private void printUnwiredDynamicImports(List<ImportPackageSpecification> dynamicImports, CommandInterpreter intp)
  {
    for (int i = 0; i < dynamicImports.size(); i++)
    {
      ImportPackageSpecification importPackage = (ImportPackageSpecification)dynamicImports.get(i);
      intp.print("    ");
      intp.print(importPackage.getName());
      intp.print("; version=\"");
      intp.print(importPackage.getVersionRange());
      intp.print("\"");
      intp.print("<");
      intp.print("unwired");
      intp.print(">");
      intp.print("<");
      intp.print(importPackage.getDirective("resolution"));
      intp.println(">");
    }
  }
  
  public void _gc(CommandInterpreter intp)
    throws Exception
  {
    long before = Runtime.getRuntime().freeMemory();
    
    System.gc();
    System.gc();
    System.runFinalization();
    try
    {
      Thread.sleep(100L);
    }
    catch (InterruptedException localInterruptedException) {}
    long after = Runtime.getRuntime().freeMemory();
    intp.print(ConsoleMsg.CONSOLE_TOTAL_MEMORY_MESSAGE);
    intp.println(String.valueOf(Runtime.getRuntime().totalMemory()));
    intp.print(ConsoleMsg.CONSOLE_FREE_MEMORY_BEFORE_GARBAGE_COLLECTION_MESSAGE);
    intp.println(String.valueOf(before));
    intp.print(ConsoleMsg.CONSOLE_FREE_MEMORY_AFTER_GARBAGE_COLLECTION_MESSAGE);
    intp.println(String.valueOf(after));
    intp.print(ConsoleMsg.CONSOLE_MEMORY_GAINED_WITH_GARBAGE_COLLECTION_MESSAGE);
    intp.println(String.valueOf(after - before));
  }
  
  public void _init(CommandInterpreter intp)
    throws Exception
  {
    if (framework.isActive())
    {
      intp.print("\r\n");
      intp.println(ConsoleMsg.CONSOLE_FRAMEWORK_LAUNCHED_PLEASE_SHUTDOWN_MESSAGE);
      return;
    }
    AbstractBundle[] bundles = (AbstractBundle[])context.getBundles();
    
    int size = bundles.length;
    if (size > 0) {
      for (int i = 0; i < size; i++)
      {
        AbstractBundle bundle = bundles[i];
        if (bundle.getBundleId() != 0L) {
          try
          {
            bundle.uninstall();
          }
          catch (BundleException e)
          {
            intp.printStackTrace(e);
          }
        }
      }
    } else {
      intp.println(ConsoleMsg.CONSOLE_NO_INSTALLED_BUNDLES_ERROR);
    }
    if (securityAdmin != null)
    {
      securityAdmin.setDefaultPermissions(null);
      String[] permLocations = securityAdmin.getLocations();
      if (permLocations != null) {
        for (int i = 0; i < permLocations.length; i++) {
          securityAdmin.setPermissions(permLocations[i], null);
        }
      }
      ConditionalPermissionUpdate update = securityAdmin.newConditionalPermissionUpdate();
      update.getConditionalPermissionInfos().clear();
      update.commit();
    }
    if (securityAdmin != null) {
      for (Enumeration<ConditionalPermissionInfo> infos = securityAdmin.getConditionalPermissionInfos(); infos.hasMoreElements();) {
        ((ConditionalPermissionInfo)infos.nextElement()).delete();
      }
    }
  }
  
  public void _close(CommandInterpreter intp)
    throws Exception
  {
    intp.println();
    framework.close();
    System.exit(0);
  }
  
  public void _r(CommandInterpreter intp)
    throws Exception
  {
    _refresh(intp);
  }
  
  public void _refresh(CommandInterpreter intp)
    throws Exception
  {
    ServiceReference<?> packageAdminRef = context.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
    if (packageAdminRef != null)
    {
      PackageAdmin packageAdmin = (PackageAdmin)context.getService(packageAdminRef);
      if (packageAdmin != null)
      {
        try
        {
          Bundle[] refresh = null;
          
          String token = intp.nextArgument();
          if (token != null)
          {
            List<Bundle> bundles = new ArrayList();
            while (token != null)
            {
              AbstractBundle bundle = getBundleFromToken(intp, token, true);
              if (bundle != null) {
                bundles.add(bundle);
              }
              token = intp.nextArgument();
            }
            int size = bundles.size();
            if (size == 0)
            {
              intp.println(ConsoleMsg.CONSOLE_INVALID_BUNDLE_SPECIFICATION_ERROR);
              return;
            }
            refresh = new Bundle[size];
            bundles.toArray(refresh);
          }
          packageAdmin.refreshPackages(refresh);
        }
        finally
        {
          context.ungetService(packageAdminRef);
        }
        context.ungetService(packageAdminRef);
      }
    }
    else
    {
      intp.println(ConsoleMsg.CONSOLE_CAN_NOT_REFRESH_NO_PACKAGE_ADMIN_ERROR);
    }
  }
  
  public void _exec(CommandInterpreter intp)
    throws Exception
  {
    String command = intp.nextArgument();
    if (command == null)
    {
      intp.println(ConsoleMsg.CONSOLE_NO_COMMAND_SPECIFIED_ERROR);
      return;
    }
    Process p = Runtime.getRuntime().exec(command);
    
    intp.println(NLS.bind(ConsoleMsg.CONSOLE_STARTED_IN_MESSAGE, command, String.valueOf(p)));
    int result = p.waitFor();
    intp.println(NLS.bind(ConsoleMsg.CONSOLE_EXECUTED_RESULT_CODE_MESSAGE, command, String.valueOf(result)));
  }
  
  public void _fork(CommandInterpreter intp)
    throws Exception
  {
    String command = intp.nextArgument();
    if (command == null)
    {
      intp.println(ConsoleMsg.CONSOLE_NO_COMMAND_SPECIFIED_ERROR);
      return;
    }
    Process p = Runtime.getRuntime().exec(command);
    intp.println(NLS.bind(ConsoleMsg.CONSOLE_STARTED_IN_MESSAGE, command, String.valueOf(p)));
  }
  
  public void _h(CommandInterpreter intp)
    throws Exception
  {
    _headers(intp);
  }
  
  public void _headers(CommandInterpreter intp)
    throws Exception
  {
    String nextArg = intp.nextArgument();
    if (nextArg == null) {
      intp.println(ConsoleMsg.CONSOLE_NO_BUNDLE_SPECIFIED_ERROR);
    }
    while (nextArg != null)
    {
      AbstractBundle bundle = getBundleFromToken(intp, nextArg, true);
      if (bundle != null) {
        intp.printDictionary(bundle.getHeaders(), ConsoleMsg.CONSOLE_BUNDLE_HEADERS_TITLE);
      }
      nextArg = intp.nextArgument();
    }
  }
  
  public void _pr(CommandInterpreter intp)
    throws Exception
  {
    _props(intp);
  }
  
  public void _props(CommandInterpreter intp)
    throws Exception
  {
    intp.printDictionary(FrameworkProperties.getProperties(), ConsoleMsg.CONSOLE_SYSTEM_PROPERTIES_TITLE);
  }
  
  public void _setp(CommandInterpreter intp)
    throws Exception
  {
    _setprop(intp);
  }
  
  /* Error */
  public void _setprop(CommandInterpreter intp)
    throws Exception
  {
    // Byte code:
    //   0: aload_1
    //   1: invokeinterface 1640 1 0
    //   6: astore_2
    //   7: aload_2
    //   8: ifnonnull +20 -> 28
    //   11: aload_1
    //   12: getstatic 1400	org/eclipse/osgi/framework/internal/core/ConsoleMsg:CONSOLE_NO_PARAMETERS_SPECIFIED_TITLE	Ljava/lang/String;
    //   15: invokeinterface 1639 2 0
    //   20: aload_0
    //   21: aload_1
    //   22: invokevirtual 1570	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:_props	(Lorg/eclipse/osgi/framework/console/CommandInterpreter;)V
    //   25: goto +168 -> 193
    //   28: new 735	java/io/ByteArrayInputStream
    //   31: dup
    //   32: aload_2
    //   33: invokevirtual 1474	java/lang/String:getBytes	()[B
    //   36: invokespecial 1450	java/io/ByteArrayInputStream:<init>	([B)V
    //   39: astore_3
    //   40: invokestatic 1596	org/eclipse/osgi/framework/internal/core/FrameworkProperties:getProperties	()Ljava/util/Properties;
    //   43: astore 4
    //   45: new 772	java/util/Properties
    //   48: dup
    //   49: invokespecial 1524	java/util/Properties:<init>	()V
    //   52: astore 5
    //   54: aload 5
    //   56: aload_3
    //   57: invokevirtual 1525	java/util/Properties:load	(Ljava/io/InputStream;)V
    //   60: aload_1
    //   61: getstatic 1412	org/eclipse/osgi/framework/internal/core/ConsoleMsg:CONSOLE_SETTING_PROPERTIES_TITLE	Ljava/lang/String;
    //   64: invokeinterface 1639 2 0
    //   69: aload 5
    //   71: invokevirtual 1526	java/util/Properties:propertyNames	()Ljava/util/Enumeration;
    //   74: astore 6
    //   76: goto +71 -> 147
    //   79: aload 6
    //   81: invokeinterface 1619 1 0
    //   86: checkcast 754	java/lang/String
    //   89: astore 7
    //   91: aload 5
    //   93: aload 7
    //   95: invokevirtual 1528	java/util/Properties:get	(Ljava/lang/Object;)Ljava/lang/Object;
    //   98: checkcast 754	java/lang/String
    //   101: astore 8
    //   103: aload 4
    //   105: aload 7
    //   107: aload 8
    //   109: invokevirtual 1530	java/util/Properties:put	(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    //   112: pop
    //   113: aload_1
    //   114: new 755	java/lang/StringBuffer
    //   117: dup
    //   118: ldc 2
    //   120: invokespecial 1491	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   123: aload 7
    //   125: invokevirtual 1496	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   128: ldc_w 659
    //   131: invokevirtual 1496	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   134: aload 8
    //   136: invokevirtual 1496	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   139: invokevirtual 1490	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   142: invokeinterface 1639 2 0
    //   147: aload 6
    //   149: invokeinterface 1618 1 0
    //   154: ifne -75 -> 79
    //   157: goto +28 -> 185
    //   160: pop
    //   161: aload_3
    //   162: invokevirtual 1452	java/io/InputStream:close	()V
    //   165: goto +28 -> 193
    //   168: pop
    //   169: goto +24 -> 193
    //   172: astore 9
    //   174: aload_3
    //   175: invokevirtual 1452	java/io/InputStream:close	()V
    //   178: goto +4 -> 182
    //   181: pop
    //   182: aload 9
    //   184: athrow
    //   185: aload_3
    //   186: invokevirtual 1452	java/io/InputStream:close	()V
    //   189: goto +4 -> 193
    //   192: pop
    //   193: return
    // Line number table:
    //   Java source line #1383	-> byte code offset #0
    //   Java source line #1384	-> byte code offset #7
    //   Java source line #1385	-> byte code offset #11
    //   Java source line #1386	-> byte code offset #20
    //   Java source line #1387	-> byte code offset #25
    //   Java source line #1388	-> byte code offset #28
    //   Java source line #1390	-> byte code offset #40
    //   Java source line #1391	-> byte code offset #45
    //   Java source line #1392	-> byte code offset #54
    //   Java source line #1393	-> byte code offset #60
    //   Java source line #1394	-> byte code offset #69
    //   Java source line #1395	-> byte code offset #76
    //   Java source line #1396	-> byte code offset #79
    //   Java source line #1397	-> byte code offset #91
    //   Java source line #1398	-> byte code offset #103
    //   Java source line #1399	-> byte code offset #113
    //   Java source line #1395	-> byte code offset #147
    //   Java source line #1401	-> byte code offset #157
    //   Java source line #1405	-> byte code offset #161
    //   Java source line #1406	-> byte code offset #165
    //   Java source line #1403	-> byte code offset #172
    //   Java source line #1405	-> byte code offset #174
    //   Java source line #1406	-> byte code offset #178
    //   Java source line #1409	-> byte code offset #182
    //   Java source line #1405	-> byte code offset #185
    //   Java source line #1406	-> byte code offset #189
    //   Java source line #1411	-> byte code offset #193
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	194	0	this	FrameworkCommandProvider
    //   0	194	1	intp	CommandInterpreter
    //   6	27	2	argument	String
    //   39	147	3	in	java.io.InputStream
    //   43	61	4	sysprops	Properties
    //   52	40	5	newprops	Properties
    //   74	74	6	keys	Enumeration<?>
    //   89	35	7	key	String
    //   101	34	8	value	String
    //   172	11	9	localObject	Object
    //   160	1	10	localIOException1	java.io.IOException
    //   168	1	11	localIOException2	java.io.IOException
    //   181	1	12	localIOException3	java.io.IOException
    //   192	1	13	localIOException4	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   40	157	160	java/io/IOException
    //   161	165	168	java/io/IOException
    //   40	161	172	finally
    //   174	178	181	java/io/IOException
    //   185	189	192	java/io/IOException
  }
  
  public void _ss(CommandInterpreter intp)
    throws Exception
  {
    if (framework.isActive())
    {
      intp.println();
      intp.println(ConsoleMsg.CONSOLE_FRAMEWORK_IS_LAUNCHED_MESSAGE);
    }
    else
    {
      intp.println();
      intp.println(ConsoleMsg.CONSOLE_FRAMEWORK_IS_SHUTDOWN_MESSAGE);
    }
    Object[] options = processOption(intp);
    if (options == null) {
      return;
    }
    AbstractBundle[] bundles = (AbstractBundle[])context.getBundles();
    if (bundles.length == 0)
    {
      intp.println(ConsoleMsg.CONSOLE_NO_INSTALLED_BUNDLES_ERROR);
    }
    else
    {
      intp.print("\r\n");
      intp.print(ConsoleMsg.CONSOLE_ID);
      intp.print("\t");
      intp.println(ConsoleMsg.CONSOLE_STATE_BUNDLE_TITLE);
      for (int i = 0; i < bundles.length; i++)
      {
        AbstractBundle b = bundles[i];
        if (match(b, (String)options[0], ((Integer)options[1]).intValue()))
        {
          String label = b.getSymbolicName();
          if ((label == null) || (label.length() == 0)) {
            label = b.toString();
          } else {
            label = label + "_" + b.getVersion();
          }
          intp.println(b.getBundleId() + "\t" + getStateName(b) + label);
          if (b.isFragment())
          {
            Bundle[] hosts = b.getHosts();
            if (hosts != null) {
              for (int j = 0; j < hosts.length; j++) {
                intp.println("\t            Master=" + hosts[j].getBundleId());
              }
            }
          }
          else
          {
            Bundle[] fragments = b.getFragments();
            if (fragments != null)
            {
              intp.print("\t            Fragments=");
              for (int f = 0; f < fragments.length; f++)
              {
                AbstractBundle fragment = (AbstractBundle)fragments[f];
                intp.print((f > 0 ? ", " : "") + fragment.getBundleId());
              }
              intp.println();
            }
          }
        }
      }
    }
  }
  
  private boolean match(Bundle toFilter, String searchedName, int searchedState)
  {
    if ((toFilter.getState() & searchedState) == 0) {
      return false;
    }
    if ((searchedName != null) && (toFilter.getSymbolicName() != null) && (toFilter.getSymbolicName().indexOf(searchedName) == -1)) {
      return false;
    }
    return true;
  }
  
  public void _t(CommandInterpreter intp)
    throws Exception
  {
    _threads(intp);
  }
  
  public void _threads(CommandInterpreter intp)
    throws Exception
  {
    ThreadGroup[] threadGroups = getThreadGroups();
    Util.sortByString(threadGroups);
    
    ThreadGroup tg = getTopThreadGroup();
    Thread[] threads = new Thread[tg.activeCount()];
    int count = tg.enumerate(threads, true);
    Util.sortByString(threads);
    
    StringBuffer sb = new StringBuffer(120);
    intp.println();
    intp.println(ConsoleMsg.CONSOLE_THREADGROUP_TITLE);
    for (int i = 0; i < threadGroups.length; i++)
    {
      tg = threadGroups[i];
      int all = tg.activeCount();
      int local = tg.enumerate(new Thread[all], false);
      ThreadGroup p = tg.getParent();
      String parent = p == null ? "-none-" : p.getName();
      sb.setLength(0);
      sb.append(Util.toString(simpleClassName(tg), 18)).append(" ").append(Util.toString(tg.getName(), 21)).append(" ").append(Util.toString(parent, 16)).append(Util.toString(new Integer(tg.getMaxPriority()), 3)).append(Util.toString(new Integer(local), 4)).append("/").append(Util.toString(String.valueOf(all), 6));
      intp.println(sb.toString());
    }
    intp.print("\r\n");
    intp.println(ConsoleMsg.CONSOLE_THREADTYPE_TITLE);
    for (int j = 0; j < count; j++)
    {
      Thread t = threads[j];
      if (t != null)
      {
        sb.setLength(0);
        sb.append(Util.toString(simpleClassName(t), 18)).append(" ").append(Util.toString(t.getName(), 21)).append(" ").append(Util.toString(t.getThreadGroup().getName(), 16)).append(Util.toString(new Integer(t.getPriority()), 3));
        if (t.isDaemon()) {
          sb.append(" [daemon]");
        }
        intp.println(sb.toString());
      }
    }
  }
  
  public void _sl(CommandInterpreter intp)
    throws Exception
  {
    if (isStartLevelSvcPresent(intp))
    {
      Bundle bundle = null;
      String token = intp.nextArgument();
      int value = 0;
      if (token != null)
      {
        bundle = getBundleFromToken(intp, token, true);
        if (bundle == null) {
          return;
        }
      }
      if (bundle == null)
      {
        value = slImpl.getStartLevel();
        intp.println(NLS.bind(ConsoleMsg.STARTLEVEL_FRAMEWORK_ACTIVE_STARTLEVEL, String.valueOf(value)));
      }
      else
      {
        value = slImpl.getBundleStartLevel(bundle);
        intp.println(NLS.bind(ConsoleMsg.STARTLEVEL_BUNDLE_STARTLEVEL, new Long(bundle.getBundleId()), new Integer(value)));
      }
    }
  }
  
  public void _setfwsl(CommandInterpreter intp)
    throws Exception
  {
    if (isStartLevelSvcPresent(intp))
    {
      int value = 0;
      String token = intp.nextArgument();
      if (token == null)
      {
        intp.println(ConsoleMsg.STARTLEVEL_NO_STARTLEVEL_GIVEN);
        value = slImpl.getStartLevel();
        intp.println(NLS.bind(ConsoleMsg.STARTLEVEL_FRAMEWORK_ACTIVE_STARTLEVEL, String.valueOf(value)));
      }
      else
      {
        value = getStartLevelFromToken(intp, token);
        if (value > 0) {
          try
          {
            slImpl.setStartLevel(value);
            intp.println(NLS.bind(ConsoleMsg.STARTLEVEL_FRAMEWORK_ACTIVE_STARTLEVEL, String.valueOf(value)));
          }
          catch (IllegalArgumentException e)
          {
            intp.println(e.getMessage());
          }
        }
      }
    }
  }
  
  public void _setbsl(CommandInterpreter intp)
    throws Exception
  {
    if (isStartLevelSvcPresent(intp))
    {
      AbstractBundle bundle = null;
      String token = intp.nextArgument();
      if (token == null)
      {
        intp.println(ConsoleMsg.STARTLEVEL_NO_STARTLEVEL_OR_BUNDLE_GIVEN);
        return;
      }
      int newSL = getStartLevelFromToken(intp, token);
      
      token = intp.nextArgument();
      if (token == null)
      {
        intp.println(ConsoleMsg.STARTLEVEL_NO_STARTLEVEL_OR_BUNDLE_GIVEN);
        return;
      }
      while (token != null)
      {
        bundle = getBundleFromToken(intp, token, true);
        if (bundle != null) {
          try
          {
            slImpl.setBundleStartLevel(bundle, newSL);
            intp.println(NLS.bind(ConsoleMsg.STARTLEVEL_BUNDLE_STARTLEVEL, new Long(bundle.getBundleId()), new Integer(newSL)));
          }
          catch (IllegalArgumentException e)
          {
            intp.println(e.getMessage());
          }
        }
        token = intp.nextArgument();
      }
    }
  }
  
  public void _setibsl(CommandInterpreter intp)
    throws Exception
  {
    if (isStartLevelSvcPresent(intp))
    {
      int value = 0;
      String token = intp.nextArgument();
      if (token == null)
      {
        intp.println(ConsoleMsg.STARTLEVEL_NO_STARTLEVEL_GIVEN);
        value = slImpl.getInitialBundleStartLevel();
        intp.println(NLS.bind(ConsoleMsg.STARTLEVEL_INITIAL_BUNDLE_STARTLEVEL, String.valueOf(value)));
      }
      else
      {
        value = getStartLevelFromToken(intp, token);
        if (value > 0) {
          try
          {
            slImpl.setInitialBundleStartLevel(value);
            intp.println(NLS.bind(ConsoleMsg.STARTLEVEL_INITIAL_BUNDLE_STARTLEVEL, String.valueOf(value)));
          }
          catch (IllegalArgumentException e)
          {
            intp.println(e.getMessage());
          }
        }
      }
    }
  }
  
  public void _requiredBundles(CommandInterpreter intp)
  {
    _classSpaces(intp);
  }
  
  /* Error */
  public void _classSpaces(CommandInterpreter intp)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokeinterface 1640 1 0
    //   6: astore_2
    //   7: aload_0
    //   8: getfield 1448	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:context	Lorg/osgi/framework/BundleContext;
    //   11: ldc_w 702
    //   14: invokeinterface 1675 2 0
    //   19: astore_3
    //   20: aload_3
    //   21: ifnull +298 -> 319
    //   24: aload_0
    //   25: getfield 1448	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:context	Lorg/osgi/framework/BundleContext;
    //   28: aload_3
    //   29: invokeinterface 1673 2 0
    //   34: checkcast 807	org/osgi/service/packageadmin/PackageAdmin
    //   37: astore 4
    //   39: aload 4
    //   41: ifnull +287 -> 328
    //   44: aconst_null
    //   45: astore 5
    //   47: aload 4
    //   49: aload_2
    //   50: invokeinterface 1693 2 0
    //   55: astore 5
    //   57: aload 5
    //   59: ifnonnull +15 -> 74
    //   62: aload_1
    //   63: getstatic 1399	org/eclipse/osgi/framework/internal/core/ConsoleMsg:CONSOLE_NO_NAMED_CLASS_SPACES_MESSAGE	Ljava/lang/String;
    //   66: invokeinterface 1639 2 0
    //   71: goto +234 -> 305
    //   74: iconst_0
    //   75: istore 6
    //   77: goto +201 -> 278
    //   80: aload 5
    //   82: iload 6
    //   84: aaload
    //   85: astore 7
    //   87: aload_1
    //   88: aload 7
    //   90: invokeinterface 1638 2 0
    //   95: aload 7
    //   97: invokeinterface 1694 1 0
    //   102: istore 8
    //   104: iload 8
    //   106: ifeq +30 -> 136
    //   109: aload_1
    //   110: ldc_w 662
    //   113: invokeinterface 1638 2 0
    //   118: aload_1
    //   119: getstatic 1408	org/eclipse/osgi/framework/internal/core/ConsoleMsg:CONSOLE_REMOVAL_PENDING_MESSAGE	Ljava/lang/String;
    //   122: invokeinterface 1638 2 0
    //   127: aload_1
    //   128: ldc_w 664
    //   131: invokeinterface 1639 2 0
    //   136: aload 7
    //   138: invokeinterface 1695 1 0
    //   143: astore 9
    //   145: aload 9
    //   147: ifnull +101 -> 248
    //   150: aload_1
    //   151: ldc_w 675
    //   154: invokeinterface 1638 2 0
    //   159: aload_1
    //   160: aload 9
    //   162: invokeinterface 1638 2 0
    //   167: aload_1
    //   168: ldc_w 678
    //   171: invokeinterface 1639 2 0
    //   176: aload 7
    //   178: invokeinterface 1696 1 0
    //   183: astore 10
    //   185: aload 10
    //   187: ifnull +88 -> 275
    //   190: iconst_0
    //   191: istore 11
    //   193: goto +44 -> 237
    //   196: aload_1
    //   197: ldc_w 656
    //   200: invokeinterface 1638 2 0
    //   205: aload_1
    //   206: aload 10
    //   208: iload 11
    //   210: aaload
    //   211: invokeinterface 1638 2 0
    //   216: aload_1
    //   217: ldc_w 655
    //   220: invokeinterface 1638 2 0
    //   225: aload_1
    //   226: getstatic 1410	org/eclipse/osgi/framework/internal/core/ConsoleMsg:CONSOLE_REQUIRES_MESSAGE	Ljava/lang/String;
    //   229: invokeinterface 1639 2 0
    //   234: iinc 11 1
    //   237: iload 11
    //   239: aload 10
    //   241: arraylength
    //   242: if_icmplt -46 -> 196
    //   245: goto +30 -> 275
    //   248: aload_1
    //   249: ldc_w 675
    //   252: invokeinterface 1638 2 0
    //   257: aload_1
    //   258: getstatic 1413	org/eclipse/osgi/framework/internal/core/ConsoleMsg:CONSOLE_STALE_MESSAGE	Ljava/lang/String;
    //   261: invokeinterface 1638 2 0
    //   266: aload_1
    //   267: ldc_w 678
    //   270: invokeinterface 1639 2 0
    //   275: iinc 6 1
    //   278: iload 6
    //   280: aload 5
    //   282: arraylength
    //   283: if_icmplt -203 -> 80
    //   286: goto +19 -> 305
    //   289: astore 12
    //   291: aload_0
    //   292: getfield 1448	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:context	Lorg/osgi/framework/BundleContext;
    //   295: aload_3
    //   296: invokeinterface 1672 2 0
    //   301: pop
    //   302: aload 12
    //   304: athrow
    //   305: aload_0
    //   306: getfield 1448	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:context	Lorg/osgi/framework/BundleContext;
    //   309: aload_3
    //   310: invokeinterface 1672 2 0
    //   315: pop
    //   316: goto +12 -> 328
    //   319: aload_1
    //   320: getstatic 1394	org/eclipse/osgi/framework/internal/core/ConsoleMsg:CONSOLE_NO_EXPORTED_PACKAGES_NO_PACKAGE_ADMIN_MESSAGE	Ljava/lang/String;
    //   323: invokeinterface 1639 2 0
    //   328: return
    // Line number table:
    //   Java source line #1656	-> byte code offset #0
    //   Java source line #1658	-> byte code offset #7
    //   Java source line #1659	-> byte code offset #20
    //   Java source line #1660	-> byte code offset #24
    //   Java source line #1661	-> byte code offset #39
    //   Java source line #1663	-> byte code offset #44
    //   Java source line #1665	-> byte code offset #47
    //   Java source line #1667	-> byte code offset #57
    //   Java source line #1668	-> byte code offset #62
    //   Java source line #1669	-> byte code offset #71
    //   Java source line #1670	-> byte code offset #74
    //   Java source line #1671	-> byte code offset #80
    //   Java source line #1672	-> byte code offset #87
    //   Java source line #1674	-> byte code offset #95
    //   Java source line #1675	-> byte code offset #104
    //   Java source line #1676	-> byte code offset #109
    //   Java source line #1677	-> byte code offset #118
    //   Java source line #1678	-> byte code offset #127
    //   Java source line #1681	-> byte code offset #136
    //   Java source line #1682	-> byte code offset #145
    //   Java source line #1683	-> byte code offset #150
    //   Java source line #1684	-> byte code offset #159
    //   Java source line #1685	-> byte code offset #167
    //   Java source line #1687	-> byte code offset #176
    //   Java source line #1688	-> byte code offset #185
    //   Java source line #1689	-> byte code offset #190
    //   Java source line #1690	-> byte code offset #196
    //   Java source line #1691	-> byte code offset #205
    //   Java source line #1692	-> byte code offset #216
    //   Java source line #1693	-> byte code offset #225
    //   Java source line #1689	-> byte code offset #234
    //   Java source line #1695	-> byte code offset #245
    //   Java source line #1696	-> byte code offset #248
    //   Java source line #1697	-> byte code offset #257
    //   Java source line #1698	-> byte code offset #266
    //   Java source line #1670	-> byte code offset #275
    //   Java source line #1703	-> byte code offset #286
    //   Java source line #1704	-> byte code offset #291
    //   Java source line #1705	-> byte code offset #302
    //   Java source line #1704	-> byte code offset #305
    //   Java source line #1707	-> byte code offset #316
    //   Java source line #1708	-> byte code offset #319
    //   Java source line #1710	-> byte code offset #328
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	329	0	this	FrameworkCommandProvider
    //   0	329	1	intp	CommandInterpreter
    //   6	44	2	token	String
    //   19	291	3	packageAdminRef	ServiceReference<?>
    //   37	11	4	packageAdmin	PackageAdmin
    //   45	236	5	symBundles	org.osgi.service.packageadmin.RequiredBundle[]
    //   75	204	6	i	int
    //   85	92	7	symBundle	org.osgi.service.packageadmin.RequiredBundle
    //   102	3	8	removalPending	boolean
    //   143	18	9	provider	Bundle
    //   183	57	10	requiring	Bundle[]
    //   191	47	11	j	int
    //   289	14	12	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   44	289	289	finally
  }
  
  public void _profilelog(CommandInterpreter intp)
    throws Exception
  {
    intp.println(Profile.getProfileLog());
  }
  
  /* Error */
  public void _getPackages(CommandInterpreter intp)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokeinterface 1640 1 0
    //   6: astore_2
    //   7: aload_2
    //   8: ifnonnull +4 -> 12
    //   11: return
    //   12: aload_0
    //   13: aload_1
    //   14: aload_2
    //   15: iconst_1
    //   16: invokevirtual 1594	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:getBundleFromToken	(Lorg/eclipse/osgi/framework/console/CommandInterpreter;Ljava/lang/String;Z)Lorg/eclipse/osgi/framework/internal/core/AbstractBundle;
    //   19: astore_3
    //   20: aload_0
    //   21: getfield 1448	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:context	Lorg/osgi/framework/BundleContext;
    //   24: ldc_w 700
    //   27: invokeinterface 1675 2 0
    //   32: astore 4
    //   34: aload 4
    //   36: ifnonnull +4 -> 40
    //   39: return
    //   40: aload_0
    //   41: getfield 1448	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:context	Lorg/osgi/framework/BundleContext;
    //   44: aload 4
    //   46: invokeinterface 1673 2 0
    //   51: checkcast 791	org/eclipse/osgi/service/resolver/PlatformAdmin
    //   54: astore 5
    //   56: aload 5
    //   58: invokeinterface 1659 1 0
    //   63: aload_3
    //   64: invokevirtual 1552	org/eclipse/osgi/framework/internal/core/AbstractBundle:getBundleDescription	()Lorg/eclipse/osgi/service/resolver/BundleDescription;
    //   67: iconst_3
    //   68: invokeinterface 1663 3 0
    //   73: astore 6
    //   75: iconst_0
    //   76: istore 7
    //   78: goto +60 -> 138
    //   81: aload_1
    //   82: new 755	java/lang/StringBuffer
    //   85: dup
    //   86: invokespecial 1487	java/lang/StringBuffer:<init>	()V
    //   89: aload 6
    //   91: iload 7
    //   93: aaload
    //   94: invokevirtual 1495	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   97: ldc_w 673
    //   100: invokevirtual 1496	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   103: aload 5
    //   105: invokeinterface 1659 1 0
    //   110: aload_3
    //   111: invokevirtual 1552	org/eclipse/osgi/framework/internal/core/AbstractBundle:getBundleDescription	()Lorg/eclipse/osgi/service/resolver/BundleDescription;
    //   114: aload 6
    //   116: iload 7
    //   118: aaload
    //   119: invokeinterface 1664 3 0
    //   124: invokevirtual 1493	java/lang/StringBuffer:append	(I)Ljava/lang/StringBuffer;
    //   127: invokevirtual 1490	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   130: invokeinterface 1639 2 0
    //   135: iinc 7 1
    //   138: iload 7
    //   140: aload 6
    //   142: arraylength
    //   143: if_icmplt -62 -> 81
    //   146: goto +20 -> 166
    //   149: astore 8
    //   151: aload_0
    //   152: getfield 1448	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:context	Lorg/osgi/framework/BundleContext;
    //   155: aload 4
    //   157: invokeinterface 1672 2 0
    //   162: pop
    //   163: aload 8
    //   165: athrow
    //   166: aload_0
    //   167: getfield 1448	org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider:context	Lorg/osgi/framework/BundleContext;
    //   170: aload 4
    //   172: invokeinterface 1672 2 0
    //   177: pop
    //   178: return
    // Line number table:
    //   Java source line #1723	-> byte code offset #0
    //   Java source line #1724	-> byte code offset #7
    //   Java source line #1725	-> byte code offset #11
    //   Java source line #1726	-> byte code offset #12
    //   Java source line #1727	-> byte code offset #20
    //   Java source line #1728	-> byte code offset #34
    //   Java source line #1729	-> byte code offset #39
    //   Java source line #1730	-> byte code offset #40
    //   Java source line #1732	-> byte code offset #56
    //   Java source line #1733	-> byte code offset #75
    //   Java source line #1734	-> byte code offset #81
    //   Java source line #1733	-> byte code offset #135
    //   Java source line #1736	-> byte code offset #146
    //   Java source line #1737	-> byte code offset #151
    //   Java source line #1738	-> byte code offset #163
    //   Java source line #1737	-> byte code offset #166
    //   Java source line #1739	-> byte code offset #178
    // Local v
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-2017. Infinite Loop Ltd