org.eclipse.wst.jsdt.debug.crossfire_1.0.150.v201201112259

16:49:08.808 INFO  jd.cli.Main - Decompiling org.eclipse.wst.jsdt.debug.crossfire_1.0.150.v201201112259.jar
package org.eclipse.wst.jsdt.debug.internal.crossfire;

public class CFObject
{
  private String type = null;
  private String name = null;
  private Number handle = null;
  
  public CFObject(String name, String type, Number handle)
  {
    this.name = name;
    this.type = type;
    this.handle = handle;
  }
  
  public Number getHandle()
  {
    return handle;
  }
  
  public String getType()
  {
    return type;
  }
  
  public String getName()
  {
    return name;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.CFObject
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;

public class CFThrowable
  extends Throwable
{
  private Map frame = null;
  private Map error = null;
  private Map objects = null;
  
  public CFThrowable(Map json)
  {
    if (json != null)
    {
      frame = ((Map)json.get("frame"));
      if (frame != null) {
        processFrame();
      } else {
        Map localMap = (Map)json.get("stackTrace");
      }
      error = ((Map)json.get("error"));
    }
  }
  
  void processFrame()
  {
    if (frame != null)
    {
      objects = new HashMap(frame.size());
      Map vals = (Map)frame.remove("value");
      if (vals != null)
      {
        vals = (Map)vals.remove("script");
        objects.put("script", new CFObject("script", (String)vals.get("type"), (Number)vals.get("handle")));
      }
      vals = (Map)frame.remove("scope");
      if (vals != null) {
        objects.put("scope", new CFObject("scope", (String)vals.get("type"), (Number)vals.get("handle")));
      }
      vals = (Map)frame.remove("callingFrame");
      if (vals != null) {
        objects.put("callingFrame", new CFObject("callingFrame", (String)vals.get("type"), (Number)vals.get("handle")));
      }
      vals = (Map)frame.remove("executionContext");
      if (vals != null) {
        objects.put("executionContext", new CFObject("executionContext", (String)vals.get("type"), (Number)vals.get("handle")));
      }
      vals = (Map)frame.remove("callee");
      if (vals != null) {
        objects.put("callee", new CFObject("callee", (String)vals.get("type"), (Number)vals.get("handle")));
      }
      vals = (Map)frame.remove("thisValue");
      if (vals != null) {
        objects.put("thisValue", new CFObject("thisValue", (String)vals.get("type"), (Number)vals.get("handle")));
      }
    }
  }
  
  public boolean isDebugger()
  {
    if (frame != null)
    {
      Boolean bool = (Boolean)error.get("isDebugger");
      if (bool != null) {
        return bool.booleanValue();
      }
    }
    return false;
  }
  
  public boolean isValid()
  {
    if (frame != null)
    {
      Boolean bool = (Boolean)error.get("isValid");
      if (bool != null) {
        return bool.booleanValue();
      }
    }
    return false;
  }
  
  public int lineNumber()
  {
    if (error != null)
    {
      Number val = (Number)error.get("lineNumber");
      if (val == null) {
        val = (Number)error.get("lineNo");
      }
      if (val != null) {
        return val.intValue();
      }
    }
    return -1;
  }
  
  public String getLocalizedMessage()
  {
    return getMessage();
  }
  
  public String getMessage()
  {
    if (error != null)
    {
      String val = (String)error.get("message");
      if (val == null) {
        val = (String)error.get("errorMessage");
      }
      return val;
    }
    return null;
  }
  
  public int columnNumber()
  {
    if (error != null)
    {
      Number val = (Number)error.get("columnNumber");
      if (val != null) {
        return val.intValue();
      }
    }
    return -1;
  }
  
  public int getFlags()
  {
    if (error != null)
    {
      Number val = (Number)error.get("flags");
      if (val != null) {
        return val.intValue();
      }
    }
    return -1;
  }
  
  public String getCategory()
  {
    if (error != null)
    {
      String val = (String)error.get("category");
      return val;
    }
    return null;
  }
  
  public String scriptName()
  {
    if (error != null)
    {
      String val = (String)error.get("fileName");
      if (val == null) {
        val = (String)error.get("sourceName");
      }
      return val;
    }
    return null;
  }
  
  public String functionName()
  {
    if (frame != null)
    {
      String val = (String)frame.get("functionName");
      return val;
    }
    return null;
  }
  
  public void printStackTrace()
  {
    if (frame != null) {
      return;
    }
    super.printStackTrace();
  }
  
  public void printStackTrace(PrintStream s)
  {
    if (frame != null) {
      return;
    }
    super.printStackTrace(s);
  }
  
  public void printStackTrace(PrintWriter s)
  {
    if (frame != null) {
      return;
    }
    super.printStackTrace(s);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.CFThrowable
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire;

public abstract interface Constants
{
  public static final String SPACE = " ";
  public static final String COLON = ":";
  public static final String EMPTY_STRING = "";
  public static final String UTF_8 = "UTF-8";
  public static final String URI_FILE_SCHEME = "file";
  public static final String UNKNOWN = "unknown";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.Constants
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire;

import java.net.URI;
import java.net.URISyntaxException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.jsdt.debug.internal.crossfire.event.CFEventQueue;
import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFMirror;
import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.CFPacket;
import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.JSON;
import org.osgi.framework.BundleContext;

public class CrossFirePlugin
  extends Plugin
{
  public static final String PLUGIN_ID = "org.eclipse.wst.jsdt.debug.crossfire";
  public static final String TRC_PACKETS = "org.eclipse.wst.jsdt.debug.crossfire/packets";
  public static final String TRC_EVENTQUEUE = "org.eclipse.wst.jsdt.debug.crossfire/eventqueue";
  public static final String TRC_JSDI = "org.eclipse.wst.jsdt.debug.crossfire/jsdi";
  public static final String TRC_JSON = "org.eclipse.wst.jsdt.debug.crossfire/json";
  public static final int INTERNAL_ERROR = 120;
  private static CrossFirePlugin plugin = null;
  
  public void start(BundleContext bundleContext)
    throws Exception
  {
    super.start(bundleContext);
    plugin = this;
    configureTracing();
  }
  
  public void stop(BundleContext bundleContext)
    throws Exception
  {
    try
    {
      plugin = null;
    }
    finally
    {
      super.stop(bundleContext);
    }
  }
  
  public static CrossFirePlugin getDefault()
  {
    return plugin;
  }
  
  public static void log(IStatus status)
  {
    if (plugin != null) {
      plugin.getLog().log(status);
    }
  }
  
  public static void log(Throwable t)
  {
    log(newErrorStatus("Error logged from Crossfire Debug: ", t));
  }
  
  public static void logErrorMessage(String message)
  {
    log(newErrorStatus("Internal message logged from Crossfire Debug: " + message, null));
  }
  
  public static IStatus newErrorStatus(String message, Throwable exception)
  {
    return new Status(4, "org.eclipse.wst.jsdt.debug.crossfire", 120, message, exception);
  }
  
  public void configureTracing()
  {
    if (getDefault().isDebugging())
    {
      String option = Platform.getDebugOption("org.eclipse.wst.jsdt.debug.crossfire/packets");
      if (option != null) {
        CFPacket.setTracing(Boolean.valueOf(option).booleanValue());
      }
      option = Platform.getDebugOption("org.eclipse.wst.jsdt.debug.crossfire/eventqueue");
      if (option != null) {
        CFEventQueue.setTracing(Boolean.valueOf(option).booleanValue());
      }
      option = Platform.getDebugOption("org.eclipse.wst.jsdt.debug.crossfire/jsdi");
      if (option != null) {
        CFMirror.setTracing(Boolean.valueOf(option).booleanValue());
      }
      option = Platform.getDebugOption("org.eclipse.wst.jsdt.debug.crossfire/json");
      if (option != null) {
        JSON.setTracing(Boolean.valueOf(option).booleanValue());
      }
    }
  }
  
  public static URI fileURI(IPath path)
    throws URISyntaxException
  {
    return new URI("file", null, path.makeAbsolute().toString(), null);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.CrossFirePlugin
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2;
import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector;
import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument;
import org.eclipse.wst.jsdt.debug.internal.core.launching.RemoteJavaScriptLaunchDelegate;
import org.eclipse.wst.jsdt.debug.internal.crossfire.connect.CrossfireAttachingConnector;
import org.eclipse.wst.jsdt.debug.internal.crossfire.connect.CrossfireListeningConnector;

public class LaunchHelper
{
  public static final String REMOTE_LAUNCH_CONFIG_TYPE_ID = "org.eclipse.wst.jsdt.debug.core.launchConfigurationType";
  
  public static ILaunchConfiguration newRemoteConfiguration(String name, boolean attach)
    throws CoreException
  {
    ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType type = mgr.getLaunchConfigurationType("org.eclipse.wst.jsdt.debug.core.launchConfigurationType");
    if (type != null)
    {
      ILaunchConfigurationWorkingCopy copy = type.newInstance(null, mgr.generateLaunchConfigurationName(name));
      Connector connector = null;
      if (attach)
      {
        connector = new CrossfireAttachingConnector();
        copy.setAttribute("connector_id", "crossfire.remote.attach.connector");
      }
      else
      {
        connector = new CrossfireListeningConnector();
        copy.setAttribute("connector_id", "crossfire.remote.listen.connector");
      }
      Map args = connector.defaultArguments();
      Map newargs = new HashMap();
      Map.Entry entry = null;
      Connector.Argument arg = null;
      for (Iterator i = args.entrySet().iterator(); i.hasNext();)
      {
        entry = (Map.Entry)i.next();
        arg = (Connector.Argument)entry.getValue();
        newargs.put(entry.getKey(), arg.toString());
      }
      copy.setAttribute("argument_map", newargs);
      return copy.doSave();
    }
    return null;
  }
  
  public static void doLaunch(ILaunchConfigurationDelegate2 delegate, ILaunch launch, ILaunchConfiguration config, IProgressMonitor monitor)
    throws CoreException
  {
    SubMonitor localmonitor = SubMonitor.convert(monitor, "launch both", 6);
    try
    {
      delegate.launch(config, "debug", launch, localmonitor);
      if (!localmonitor.isCanceled()) {
        localmonitor.worked(2);
      }
      ILaunchConfiguration cfg = newRemoteConfiguration("foo", true);
      if (!localmonitor.isCanceled()) {
        localmonitor.worked(2);
      }
      if (cfg != null)
      {
        RemoteJavaScriptLaunchDelegate del = new RemoteJavaScriptLaunchDelegate();
        del.launch(cfg, "debug", launch, localmonitor);
      }
      if (!localmonitor.isCanceled()) {
        localmonitor.worked(2);
      }
    }
    finally
    {
      if (!localmonitor.isCanceled()) {
        localmonitor.done();
      }
    }
  }
  
  public static void appendProjectContainer(ILaunch launch, String pname)
  {
    ISourceLocator loc = launch.getSourceLocator();
    if ((loc instanceof ISourceLookupDirector))
    {
      ISourceLookupDirector director = (ISourceLookupDirector)loc;
      IProject pj = ResourcesPlugin.getWorkspace().getRoot().getProject(pname);
      if (pj.exists())
      {
        ProjectSourceContainer container = new ProjectSourceContainer(pj, false);
        ISourceContainer[] containers = director.getSourceContainers();
        ISourceContainer[] newcontainers = new ISourceContainer[containers.length + 1];
        newcontainers[0] = container;
        System.arraycopy(containers, 0, newcontainers, 1, containers.length);
        director.setSourceContainers(newcontainers);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.LaunchHelper
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire;

import java.io.PrintStream;

public class Tracing
{
  public static final String PRINTABLE_LINE_FEED = "\\\\r\\\\n";
  
  public static void writeString(String string)
  {
    String s = string.replaceAll("\r\n", "\\\\r\\\\n");
    s = s.replaceAll("\r", "\\\\r");
    s = s.replaceAll("\n", "\\\\n");
    System.out.println("[CROSSFIRE]" + s);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.Tracing
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument;

public class BrowserArgument
  implements Connector.BooleanArgument
{
  public static final String BROWSER = "browser";
  private boolean doit = false;
  
  public String description()
  {
    return Messages.auto_attach_desc;
  }
  
  public String label()
  {
    return Messages.auto_attach_label;
  }
  
  public boolean mustSpecify()
  {
    return false;
  }
  
  public String name()
  {
    return "browser";
  }
  
  public void setValue(String value)
  {
    doit = Boolean.valueOf(value).booleanValue();
  }
  
  public String value()
  {
    return Boolean.toString(doit);
  }
  
  public boolean booleanValue()
  {
    return doit;
  }
  
  public boolean isValid(String value)
  {
    return true;
  }
  
  public void setValue(boolean booleanValue)
  {
    doit = booleanValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.BrowserArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument;

public class ConsoleArgument
  implements Connector.BooleanArgument
{
  public static final String CONSOLE = "console";
  private boolean fValue = true;
  
  public String description()
  {
    return Messages.console_arg_description;
  }
  
  public String label()
  {
    return Messages.console_arg_label;
  }
  
  public boolean mustSpecify()
  {
    return true;
  }
  
  public String name()
  {
    return "console";
  }
  
  public void setValue(String value)
  {
    fValue = Boolean.valueOf(value).booleanValue();
  }
  
  public String value()
  {
    return Boolean.toString(fValue);
  }
  
  public boolean booleanValue()
  {
    return fValue;
  }
  
  public boolean isValid(String value)
  {
    return value != null;
  }
  
  public void setValue(boolean booleanValue)
  {
    fValue = booleanValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.ConsoleArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
import org.eclipse.wst.jsdt.debug.core.jsdi.connect.AttachingConnector;
import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFVirtualMachine;
import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.CFTransportService;
import org.eclipse.wst.jsdt.debug.transport.Connection;
import org.eclipse.wst.jsdt.debug.transport.DebugSession;
import org.eclipse.wst.jsdt.debug.transport.TransportService;

public class CrossfireAttachingConnector
  implements AttachingConnector
{
  public static final String CROSSFIRE_REMOTE_ATTACH_CONNECTOR_ID = "crossfire.remote.attach.connector";
  
  public Map defaultArguments()
  {
    HashMap args = new HashMap(5);
    args.put("host", new HostArgument(null));
    args.put("port", new PortArgument(5000));
    args.put("timeout", new TimeoutArgument());
    args.put("console", new ConsoleArgument());
    args.put("dom", new DOMArgument());
    args.put("inspector", new InspectorArgument());
    args.put("net", new NetArgument());
    args.put("trace", new TraceArgument());
    if (!"win32".equals(Platform.getOS())) {
      args.put("browser", new BrowserArgument());
    }
    return args;
  }
  
  public String description()
  {
    return Messages.attach_connector_desc;
  }
  
  public String name()
  {
    return Messages.crossfire_remote_attach;
  }
  
  public String id()
  {
    return "crossfire.remote.attach.connector";
  }
  
  public VirtualMachine attach(Map arguments)
    throws IOException
  {
    String str = (String)arguments.get("browser");
    
    boolean browser = (Boolean.valueOf(str).booleanValue()) && (!"win32".equals(Platform.getOS()));
    if ((browser) && (!HostArgument.isLocalhost((String)arguments.get("host")))) {
      throw new IOException(Messages.cannot_launch_browser_not_localhost);
    }
    Connection c = null;
    if (browser) {
      c = launchForBrowser(arguments);
    } else {
      c = launch(arguments);
    }
    DebugSession session = new DebugSession(c);
    return new CFVirtualMachine(session);
  }
  
  Connection launchForBrowser(Map arguments)
    throws IOException
  {
    String host = (String)arguments.get("host");
    String port = (String)arguments.get("port");
    StringBuffer buffer = new StringBuffer("firefox -ProfileManager -load-fb-modules -crossfire-server-port ").append(port);
    Process p = Runtime.getRuntime().exec(buffer.toString());
    TransportService service = new CFTransportService(getToolArgs(arguments));
    String timeoutstr = (String)arguments.get("timeout");
    int timeout = Integer.parseInt(timeoutstr);
    buffer = new StringBuffer();
    buffer.append(host).append(':').append(Integer.parseInt(port));
    long timer = System.currentTimeMillis() + 20000L;
    Connection c = null;
    while ((p != null) && (System.currentTimeMillis() < timer) && (c == null)) {
      try
      {
        c = service.attach(buffer.toString(), timeout, timeout);
      }
      catch (IOException localIOException)
      {
        try
        {
          Thread.sleep(200L);
        }
        catch (InterruptedException localInterruptedException) {}
      }
    }
    if (c == null) {
      throw new IOException(NLS.bind(Messages.failed_to_attach_to_auto_browser, new String[] { host, port }));
    }
    return c;
  }
  
  Connection launch(Map arguments)
    throws IOException
  {
    TransportService service = new CFTransportService(getToolArgs(arguments));
    String host = (String)arguments.get("host");
    String port = (String)arguments.get("port");
    String timeoutstr = (String)arguments.get("timeout");
    int timeout = Integer.parseInt(timeoutstr);
    StringBuffer buffer = new StringBuffer();
    buffer.append(host).append(':').append(Integer.parseInt(port));
    return service.attach(buffer.toString(), timeout, timeout);
  }
  
  String[] getToolArgs(Map arguments)
  {
    ArrayList tools = new ArrayList();
    String value = (String)arguments.get("console");
    if (Boolean.valueOf(value).booleanValue()) {
      tools.add("console");
    }
    value = (String)arguments.get("dom");
    if (Boolean.valueOf(value).booleanValue()) {
      tools.add("dom");
    }
    value = (String)arguments.get("inspector");
    if (Boolean.valueOf(value).booleanValue()) {
      tools.add("inspector");
    }
    value = (String)arguments.get("net");
    if (Boolean.valueOf(value).booleanValue()) {
      tools.add("net");
    }
    value = (String)arguments.get("trace");
    if (Boolean.valueOf(value).booleanValue()) {
      tools.add("trace");
    }
    return (String[])tools.toArray(new String[tools.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.CrossfireAttachingConnector
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
import org.eclipse.wst.jsdt.debug.core.jsdi.connect.ListeningConnector;
import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFVirtualMachine;
import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.CFTransportService;
import org.eclipse.wst.jsdt.debug.transport.Connection;
import org.eclipse.wst.jsdt.debug.transport.DebugSession;
import org.eclipse.wst.jsdt.debug.transport.TransportService;

public class CrossfireListeningConnector
  implements ListeningConnector
{
  public static final String CROSSFIRE_REMOTE_ATTACH_CONNECTOR_ID = "crossfire.remote.listen.connector";
  
  public Map defaultArguments()
  {
    HashMap args = new HashMap(5);
    args.put("host", new HostArgument(null));
    args.put("port", new PortArgument(5000));
    args.put("timeout", new TimeoutArgument());
    args.put("console", new ConsoleArgument());
    return args;
  }
  
  public String description()
  {
    return Messages.attach_connector_desc;
  }
  
  public String name()
  {
    return Messages.attach_connector_name;
  }
  
  public String id()
  {
    return "crossfire.remote.listen.connector";
  }
  
  public VirtualMachine accept(Map arguments)
    throws IOException
  {
    TransportService service = new CFTransportService(null);
    String host = (String)arguments.get("host");
    String port = (String)arguments.get("port");
    String timeoutstr = (String)arguments.get("timeout");
    int timeout = Integer.parseInt(timeoutstr);
    StringBuffer buffer = new StringBuffer();
    buffer.append(host).append(':').append(Integer.parseInt(port));
    Connection c = service.accept(service.startListening(buffer.toString()), timeout, timeout);
    DebugSession session = new DebugSession(c);
    return new CFVirtualMachine(session);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.CrossfireListeningConnector
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument;

public class DOMArgument
  implements Connector.BooleanArgument
{
  public static final String DOM = "dom";
  private boolean fValue = true;
  
  public String description()
  {
    return Messages.dom_arg_description;
  }
  
  public String label()
  {
    return Messages.dom_arg_label;
  }
  
  public boolean mustSpecify()
  {
    return true;
  }
  
  public String name()
  {
    return "dom";
  }
  
  public void setValue(String value)
  {
    fValue = Boolean.valueOf(value).booleanValue();
  }
  
  public String value()
  {
    return Boolean.toString(fValue);
  }
  
  public boolean booleanValue()
  {
    return fValue;
  }
  
  public boolean isValid(String value)
  {
    return value != null;
  }
  
  public void setValue(boolean booleanValue)
  {
    fValue = booleanValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.DOMArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.StringArgument;

public class HostArgument
  implements Connector.StringArgument
{
  private static final long serialVersionUID = 3057403815318177030L;
  private String host;
  public static final String HOST = "host";
  
  public HostArgument(String host)
  {
    setValue(host);
  }
  
  public String description()
  {
    return Messages.host_arg_desc;
  }
  
  public boolean isValid(String value)
  {
    return value != null;
  }
  
  public String label()
  {
    return Messages.host_arg_name;
  }
  
  public boolean mustSpecify()
  {
    return true;
  }
  
  public String name()
  {
    return "host";
  }
  
  public void setValue(String host)
  {
    if (host == null)
    {
      this.host = "localhost";
    }
    else
    {
      if (!isValid(host)) {
        throw new IllegalArgumentException();
      }
      this.host = host;
    }
  }
  
  public String value()
  {
    return host;
  }
  
  public static boolean isLocalhost(String host)
  {
    return (host.equals("localhost")) || (host.equals("127.0.0.1"));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.HostArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument;

public class InspectorArgument
  implements Connector.BooleanArgument
{
  public static final String INSPECTOR = "inspector";
  private boolean fValue = true;
  
  public String description()
  {
    return Messages.inspector_arg_description;
  }
  
  public String label()
  {
    return Messages.inspector_arg_label;
  }
  
  public boolean mustSpecify()
  {
    return true;
  }
  
  public String name()
  {
    return "inspector";
  }
  
  public void setValue(String value)
  {
    fValue = Boolean.valueOf(value).booleanValue();
  }
  
  public String value()
  {
    return Boolean.toString(fValue);
  }
  
  public boolean booleanValue()
  {
    return fValue;
  }
  
  public boolean isValid(String value)
  {
    return value != null;
  }
  
  public void setValue(boolean booleanValue)
  {
    fValue = booleanValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.InspectorArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.debug.internal.crossfire.connect.messages";
  public static String attach_connector_desc;
  public static String attach_connector_name;
  public static String auto_attach_desc;
  public static String auto_attach_label;
  public static String cannot_launch_browser_not_localhost;
  public static String console_arg_description;
  public static String console_arg_label;
  public static String crossfire_remote_attach;
  public static String dom_arg_description;
  public static String dom_arg_label;
  public static String failed_to_attach_to_auto_browser;
  public static String host_arg_desc;
  public static String host_arg_name;
  public static String inspector_arg_description;
  public static String inspector_arg_label;
  public static String net_arg_description;
  public static String net_arg_label;
  public static String port_arg_desc;
  public static String port_arg_name;
  public static String timeout;
  public static String timeout_desc;
  public static String trace_arg_description;
  public static String trace_arg_label;
  
  static
  {
    NLS.initializeMessages("org.eclipse.wst.jsdt.debug.internal.crossfire.connect.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.Messages
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument;

public class NetArgument
  implements Connector.BooleanArgument
{
  public static final String NET = "net";
  private boolean fValue = true;
  
  public String description()
  {
    return Messages.net_arg_description;
  }
  
  public String label()
  {
    return Messages.net_arg_label;
  }
  
  public boolean mustSpecify()
  {
    return true;
  }
  
  public String name()
  {
    return "net";
  }
  
  public void setValue(String value)
  {
    fValue = Boolean.valueOf(value).booleanValue();
  }
  
  public String value()
  {
    return Boolean.toString(fValue);
  }
  
  public boolean booleanValue()
  {
    return fValue;
  }
  
  public boolean isValid(String value)
  {
    return value != null;
  }
  
  public void setValue(boolean booleanValue)
  {
    fValue = booleanValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.NetArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument;

public class PortArgument
  implements Connector.IntegerArgument
{
  private static final long serialVersionUID = -1954469572907116388L;
  private int port;
  public static final String PORT = "port";
  
  public PortArgument(int port)
  {
    setValue(port);
  }
  
  public int intValue()
  {
    return port;
  }
  
  public boolean isValid(int intValue)
  {
    return intValue > 0;
  }
  
  public int max()
  {
    return Integer.MAX_VALUE;
  }
  
  public int min()
  {
    return 1;
  }
  
  public void setValue(int port)
  {
    this.port = port;
  }
  
  public String description()
  {
    return Messages.port_arg_desc;
  }
  
  public boolean isValid(String value)
  {
    try
    {
      int intValue = Integer.parseInt(value);
      return isValid(intValue);
    }
    catch (NumberFormatException localNumberFormatException) {}
    return false;
  }
  
  public String label()
  {
    return Messages.port_arg_name;
  }
  
  public boolean mustSpecify()
  {
    return true;
  }
  
  public String name()
  {
    return "port";
  }
  
  public void setValue(String value)
  {
    try
    {
      int intValue = Integer.parseInt(value);
      setValue(intValue);
    }
    catch (NumberFormatException nfe)
    {
      throw new IllegalArgumentException(nfe.getMessage());
    }
  }
  
  public String value()
  {
    return Integer.toString(port);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.PortArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument;

public class TimeoutArgument
  implements Connector.IntegerArgument
{
  public static final String TIMEOUT = "timeout";
  public static final Integer CONNECT_TIMEOUT = new Integer(30000);
  private int timeout = 0;
  
  public TimeoutArgument()
  {
    setValue(CONNECT_TIMEOUT.intValue());
  }
  
  public String description()
  {
    return Messages.timeout_desc;
  }
  
  public String label()
  {
    return Messages.timeout;
  }
  
  public boolean mustSpecify()
  {
    return true;
  }
  
  public String name()
  {
    return "timeout";
  }
  
  public void setValue(String value)
  {
    try
    {
      timeout = Integer.parseInt(value);
    }
    catch (NumberFormatException localNumberFormatException) {}
  }
  
  public String value()
  {
    return Integer.toString(timeout);
  }
  
  public int intValue()
  {
    return timeout;
  }
  
  public boolean isValid(int intValue)
  {
    return intValue > 0;
  }
  
  public boolean isValid(String value)
  {
    try
    {
      return Integer.parseInt(value) > 0;
    }
    catch (NumberFormatException localNumberFormatException) {}
    return false;
  }
  
  public int max()
  {
    return Integer.MAX_VALUE;
  }
  
  public int min()
  {
    return 0;
  }
  
  public void setValue(int intValue)
  {
    timeout = intValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.TimeoutArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;

import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument;

public class TraceArgument
  implements Connector.BooleanArgument
{
  public static final String TRACE = "trace";
  private boolean fValue = false;
  
  public String description()
  {
    return Messages.trace_arg_description;
  }
  
  public String label()
  {
    return Messages.trace_arg_label;
  }
  
  public boolean mustSpecify()
  {
    return true;
  }
  
  public String name()
  {
    return "trace";
  }
  
  public void setValue(String value)
  {
    fValue = Boolean.valueOf(value).booleanValue();
  }
  
  public String value()
  {
    return Boolean.toString(fValue);
  }
  
  public boolean booleanValue()
  {
    return fValue;
  }
  
  public boolean isValid(String value)
  {
    return value != null;
  }
  
  public void setValue(boolean booleanValue)
  {
    fValue = booleanValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.connect.TraceArgument
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.event;

import org.eclipse.wst.jsdt.debug.core.jsdi.Location;
import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
import org.eclipse.wst.jsdt.debug.core.jsdi.event.BreakpointEvent;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;

public class CFBreakpointEvent
  extends CFLocatableEvent
  implements BreakpointEvent
{
  public CFBreakpointEvent(VirtualMachine vm, EventRequest request, ThreadReference thread, Location location)
  {
    super(vm, request, thread, location);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.event.CFBreakpointEvent
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.event;

import org.eclipse.wst.jsdt.debug.core.jsdi.Location;
import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
import org.eclipse.wst.jsdt.debug.core.jsdi.event.DebuggerStatementEvent;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;

public class CFDebuggerStatementEvent
  extends CFLocatableEvent
  implements DebuggerStatementEvent
{
  public CFDebuggerStatementEvent(VirtualMachine vm, EventRequest request, ThreadReference thread, Location location)
  {
    super(vm, request, thread, location);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.event.CFDebuggerStatementEvent
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.event;

import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
import org.eclipse.wst.jsdt.debug.core.jsdi.event.Event;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;

public class CFEvent
  implements Event
{
  private VirtualMachine vm = null;
  private EventRequest request = null;
  
  public CFEvent(VirtualMachine vm, EventRequest request)
  {
    this.vm = vm;
    this.request = request;
  }
  
  public VirtualMachine virtualMachine()
  {
    return vm;
  }
  
  public EventRequest request()
  {
    return request;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.debug.internal.crossfire.event.CFEvent
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.debug.internal.crossfire.event;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
import org.eclipse.wst.jsdt.debug.core.jsdi.event.EventQueue;
import org.eclipse.wst.jsdt.debug.core.jsdi.event.EventSet;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.ResumeRequest;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.ScriptLoadRequest;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.SuspendRequest;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadEnterRequest;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadExitRequest;
import org.eclipse.wst.jsdt.debug.core.jsdi.request.VMDeathRequest;
import org.eclipse.wst.jsdt.debug.internal.crossfire.CFThrowable;
import org.eclipse.wst.jsdt.debug.internal.crossfire.CrossFirePlugin;
import org.eclipse.wst.jsdt.debug.internal.crossfire.Tracing;
import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFLocation;
import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFMirror;
import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFScriptReference;
import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFThreadReference;
import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFVirtualMachine;
import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.CFEventPacket;
import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.JSON;
import org.eclipse.wst.jsdt.debug.transport.exception.DisconnectedException;
import org.eclipse.wst.jsdt.debug.transport.exception.TimeoutException;

public class CFEventQueue
  extends CFMirror
  implements EventQueue
{
  private static boolean TRACE = false;
  private EventRequestManager eventmgr = null;
  private boolean disposed = false;
  
  public CFEventQueue(CFVirtualMachine vm, EventRequestManager manager)
  {
    super(vm);
    eventmgr = manager;
  }
  
  public EventSet remove()
  {
    return remove(-1);
  }
  
  public EventSet remove(int timeout)
  {
    try
    {
      while (!disposed)
      {
        CFEventPacket event = crossfire().receiveEvent(timeout);
        String name = event.getEvent();
        CFEventSet set = new CFEventSet(crossfire());
        if ("closed".equals(name))
        {
          List deaths = eventmgr.vmDeathRequests();
          for (Iterator iter = deaths.iterator(); iter.hasNext();)
          {
            VMDeathRequest request = (VMDeathRequest)iter.next();
            set.add(new CFVMDeathEvent(crossfire(), request));
          }
          if (TRACE) {
          
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