org.eclipse.equinox.app_1.3.100.v20110321

16:43:45.603 INFO  jd.cli.Main - Decompiling org.eclipse.equinox.app_1.3.100.v20110321.jar
package org.eclipse.equinox.app;

public abstract interface IApplication
{
  public static final Integer EXIT_OK = new Integer(0);
  public static final Integer EXIT_RESTART = new Integer(23);
  public static final Integer EXIT_RELAUNCH = new Integer(24);
  
  public abstract Object start(IApplicationContext paramIApplicationContext)
    throws Exception;
  
  public abstract void stop();
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.app.IApplication
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.app;

import java.util.Map;
import org.osgi.framework.Bundle;

public abstract interface IApplicationContext
{
  public static final String EXIT_DATA_PROPERTY = "eclipse.exitdata";
  public static final String APPLICATION_ARGS = "application.args";
  public static final Object EXIT_ASYNC_RESULT = new Object();
  
  public abstract Map getArguments();
  
  public abstract void applicationRunning();
  
  public abstract String getBrandingApplication();
  
  public abstract String getBrandingName();
  
  public abstract String getBrandingDescription();
  
  public abstract String getBrandingId();
  
  public abstract String getBrandingProperty(String paramString);
  
  public abstract Bundle getBrandingBundle();
  
  public abstract void setResult(Object paramObject, IApplication paramIApplication);
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.app.IApplicationContext
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.app;

import java.security.PrivilegedAction;
import org.osgi.util.tracker.ServiceTracker;

class Activator$1
  implements PrivilegedAction
{
  private final ServiceTracker val$tracker;
  private final boolean val$allServices;
  
  Activator$1(ServiceTracker paramServiceTracker, boolean paramBoolean)
  {
    val$tracker = paramServiceTracker;val$allServices = paramBoolean;
  }
  
  public Object run()
  {
    val$tracker.open(val$allServices);
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.app.Activator.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.app;

import java.security.PrivilegedAction;
import org.osgi.util.tracker.ServiceTracker;

class Activator$2
  implements PrivilegedAction
{
  private final ServiceTracker val$tracker;
  
  Activator$2(ServiceTracker paramServiceTracker)
  {
    val$tracker = paramServiceTracker;
  }
  
  public Object run()
  {
    return val$tracker.getService();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.app.Activator.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.app;

import java.security.PrivilegedAction;
import org.osgi.framework.Bundle;

class Activator$3
  implements PrivilegedAction
{
  private final Bundle val$bundle;
  
  Activator$3(Bundle paramBundle)
  {
    val$bundle = paramBundle;
  }
  
  public Object run()
  {
    return val$bundle.getLocation();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.app.Activator.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.app;

import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Properties;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.spi.RegistryContributor;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
import org.eclipse.osgi.service.debug.DebugOptions;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;

public class Activator
  implements BundleActivator, ServiceTrackerCustomizer
{
  public static final String PI_APP = "org.eclipse.equinox.app";
  public static boolean DEBUG = false;
  private static volatile BundleContext _context;
  private static volatile PackageAdmin _packageAdmin;
  private static volatile EclipseAppContainer container;
  private static volatile ServiceTracker _frameworkLogTracker;
  private ServiceTracker registryTracker;
  private IExtensionRegistry registry;
  
  public void start(BundleContext bc)
  {
    _context = bc;
    
    ServiceReference ref = bc.getServiceReference(PackageAdmin.class.getName());
    if (ref != null) {
      _packageAdmin = (PackageAdmin)bc.getService(ref);
    }
    _frameworkLogTracker = new ServiceTracker(bc, FrameworkLog.class.getName(), null);
    _frameworkLogTracker.open();
    getDebugOptions(bc);
    processCommandLineArgs(bc);
    
    AppPersistence.start(bc);
    
    registryTracker = new ServiceTracker(bc, IExtensionRegistry.class.getName(), this);
    registryTracker.open();
    try
    {
      AppCommands.create(bc);
    }
    catch (NoClassDefFoundError localNoClassDefFoundError) {}
  }
  
  public void stop(BundleContext bc)
  {
    try
    {
      AppCommands.destroy(bc);
    }
    catch (NoClassDefFoundError localNoClassDefFoundError) {}
    registryTracker.close();
    registryTracker = null;
    
    AppPersistence.stop();
    if (_frameworkLogTracker != null)
    {
      _frameworkLogTracker.close();
      _frameworkLogTracker = null;
    }
    _packageAdmin = null;
    _context = null;
  }
  
  private void getDebugOptions(BundleContext context)
  {
    ServiceReference debugRef = context.getServiceReference(DebugOptions.class.getName());
    if (debugRef == null) {
      return;
    }
    DebugOptions debugOptions = (DebugOptions)context.getService(debugRef);
    DEBUG = debugOptions.getBooleanOption("org.eclipse.equinox.app/debug", false);
    context.ungetService(debugRef);
  }
  
  private static EnvironmentInfo getEnvironmentInfo()
  {
    BundleContext bc = getContext();
    if (bc == null) {
      return null;
    }
    ServiceReference infoRef = bc.getServiceReference(EnvironmentInfo.class.getName());
    if (infoRef == null) {
      return null;
    }
    EnvironmentInfo envInfo = (EnvironmentInfo)bc.getService(infoRef);
    if (envInfo == null) {
      return null;
    }
    bc.ungetService(infoRef);
    return envInfo;
  }
  
  private void processCommandLineArgs(BundleContext bc)
  {
    EnvironmentInfo envInfo = getEnvironmentInfo();
    if (envInfo != null) {
      CommandLineArgs.processCommandLine(envInfo);
    }
  }
  
  public Object addingService(ServiceReference reference)
  {
    BundleContext context = _context;
    if (context == null) {
      return null;
    }
    Object service = null;
    EclipseAppContainer startContainer = null;
    synchronized (this)
    {
      if (container != null) {
        return null;
      }
      service = context.getService(reference);
      if ((registry == null) && ((service instanceof IExtensionRegistry)))
      {
        registry = ((IExtensionRegistry)service);
        
        container = new EclipseAppContainer(context, registry);
        startContainer = container;
      }
    }
    if (startContainer != null)
    {
      startContainer.start();
      return service;
    }
    if (service != null) {
      context.ungetService(reference);
    }
    return null;
  }
  
  public void modifiedService(ServiceReference reference, Object service) {}
  
  public void removedService(ServiceReference reference, Object service)
  {
    EclipseAppContainer currentContainer = null;
    synchronized (this)
    {
      if (service == registry) {
        registry = null;
      }
      if (container == null) {
        return;
      }
      currentContainer = container;
      container = null;
    }
    if (currentContainer != null) {
      currentContainer.stop();
    }
  }
  
  static void openTracker(ServiceTracker tracker, boolean allServices)
  {
    if (System.getSecurityManager() == null) {
      tracker.open(allServices);
    } else {
      AccessController.doPrivileged(new PrivilegedAction()
      {
        private final boolean val$allServices;
        
        public Object run()
        {
          open(val$allServices);
          return null;
        }
      });
    }
  }
  
  static Object getService(ServiceTracker tracker)
  {
    if (System.getSecurityManager() == null) {
      return tracker.getService();
    }
    AccessController.doPrivileged(new PrivilegedAction()
    {
      public Object run()
      {
        return getService();
      }
    });
  }
  
  static String getLocation(Bundle bundle)
  {
    if (System.getSecurityManager() == null) {
      return bundle.getLocation();
    }
    (String)AccessController.doPrivileged(new PrivilegedAction()
    {
      public Object run()
      {
        return getLocation();
      }
    });
  }
  
  static Bundle getBundle(IContributor contributor)
  {
    if ((contributor instanceof RegistryContributor)) {
      try
      {
        long id = Long.parseLong(((RegistryContributor)contributor).getActualId());
        BundleContext context = _context;
        if (context != null) {
          return context.getBundle(id);
        }
      }
      catch (NumberFormatException localNumberFormatException) {}
    }
    PackageAdmin packageAdmin = _packageAdmin;
    if (packageAdmin == null) {
      return null;
    }
    Bundle[] bundles = packageAdmin.getBundles(contributor.getName(), null);
    if (bundles == null) {
      return null;
    }
    for (int i = 0; i < bundles.length; i++) {
      if ((bundles[i].getState() & 0x3) == 0) {
        return bundles[i];
      }
    }
    return null;
  }
  
  static BundleContext getContext()
  {
    return _context;
  }
  
  public static EclipseAppContainer getContainer()
  {
    return container;
  }
  
  static void log(FrameworkLogEntry entry)
  {
    ServiceTracker frameworkLogTracker = _frameworkLogTracker;
    FrameworkLog log = frameworkLogTracker == null ? null : (FrameworkLog)frameworkLogTracker.getService();
    if (log != null) {
      log.log(entry);
    }
  }
  
  static void setProperty(String key, String value)
  {
    EnvironmentInfo envInfo = getEnvironmentInfo();
    if (envInfo != null) {
      envInfo.setProperty(key, value);
    } else {
      System.getProperties().setProperty(key, value);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.app.Activator
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.app;

import org.eclipse.osgi.framework.log.FrameworkLogEntry;

public class AnyThreadAppLauncher
  implements Runnable
{
  private EclipseAppHandle appHandle;
  
  private AnyThreadAppLauncher(EclipseAppHandle appHandle)
  {
    this.appHandle = appHandle;
  }
  
  public void run()
  {
    try
    {
      appHandle.run(null);
    }
    catch (Throwable e)
    {
      Activator.log(new FrameworkLogEntry("org.eclipse.equinox.app", 4, 0, e.getMessage(), 0, e, null));
    }
  }
  
  static void launchEclipseApplication(EclipseAppHandle appHandle)
  {
    AnyThreadAppLauncher launchable = new AnyThreadAppLauncher(appHandle);
    new Thread(launchable, "app thread - " + appHandle.getInstanceId()).start();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.app.AnyThreadAppLauncher
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.app;

import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.application.ApplicationDescriptor;
import org.osgi.service.application.ApplicationHandle;
import org.osgi.service.application.ScheduledApplication;
import org.osgi.util.tracker.ServiceTracker;

public class AppCommands
  implements CommandProvider
{
  private static final String LAUNCHABLE_APP_FILTER = "(&(application.locked=false)(application.launchable=true)(application.visible=true))";
  private static final String ACTIVE_APP_FILTER = "(!(application.state=STOPPING))";
  private static final String LOCKED_APP_FILTER = "(application.locked=true)";
  private static final String NEW_LINE = "\r\n";
  private static final String TAB = "\t";
  private Map commandsHelp = null;
  private static AppCommands instance;
  private BundleContext context;
  private ServiceTracker applicationDescriptors;
  private ServiceTracker applicationHandles;
  private ServiceTracker scheduledApplications;
  private Filter launchableApp;
  private Filter activeApp;
  private Filter lockedApp;
  private ServiceRegistration providerRegistration;
  
  static synchronized void create(BundleContext context)
  {
    if (instance != null) {
      return;
    }
    instance = new AppCommands();
    instance.start(context);
  }
  
  static synchronized void destroy(BundleContext context)
  {
    if (instance == null) {
      return;
    }
    instance.stop(context);
    instance = null;
  }
  
  public void start(BundleContext ctx)
  {
    context = ctx;
    try
    {
      applicationDescriptors = new ServiceTracker(ctx, ApplicationDescriptor.class.getName(), null);
      applicationDescriptors.open();
      applicationHandles = new ServiceTracker(ctx, ApplicationHandle.class.getName(), null);
      applicationHandles.open();
      scheduledApplications = new ServiceTracker(ctx, ScheduledApplication.class.getName(), null);
      scheduledApplications.open();
      launchableApp = ctx.createFilter("(&(application.locked=false)(application.launchable=true)(application.visible=true))");
      activeApp = ctx.createFilter("(!(application.state=STOPPING))");
      lockedApp = ctx.createFilter("(application.locked=true)");
      providerRegistration = ctx.registerService(CommandProvider.class.getName(), this, null);
    }
    catch (InvalidSyntaxException localInvalidSyntaxException) {}
  }
  
  public void stop(BundleContext ctx)
  {
    providerRegistration.unregister();
    if (applicationDescriptors != null) {
      applicationDescriptors.close();
    }
    if (applicationHandles != null) {
      applicationHandles.close();
    }
    if (scheduledApplications != null) {
      scheduledApplications.close();
    }
  }
  
  public String getHelp()
  {
    return getHelp(null);
  }
  
  private String getHelp(String commandName)
  {
    StringBuffer sb = new StringBuffer();
    if (commandsHelp == null) {
      initializeCommandsHelp();
    }
    if (commandName != null)
    {
      if (commandsHelp.containsKey(commandName)) {
        addCommand(commandName, (String[])commandsHelp.get(commandName), sb);
      }
      return sb.toString();
    }
    addHeader(Messages.console_help_app_commands_header, sb);
    Iterator i = commandsHelp.entrySet().iterator();
    while (i.hasNext())
    {
      Map.Entry entry = (Map.Entry)i.next();
      String command = (String)entry.getKey();
      String[] attributes = (String[])entry.getValue();
      addCommand(command, attributes, sb);
    }
    return sb.toString();
  }
  
  private void initializeCommandsHelp()
  {
    commandsHelp = new LinkedHashMap();
    commandsHelp.put("activeApps", new String[] { Messages.console_help_activeapps_description });
    commandsHelp.put("apps", new String[] { Messages.console_help_apps_description });
    commandsHelp.put("lockApp", new String[] { Messages.console_help_arguments, Messages.console_help_lockapp_description });
    commandsHelp.put("schedApp", new String[] { Messages.console_help_schedapp_arguments, Messages.console_help_schedapp_description });
    commandsHelp.put("startApp", new String[] { Messages.console_help_arguments, Messages.console_help_startapp_description });
    commandsHelp.put("stopApp", new String[] { Messages.console_help_arguments, Messages.console_help_stopapp_description });
    commandsHelp.put("unlockApp", new String[] { Messages.console_help_arguments, Messages.console_help_unlockapp_description });
    commandsHelp.put("unschedApp", new String[] { Messages.console_help_arguments, Messages.console_help_unschedapp_description });
  }
  
  private void addHeader(String header, StringBuffer help)
  {
    help.append("---");
    help.append(header);
    help.append("---");
    help.append("\r\n");
  }
  
  private void addCommand(String command, String description, StringBuffer help)
  {
    help.append("\t");
    help.append(command);
    help.append(" - ");
    help.append(description);
    help.append("\r\n");
  }
  
  private void addCommand(String command, String parameters, String description, StringBuffer help)
  {
    help.append("\t");
    help.append(command);
    help.append(" ");
    help.append(parameters);
    help.append(" - ");
    help.append(description);
    help.append("\r\n");
  }
  
  private void addCommand(String command, String[] attributes, StringBuffer help)
  {
    if (attributes.length == 1) {
      addCommand(command, attributes[0], help);
    } else if (attributes.length == 2) {
      addCommand(command, attributes[0], attributes[1], help);
    }
  }
  
  private Dictionary getServiceProps(ServiceReference ref)
  {
    String[] keys = ref.getPropertyKeys();
    Hashtable props = new Hashtable(keys.length);
    for (int i = 0; i < keys.length; i++) {
      props.put(keys[i], ref.getProperty(keys[i]));
    }
    return props;
  }
  
  public void _apps(CommandInterpreter intp)
  {
    ServiceReference[] apps = applicationDescriptors.getServiceReferences();
    if (apps == null)
    {
      intp.println("No applications found.");
      return;
    }
    for (int i = 0; i < apps.length; i++)
    {
      String application = (String)apps[i].getProperty("service.pid");
      intp.print(application);
      if (getApplication(applicationHandles.getServiceReferences(), application, "application.descriptor", true) != null) {
        intp.print(" [running]");
      }
      if (getApplication(scheduledApplications.getServiceReferences(), application, "service.pid", true) != null) {
        intp.print(" [scheduled]");
      }
      if (!launchableApp.match(getServiceProps(apps[i]))) {
        intp.print(" [not launchable]");
      } else {
        intp.print(" [launchable]");
      }
      if (lockedApp.match(getServiceProps(apps[i]))) {
        intp.print(" [locked]");
      }
      intp.println();
    }
  }
  
  public void _activeApps(CommandInterpreter intp)
  {
    ServiceReference[] active = applicationHandles.getServiceReferences();
    if (active == null)
    {
      intp.println("No active applications found");
      return;
    }
    for (int i = 0; i < active.length; i++)
    {
      intp.print(active[i].getProperty("service.pid"));
      intp.print(" [");
      intp.print(activeApp.match(getServiceProps(active[i])) ? "running" : "stopping");
      intp.println("]");
    }
  }
  
  private ServiceReference getApplication(ServiceReference[] apps, String targetId, String idKey, boolean perfectMatch)
  {
    if ((apps == null) || (targetId == null)) {
      return null;
    }
    ServiceReference result = null;
    boolean ambigous = false;
    for (int i = 0; i < apps.length; i++)
    {
      String id = (String)apps[i].getProperty(idKey);
      if (targetId.equals(id)) {
        return apps[i];
      }
      if (!perfectMatch) {
        if (id.indexOf(targetId) >= 0)
        {
          if (result != null) {
            ambigous = true;
          }
          result = apps[i];
        }
      }
    }
    return ambigous ? null : result;
  }
  
  /* Error */
  public void _startApp(CommandInterpreter intp)
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_1
    //   1: invokeinterface 515 1 0
    //   6: astore_2
    //   7: aload_0
    //   8: aload_0
    //   9: getfield 443	org/eclipse/equinox/internal/app/AppCommands:applicationDescriptors	Lorg/osgi/util/tracker/ServiceTracker;
    //   12: invokevirtual 501	org/osgi/util/tracker/ServiceTracker:getServiceReferences	()[Lorg/osgi/framework/ServiceReference;
    //   15: aload_2
    //   16: ldc_w 252
    //   19: iconst_0
    //   20: invokespecial 491	org/eclipse/equinox/internal/app/AppCommands:getApplication	([Lorg/osgi/framework/ServiceReference;Ljava/lang/String;Ljava/lang/String;Z)Lorg/osgi/framework/ServiceReference;
    //   23: astore_3
    //   24: aload_3
    //   25: ifnonnull +35 -> 60
    //   28: aload_1
    //   29: new 266	java/lang/StringBuffer
    //   32: dup
    //   33: ldc_w 234
    //   36: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   39: aload_2
    //   40: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   43: ldc_w 235
    //   46: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   49: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   52: invokeinterface 514 2 0
    //   57: goto +176 -> 233
    //   60: new 268	java/util/ArrayList
    //   63: dup
    //   64: invokespecial 473	java/util/ArrayList:<init>	()V
    //   67: astore 4
    //   69: aconst_null
    //   70: astore 5
    //   72: goto +11 -> 83
    //   75: aload 4
    //   77: aload 5
    //   79: invokevirtual 474	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   82: pop
    //   83: aload_1
    //   84: invokeinterface 515 1 0
    //   89: dup
    //   90: astore 5
    //   92: ifnonnull -17 -> 75
    //   95: aload 4
    //   97: invokevirtual 472	java/util/ArrayList:size	()I
    //   100: ifne +7 -> 107
    //   103: aconst_null
    //   104: goto +19 -> 123
    //   107: aload 4
    //   109: aload 4
    //   111: invokevirtual 472	java/util/ArrayList:size	()I
    //   114: anewarray 265	java/lang/String
    //   117: invokevirtual 475	java/util/ArrayList:toArray	([Ljava/lang/Object;)[Ljava/lang/Object;
    //   120: checkcast 258	[Ljava/lang/String;
    //   123: astore 6
    //   125: new 269	java/util/HashMap
    //   128: dup
    //   129: iconst_1
    //   130: invokespecial 476	java/util/HashMap:<init>	(I)V
    //   133: astore 7
    //   135: aload 6
    //   137: ifnull +14 -> 151
    //   140: aload 7
    //   142: ldc_w 248
    //   145: aload 6
    //   147: invokevirtual 477	java/util/HashMap:put	(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    //   150: pop
    //   151: aload_0
    //   152: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   155: aload_3
    //   156: invokeinterface 517 2 0
    //   161: checkcast 285	org/osgi/service/application/ApplicationDescriptor
    //   164: astore 8
    //   166: aload 8
    //   168: aload 7
    //   170: invokevirtual 495	org/osgi/service/application/ApplicationDescriptor:launch	(Ljava/util/Map;)Lorg/osgi/service/application/ApplicationHandle;
    //   173: astore 9
    //   175: aload_1
    //   176: new 266	java/lang/StringBuffer
    //   179: dup
    //   180: ldc_w 239
    //   183: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   186: aload 9
    //   188: invokevirtual 498	org/osgi/service/application/ApplicationHandle:getInstanceId	()Ljava/lang/String;
    //   191: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   194: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   197: invokeinterface 514 2 0
    //   202: goto +19 -> 221
    //   205: astore 10
    //   207: aload_0
    //   208: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   211: aload_3
    //   212: invokeinterface 516 2 0
    //   217: pop
    //   218: aload 10
    //   220: athrow
    //   221: aload_0
    //   222: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   225: aload_3
    //   226: invokeinterface 516 2 0
    //   231: pop
    //   232: return
    //   233: return
    // Line number table:
    //   Java source line #243	-> byte code offset #0
    //   Java source line #244	-> byte code offset #7
    //   Java source line #245	-> byte code offset #24
    //   Java source line #246	-> byte code offset #28
    //   Java source line #248	-> byte code offset #60
    //   Java source line #249	-> byte code offset #69
    //   Java source line #250	-> byte code offset #72
    //   Java source line #251	-> byte code offset #75
    //   Java source line #250	-> byte code offset #83
    //   Java source line #252	-> byte code offset #95
    //   Java source line #254	-> byte code offset #125
    //   Java source line #255	-> byte code offset #135
    //   Java source line #256	-> byte code offset #140
    //   Java source line #257	-> byte code offset #151
    //   Java source line #258	-> byte code offset #166
    //   Java source line #259	-> byte code offset #175
    //   Java source line #260	-> byte code offset #205
    //   Java source line #261	-> byte code offset #207
    //   Java source line #262	-> byte code offset #218
    //   Java source line #261	-> byte code offset #221
    //   Java source line #263	-> byte code offset #232
    //   Java source line #265	-> byte code offset #233
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	234	0	this	AppCommands
    //   0	234	1	intp	CommandInterpreter
    //   6	34	2	appId	String
    //   23	203	3	application	ServiceReference
    //   67	43	4	argList	java.util.ArrayList
    //   70	21	5	arg	String
    //   123	23	6	args	String[]
    //   133	36	7	launchArgs	java.util.HashMap
    //   164	3	8	appDesc	ApplicationDescriptor
    //   173	14	9	handle	ApplicationHandle
    //   205	14	10	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   125	205	205	finally
  }
  
  /* Error */
  public void _stopApp(CommandInterpreter intp)
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_1
    //   1: invokeinterface 515 1 0
    //   6: astore_2
    //   7: aload_0
    //   8: aload_0
    //   9: getfield 444	org/eclipse/equinox/internal/app/AppCommands:applicationHandles	Lorg/osgi/util/tracker/ServiceTracker;
    //   12: invokevirtual 501	org/osgi/util/tracker/ServiceTracker:getServiceReferences	()[Lorg/osgi/framework/ServiceReference;
    //   15: aload_2
    //   16: ldc_w 252
    //   19: iconst_0
    //   20: invokespecial 491	org/eclipse/equinox/internal/app/AppCommands:getApplication	([Lorg/osgi/framework/ServiceReference;Ljava/lang/String;Ljava/lang/String;Z)Lorg/osgi/framework/ServiceReference;
    //   23: astore_3
    //   24: aload_3
    //   25: ifnonnull +20 -> 45
    //   28: aload_0
    //   29: aload_0
    //   30: getfield 444	org/eclipse/equinox/internal/app/AppCommands:applicationHandles	Lorg/osgi/util/tracker/ServiceTracker;
    //   33: invokevirtual 501	org/osgi/util/tracker/ServiceTracker:getServiceReferences	()[Lorg/osgi/framework/ServiceReference;
    //   36: aload_2
    //   37: ldc_w 249
    //   40: iconst_0
    //   41: invokespecial 491	org/eclipse/equinox/internal/app/AppCommands:getApplication	([Lorg/osgi/framework/ServiceReference;Ljava/lang/String;Ljava/lang/String;Z)Lorg/osgi/framework/ServiceReference;
    //   44: astore_3
    //   45: aload_3
    //   46: ifnonnull +35 -> 81
    //   49: aload_1
    //   50: new 266	java/lang/StringBuffer
    //   53: dup
    //   54: ldc_w 234
    //   57: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   60: aload_2
    //   61: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   64: ldc_w 236
    //   67: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   70: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   73: invokeinterface 514 2 0
    //   78: goto +132 -> 210
    //   81: aload_0
    //   82: getfield 439	org/eclipse/equinox/internal/app/AppCommands:activeApp	Lorg/osgi/framework/Filter;
    //   85: aload_0
    //   86: aload_3
    //   87: invokespecial 487	org/eclipse/equinox/internal/app/AppCommands:getServiceProps	(Lorg/osgi/framework/ServiceReference;)Ljava/util/Dictionary;
    //   90: invokeinterface 520 2 0
    //   95: ifeq +83 -> 178
    //   98: aload_0
    //   99: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   102: aload_3
    //   103: invokeinterface 517 2 0
    //   108: checkcast 286	org/osgi/service/application/ApplicationHandle
    //   111: astore 4
    //   113: aload 4
    //   115: invokevirtual 497	org/osgi/service/application/ApplicationHandle:destroy	()V
    //   118: aload_1
    //   119: new 266	java/lang/StringBuffer
    //   122: dup
    //   123: ldc_w 244
    //   126: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   129: aload 4
    //   131: invokevirtual 498	org/osgi/service/application/ApplicationHandle:getInstanceId	()Ljava/lang/String;
    //   134: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   137: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   140: invokeinterface 514 2 0
    //   145: goto +19 -> 164
    //   148: astore 5
    //   150: aload_0
    //   151: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   154: aload_3
    //   155: invokeinterface 516 2 0
    //   160: pop
    //   161: aload 5
    //   163: athrow
    //   164: aload_0
    //   165: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   168: aload_3
    //   169: invokeinterface 516 2 0
    //   174: pop
    //   175: goto +34 -> 209
    //   178: aload_1
    //   179: new 266	java/lang/StringBuffer
    //   182: dup
    //   183: ldc_w 238
    //   186: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   189: aload_3
    //   190: ldc_w 252
    //   193: invokeinterface 522 2 0
    //   198: invokevirtual 469	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   201: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   204: invokeinterface 514 2 0
    //   209: return
    //   210: return
    // Line number table:
    //   Java source line #268	-> byte code offset #0
    //   Java source line #270	-> byte code offset #7
    //   Java source line #271	-> byte code offset #24
    //   Java source line #272	-> byte code offset #28
    //   Java source line #273	-> byte code offset #45
    //   Java source line #274	-> byte code offset #49
    //   Java source line #276	-> byte code offset #81
    //   Java source line #278	-> byte code offset #98
    //   Java source line #279	-> byte code offset #113
    //   Java source line #280	-> byte code offset #118
    //   Java source line #281	-> byte code offset #148
    //   Java source line #282	-> byte code offset #150
    //   Java source line #283	-> byte code offset #161
    //   Java source line #282	-> byte code offset #164
    //   Java source line #285	-> byte code offset #178
    //   Java source line #287	-> byte code offset #209
    //   Java source line #289	-> byte code offset #210
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	211	0	this	AppCommands
    //   0	211	1	intp	CommandInterpreter
    //   6	55	2	appId	String
    //   23	167	3	application	ServiceReference
    //   111	19	4	appHandle	ApplicationHandle
    //   148	14	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   98	148	148	finally
  }
  
  /* Error */
  public void _lockApp(CommandInterpreter intp)
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_1
    //   1: invokeinterface 515 1 0
    //   6: astore_2
    //   7: aload_0
    //   8: aload_0
    //   9: getfield 443	org/eclipse/equinox/internal/app/AppCommands:applicationDescriptors	Lorg/osgi/util/tracker/ServiceTracker;
    //   12: invokevirtual 501	org/osgi/util/tracker/ServiceTracker:getServiceReferences	()[Lorg/osgi/framework/ServiceReference;
    //   15: aload_2
    //   16: ldc_w 252
    //   19: iconst_0
    //   20: invokespecial 491	org/eclipse/equinox/internal/app/AppCommands:getApplication	([Lorg/osgi/framework/ServiceReference;Ljava/lang/String;Ljava/lang/String;Z)Lorg/osgi/framework/ServiceReference;
    //   23: astore_3
    //   24: aload_3
    //   25: ifnonnull +35 -> 60
    //   28: aload_1
    //   29: new 266	java/lang/StringBuffer
    //   32: dup
    //   33: ldc_w 234
    //   36: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   39: aload_2
    //   40: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   43: ldc_w 235
    //   46: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   49: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   52: invokeinterface 514 2 0
    //   57: goto +81 -> 138
    //   60: aload_0
    //   61: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   64: aload_3
    //   65: invokeinterface 517 2 0
    //   70: checkcast 285	org/osgi/service/application/ApplicationDescriptor
    //   73: astore 4
    //   75: aload 4
    //   77: invokevirtual 492	org/osgi/service/application/ApplicationDescriptor:lock	()V
    //   80: aload_1
    //   81: new 266	java/lang/StringBuffer
    //   84: dup
    //   85: ldc_w 240
    //   88: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   91: aload 4
    //   93: invokevirtual 494	org/osgi/service/application/ApplicationDescriptor:getApplicationId	()Ljava/lang/String;
    //   96: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   99: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   102: invokeinterface 514 2 0
    //   107: goto +19 -> 126
    //   110: astore 5
    //   112: aload_0
    //   113: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   116: aload_3
    //   117: invokeinterface 516 2 0
    //   122: pop
    //   123: aload 5
    //   125: athrow
    //   126: aload_0
    //   127: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   130: aload_3
    //   131: invokeinterface 516 2 0
    //   136: pop
    //   137: return
    //   138: return
    // Line number table:
    //   Java source line #292	-> byte code offset #0
    //   Java source line #293	-> byte code offset #7
    //   Java source line #294	-> byte code offset #24
    //   Java source line #295	-> byte code offset #28
    //   Java source line #298	-> byte code offset #60
    //   Java source line #299	-> byte code offset #75
    //   Java source line #300	-> byte code offset #80
    //   Java source line #301	-> byte code offset #110
    //   Java source line #302	-> byte code offset #112
    //   Java source line #303	-> byte code offset #123
    //   Java source line #302	-> byte code offset #126
    //   Java source line #304	-> byte code offset #137
    //   Java source line #306	-> byte code offset #138
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	139	0	this	AppCommands
    //   0	139	1	intp	CommandInterpreter
    //   6	34	2	appId	String
    //   23	108	3	application	ServiceReference
    //   73	19	4	appDesc	ApplicationDescriptor
    //   110	14	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   60	110	110	finally
  }
  
  /* Error */
  public void _unlockApp(CommandInterpreter intp)
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_1
    //   1: invokeinterface 515 1 0
    //   6: astore_2
    //   7: aload_0
    //   8: aload_0
    //   9: getfield 443	org/eclipse/equinox/internal/app/AppCommands:applicationDescriptors	Lorg/osgi/util/tracker/ServiceTracker;
    //   12: invokevirtual 501	org/osgi/util/tracker/ServiceTracker:getServiceReferences	()[Lorg/osgi/framework/ServiceReference;
    //   15: aload_2
    //   16: ldc_w 252
    //   19: iconst_0
    //   20: invokespecial 491	org/eclipse/equinox/internal/app/AppCommands:getApplication	([Lorg/osgi/framework/ServiceReference;Ljava/lang/String;Ljava/lang/String;Z)Lorg/osgi/framework/ServiceReference;
    //   23: astore_3
    //   24: aload_3
    //   25: ifnonnull +35 -> 60
    //   28: aload_1
    //   29: new 266	java/lang/StringBuffer
    //   32: dup
    //   33: ldc_w 234
    //   36: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   39: aload_2
    //   40: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   43: ldc_w 235
    //   46: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   49: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   52: invokeinterface 514 2 0
    //   57: goto +81 -> 138
    //   60: aload_0
    //   61: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   64: aload_3
    //   65: invokeinterface 517 2 0
    //   70: checkcast 285	org/osgi/service/application/ApplicationDescriptor
    //   73: astore 4
    //   75: aload 4
    //   77: invokevirtual 493	org/osgi/service/application/ApplicationDescriptor:unlock	()V
    //   80: aload_1
    //   81: new 266	java/lang/StringBuffer
    //   84: dup
    //   85: ldc_w 245
    //   88: invokespecial 468	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   91: aload 4
    //   93: invokevirtual 494	org/osgi/service/application/ApplicationDescriptor:getApplicationId	()Ljava/lang/String;
    //   96: invokevirtual 470	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   99: invokevirtual 467	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   102: invokeinterface 514 2 0
    //   107: goto +19 -> 126
    //   110: astore 5
    //   112: aload_0
    //   113: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   116: aload_3
    //   117: invokeinterface 516 2 0
    //   122: pop
    //   123: aload 5
    //   125: athrow
    //   126: aload_0
    //   127: getfield 438	org/eclipse/equinox/internal/app/AppCommands:context	Lorg/osgi/framework/BundleContext;
    //   130: aload_3
    //   131: invokeinterface 516 2 0
    //   136: pop
    //   137: return
    //   138: return
    // Line number table:
    //   Java source line #309	-> byte code offset #0
    //   Java source line #310	-> byte code offset #7
    //   Java source line #311	-> byte code offset #24
    //   Java source line #312	-> byte code offset #28
    //   Java source line #315	-> byte code offset #60
    //   Java source line #316	-> byte code offset #75
    //   Java source line #317	-> byte code offset #80
    //   Java source line #318	-> byte code offset #110
    //   Java source line #319	-> byte code offset #112
    //   Java sourc
1 2 3 4 5

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