This commit was manufactured by cvs2svn to create tag 'v201005250108'.
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/.classpath b/bundles/org.eclipse.wst.jsdt.debug.crossfire/.classpath
deleted file mode 100644
index 2fbb7a2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/.options b/bundles/org.eclipse.wst.jsdt.debug.crossfire/.options
deleted file mode 100644
index 26fd669..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/.options
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#option file for tracing options for Crossfire debugger port
-org.eclipse.wst.jsdt.debug.crossfire/debug=true
-
-#option to trace packets being sent / recieved
-org.eclipse.wst.jsdt.debug.crossfire/packets=false
-
-#option to trace the event queue
-org.eclipse.wst.jsdt.debug.crossfire/eventqueue=false
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/.project b/bundles/org.eclipse.wst.jsdt.debug.crossfire/.project
deleted file mode 100644
index 243de54..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.jsdt.debug.internal.crossfire</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.debug.crossfire/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index de9eac3..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,90 +0,0 @@
-#Fri Apr 30 10:04:28 CDT 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
-org.eclipse.jdt.core.compiler.problem.deadCode=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=error
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.debug.crossfire/META-INF/MANIFEST.MF
deleted file mode 100644
index e7e1ce9..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: JSDT Crossfire Debug Support
-Bundle-SymbolicName: org.eclipse.wst.jsdt.debug.crossfire;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.jsdt.debug.internal.crossfire.CrossFirePlugin
-Bundle-Vendor: Eclipse
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.wst.jsdt.debug.core;bundle-version="1.0.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/build.properties b/bundles/org.eclipse.wst.jsdt.debug.crossfire/build.properties
deleted file mode 100644
index e9863e2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/plugin.xml b/bundles/org.eclipse.wst.jsdt.debug.crossfire/plugin.xml
deleted file mode 100644
index e232ba6..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/plugin.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.wst.jsdt.debug.core.launchingConnectors">
- <connector
- class="org.eclipse.wst.jsdt.debug.internal.crossfire.connect.CrossfireListeningConnector"
- id="crossfire.remote.listen.connector">
- </connector>
- </extension>
- <extension
- point="org.eclipse.wst.jsdt.debug.core.launchingConnectors">
- <connector
- class="org.eclipse.wst.jsdt.debug.internal.crossfire.connect.CrossfireAttachingConnector"
- id="crossfire.remote.attach.connector">
- </connector>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/Constants.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/Constants.java
deleted file mode 100644
index cd50734..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/Constants.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire;
-
-/**
- * Constants for the bundle
- *
- * @since 1.0
- */
-public interface Constants {
-
- /**
- * Constant representing a space
- */
- public static final String SPACE = " "; //$NON-NLS-1$
- /**
- * Constant representing a colon.<br>
- * <br>
- * Value is: <code>:</code>
- */
- public static final String COLON = ":"; //$NON-NLS-1$
- /**
- * Constant representing the empty string
- */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
- /**
- * UTF-8 encoding constant <br>
- * <br>
- * Value is: <code>UTF-8</code>
- */
- public static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
- public static String URI_FILE_SCHEME = "file"; //$NON-NLS-1$
- public static final String UNKNOWN = "unknown"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/CrossFirePlugin.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/CrossFirePlugin.java
deleted file mode 100644
index a6d0dca..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/CrossFirePlugin.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package org.eclipse.wst.jsdt.debug.internal.crossfire;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-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.transport.Packet;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * Crossfire {@link BundleActivator}
- *
- * @since 1.0
- */
-public class CrossFirePlugin extends Plugin {
-
- /**
- * Id of the bundle
- */
- public static final String PLUGIN_ID = "org.eclipse.wst.jsdt.debug.crossfire"; //$NON-NLS-1$
- /**
- * Packet tracing option name
- */
- public static final String TRC_PACKETS = PLUGIN_ID + "/packets"; //$NON-NLS-1$
- /**
- * Event queue tracing option name
- */
- public static final String TRC_EVENTQUEUE = PLUGIN_ID + "/eventqueue"; //$NON-NLS-1$
-
- /**
- * Status code indicating an unexpected internal error.
- */
- public static final int INTERNAL_ERROR = 120;
-
- private static CrossFirePlugin plugin = null;
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext bundleContext) throws Exception {
- super.start(bundleContext);
- plugin = this;
- configureTracing();
- }
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext bundleContext) throws Exception {
- try {
- plugin = null;
- }
- finally {
- super.stop(bundleContext);
- }
- }
-
- public static CrossFirePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Logs the specified status with this plug-in's log.
- *
- * @param status status to log
- */
- public static void log(IStatus status) {
- if (plugin != null) {
- plugin.getLog().log(status);
- }
- }
-
- /**
- * Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to log
- */
- public static void log(Throwable t) {
- log(newErrorStatus("Error logged from Crossfire Debug: ", t)); //$NON-NLS-1$
- }
-
- /**
- * Logs an internal error with the specified message.
- *
- * @param message the error message to log
- */
- public static void logErrorMessage(String message) {
- log(newErrorStatus("Internal message logged from Crossfire Debug: " + message, null)); //$NON-NLS-1$
- }
-
- /**
- * Returns a new error status for this plug-in with the given message
- * @param message the message to be included in the status
- * @param exception the exception to be included in the status or <code>null</code> if none
- * @return a new error status
- */
- public static IStatus newErrorStatus(String message, Throwable exception) {
- return new Status(IStatus.ERROR, PLUGIN_ID, INTERNAL_ERROR, message, exception);
- }
-
- /**
- * Turns on / off any tracing options
- */
- public void configureTracing() {
- if(CrossFirePlugin.getDefault().isDebugging()) {
- String option = Platform.getDebugOption(TRC_PACKETS);
- if(option != null) {
- Packet.setTracing(Boolean.valueOf(option).booleanValue());
- }
- option = Platform.getDebugOption(TRC_EVENTQUEUE);
- if(option != null) {
- CFEventQueue.setTracing(Boolean.valueOf(option).booleanValue());
- }
- }
- }
-
- /**
- * Creates a new {@link URI} with the <code>file</code> scheme
- * @param path
- * @return a new {@link URI}
- * @throws URISyntaxException
- */
- public static URI fileURI(IPath path) throws URISyntaxException {
- return new URI(Constants.URI_FILE_SCHEME, null, path.makeAbsolute().toString(), null);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/Tracing.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/Tracing.java
deleted file mode 100644
index 1207313..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/Tracing.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire;
-
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.JSON;
-
-/**
- * Helper class for common tracing functions
- *
- * @since 1.0
- */
-public class Tracing {
-
- public static final String PRINTABLE_LINE_FEED = "\\\\r\\\\n"; //$NON-NLS-1$
-
- /**
- * Writes the string to system out cleaning it of control chars before printing it
- *
- * @param string
- */
- public static void writeString(String string) {
- System.out.println(string.replaceAll(JSON.LINE_FEED, PRINTABLE_LINE_FEED));
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/BrowserArgument.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/BrowserArgument.java
deleted file mode 100644
index 63e4915..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/BrowserArgument.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument;
-
-/**
- * Option to automatically launch the browser and connect to it
- *
- * @since 1.0
- */
-public class BrowserArgument implements BooleanArgument {
-
- /**
- * name of the argument
- */
- public static final String BROWSER = "browser"; //$NON-NLS-1$
-
- private boolean doit = false;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#description()
- */
- public String description() {
- return Messages.auto_attach_desc;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#label()
- */
- public String label() {
- return Messages.auto_attach_label;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#mustSpecify()
- */
- public boolean mustSpecify() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#name()
- */
- public String name() {
- return BROWSER;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#setValue(java.lang.String)
- */
- public void setValue(String value) {
- doit = Boolean.valueOf(value).booleanValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#value()
- */
- public String value() {
- return Boolean.toString(doit);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument#booleanValue()
- */
- public boolean booleanValue() {
- return doit;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument#isValid(java.lang.String)
- */
- public boolean isValid(String value) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.BooleanArgument#setValue(boolean)
- */
- public void setValue(boolean booleanValue) {
- doit = booleanValue;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/CrossfireAttachingConnector.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/CrossfireAttachingConnector.java
deleted file mode 100644
index e485c49..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/CrossfireAttachingConnector.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.AttachingConnector;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.CrossFirePlugin;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFVirtualMachine;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Connection;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.DebugSession;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.SocketTransportService;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.TransportService;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.TransportService.ListenerKey;
-
-/**
- * Attaching connector for Crossfire
- *
- * @since 1.0
- */
-public class CrossfireAttachingConnector implements AttachingConnector {
-
- public static final String CROSSFIRE_REMOTE_ATTACH_CONNECTOR_ID = "crossfire.remote.attach.connector"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public CrossfireAttachingConnector() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#defaultArguments()
- */
- public Map defaultArguments() {
- Map args = new HashMap(4);
- args.put(HostArgument.HOST, new HostArgument(null));
- args.put(PortArgument.PORT, new PortArgument(5000));
- args.put(TimeoutArgument.TIMEOUT, new TimeoutArgument());
- args.put(BrowserArgument.BROWSER, new BrowserArgument());
- return args;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#description()
- */
- public String description() {
- return Messages.attach_connector_desc;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#name()
- */
- public String name() {
- return Messages.crossfire_remote_attach;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#id()
- */
- public String id() {
- return CROSSFIRE_REMOTE_ATTACH_CONNECTOR_ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.AttachingConnector#attach(java.util.Map)
- */
- public VirtualMachine attach(Map arguments) throws IOException {
- String str = (String)arguments.get(BrowserArgument.BROWSER);
- boolean browser = Boolean.valueOf(str).booleanValue();
- TransportService service = new SocketTransportService();
- String host = (String) arguments.get(HostArgument.HOST);
- String port = (String) arguments.get(PortArgument.PORT);
- if(browser && !host.equals(TransportService.LOCALHOST)) {
- //we cannot auto launch the browser on a different host
- return null;
- }
- if(browser) {
- launchBrowser(host, port);
- }
- String timeoutstr = (String) arguments.get(TimeoutArgument.TIMEOUT);
- int timeout = Integer.parseInt(timeoutstr);
- StringBuffer buffer = new StringBuffer();
- buffer.append(host).append(':').append(Integer.parseInt(port));
- ListenerKey key = service.startListening(buffer.toString());
- Connection c = null;
- try {
- c = service.accept(key, timeout, timeout);
- }
- catch(IOException ioe) {
- service.stopListening(key);
- return null;
- }
- DebugSession session = new DebugSession(c);
- return new CFVirtualMachine(session);
- }
-
- /**
- * Launch the browser on the given host / port
- * @param host
- * @param port
- * @throws IOException
- */
- void launchBrowser(final String host, final String port) throws IOException {
- Thread thread = new Thread() {
- public void run() {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- CrossFirePlugin.log(e);
- }
- StringBuffer buffer = new StringBuffer("firefox -P crossfire -no-remote -load-fb-modules -crossfire-host "); //$NON-NLS-1$
- buffer.append(host).append(" -crossfire-port ").append(port); //$NON-NLS-1$
- try {
- Runtime.getRuntime().exec(buffer.toString());
- } catch (IOException e) {
- CrossFirePlugin.log(e);
- }
- };
- };
- thread.start();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/CrossfireListeningConnector.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/CrossfireListeningConnector.java
deleted file mode 100644
index c8d661b..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/CrossfireListeningConnector.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.Connection;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.DebugSession;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.SocketTransportService;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.TransportService;
-
-/**
- * Default launching connector for CrossFire
- *
- * @since 1.0
- */
-public class CrossfireListeningConnector implements ListeningConnector {
-
- /**
- * The id of the connector
- */
- public static final String CROSSFIRE_REMOTE_ATTACH_CONNECTOR_ID = "crossfire.remote.listen.connector"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public CrossfireListeningConnector() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#defaultArguments()
- */
- public Map defaultArguments() {
- Map args = new HashMap(2);
- args.put(HostArgument.HOST, new HostArgument(null));
- args.put(PortArgument.PORT, new PortArgument(5000));
- args.put(TimeoutArgument.TIMEOUT, new TimeoutArgument());
- return args;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#description()
- */
- public String description() {
- return Messages.attach_connector_desc;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#name()
- */
- public String name() {
- return Messages.attach_connector_name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#id()
- */
- public String id() {
- return CROSSFIRE_REMOTE_ATTACH_CONNECTOR_ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.ListeningConnector#accept(java.util.Map)
- */
- public VirtualMachine accept(Map arguments) throws IOException {
- TransportService service = new SocketTransportService();
- String host = (String) arguments.get(HostArgument.HOST);
- String port = (String) arguments.get(PortArgument.PORT);
- String timeoutstr = (String) arguments.get(TimeoutArgument.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);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/HostArgument.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/HostArgument.java
deleted file mode 100644
index 4f1ae43..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/HostArgument.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.StringArgument;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.TransportService;
-
-/**
- * Implementation of a string argument that describes the host argument
- *
- * @since 1.0
- */
-public class HostArgument implements StringArgument {
-
- private static final long serialVersionUID = 3057403815318177030L;
- private String host;
-
- /**
- * Host attribute name
- */
- public static final String HOST = "host"; //$NON-NLS-1$
-
- /**
- * Constructor
- *
- * @param host
- */
- public HostArgument(String host) {
- setValue(host);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#description()
- */
- public String description() {
- return Messages.host_arg_desc;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.StringArgument#isValid(java.lang.String)
- */
- public boolean isValid(String value) {
- return value != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#label()
- */
- public String label() {
- return Messages.host_arg_name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#mustSpecify()
- */
- public boolean mustSpecify() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#name()
- */
- public String name() {
- return HOST;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#setValue(java.lang.String)
- */
- public void setValue(String host) {
- if(host == null) {
- this.host = TransportService.LOCALHOST;
- }
- else {
- if (!isValid(host)) {
- throw new IllegalArgumentException();
- }
- this.host = host;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#value()
- */
- public String value() {
- return host;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/Messages.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/Messages.java
deleted file mode 100644
index 17bdf46..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/Messages.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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"; //$NON-NLS-1$
- 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 crossfire_remote_attach;
- public static String host_arg_desc;
- public static String host_arg_name;
- public static String port_arg_desc;
- public static String port_arg_name;
- public static String timeout;
- public static String timeout_desc;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/PortArgument.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/PortArgument.java
deleted file mode 100644
index ced215f..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/PortArgument.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument;
-
-/**
- * Implementation of an {@link IntegerArgument} that describes the port to try connecting to
- *
- * @since 1.0
- */
-public class PortArgument implements IntegerArgument {
-
- private static final long serialVersionUID = -1954469572907116388L;
- private int port;
-
- /**
- * The port attribute name
- */
- public static final String PORT = "port"; //$NON-NLS-1$
-
- /**
- * Constructor
- *
- * @param port
- */
- public PortArgument(int port) {
- setValue(port);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#intValue()
- */
- public int intValue() {
- return port;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#isValid(int)
- */
- public boolean isValid(int intValue) {
- return intValue > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#max()
- */
- public int max() {
- return Integer.MAX_VALUE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#min()
- */
- public int min() {
- return 1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#setValue(int)
- */
- public void setValue(int port) {
- this.port = port;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#description()
- */
- public String description() {
- return Messages.port_arg_desc;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#isValid(java.lang.String)
- */
- public boolean isValid(String value) {
- try {
- int intValue = Integer.parseInt(value);
- return isValid(intValue);
- } catch (NumberFormatException e) {
- return false;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#label()
- */
- public String label() {
- return Messages.port_arg_name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#mustSpecify()
- */
- public boolean mustSpecify() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#name()
- */
- public String name() {
- return PORT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#setValue(java.lang.String)
- */
- public void setValue(String value) {
- try {
- int intValue = Integer.parseInt(value);
- setValue(intValue);
- } catch (NumberFormatException nfe) {
- // re-throw IllegalArgumentException
- throw new IllegalArgumentException(nfe.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#value()
- */
- public String value() {
- return Integer.toString(port);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/TimeoutArgument.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/TimeoutArgument.java
deleted file mode 100644
index c622e8b..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/TimeoutArgument.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.connect;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument;
-
-/**
- * Argument used to specify a timeout (in ms)
- *
- * @since 1.1
- */
-public class TimeoutArgument implements IntegerArgument {
-
- /**
- * Argument to specify a timeout
- */
- public static final String TIMEOUT = "timeout"; //$NON-NLS-1$
- /**
- * default connecting timeout
- */
- public static final Integer CONNECT_TIMEOUT = new Integer(30000);
-
- /**
- * The timeout
- */
- private int timeout = 0;
-
- /**
- * Constructor
- */
- public TimeoutArgument() {
- setValue(CONNECT_TIMEOUT.intValue());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#description()
- */
- public String description() {
- return Messages.timeout_desc;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#label()
- */
- public String label() {
- return Messages.timeout;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#mustSpecify()
- */
- public boolean mustSpecify() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#name()
- */
- public String name() {
- return TIMEOUT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#setValue(java.lang.String)
- */
- public void setValue(String value) {
- try {
- timeout = Integer.parseInt(value);
- }
- catch(NumberFormatException nfe) {
- //do nothing the new value will not be set
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#value()
- */
- public String value() {
- return Integer.toString(timeout);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#intValue()
- */
- public int intValue() {
- return timeout;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#isValid(int)
- */
- public boolean isValid(int intValue) {
- return intValue > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#isValid(java.lang.String)
- */
- public boolean isValid(String value) {
- try {
- return Integer.parseInt(value) > 0;
- }
- catch(NumberFormatException bfe) {
- //do nothing, just not valid
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#max()
- */
- public int max() {
- return Integer.MAX_VALUE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#min()
- */
- public int min() {
- return 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#setValue(int)
- */
- public void setValue(int intValue) {
- timeout = intValue;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/messages.properties b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/messages.properties
deleted file mode 100644
index 40a0aca..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/connect/messages.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-attach_connector_desc=Allows you to connect to a Mozilla-based browser with the CrossFire extension installed
-attach_connector_name=CrossFire - Remote Listen
-auto_attach_desc=Automatically launch Firefox and attach to it
-auto_attach_label=Auto&matically launch Firefox and attach to it (extremely experimental)
-crossfire_remote_attach=Crossfire - Remote Attach
-host_arg_desc=The name of the host address to try attaching to.
-host_arg_name=&Host:
-port_arg_desc=The port on the host machine to try attaching to.
-port_arg_name=&Port:
-timeout=&Timeout (ms):
-timeout_desc=A timeout value in milliseconds to wait for a debugger to connect
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEvent.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEvent.java
deleted file mode 100644
index 301f40a..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEvent.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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;
-
-/**
- * Default implementation of an {@link Event} for Crossfire
- *
- * @since 1.0
- */
-public class CFEvent implements Event {
-
- private VirtualMachine vm = null;
- private EventRequest request = null;
-
- /**
- * Constructor
- *
- * @param vm
- * @param request
- */
- public CFEvent(VirtualMachine vm, EventRequest request) {
- this.vm = vm;
- this.request = request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Mirror#virtualMachine()
- */
- public VirtualMachine virtualMachine() {
- return vm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.Event#request()
- */
- public EventRequest request() {
- return request;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEventQueue.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEventQueue.java
deleted file mode 100644
index 398e1c9..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEventQueue.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.event;
-
-import java.util.Iterator;
-import java.util.List;
-
-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.ScriptLoadRequest;
-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.CrossFirePlugin;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.Tracing;
-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.DisconnectedException;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Event;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.JSON;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.TimeoutException;
-
-/**
- * Default {@link EventQueue} for Crossfire
- *
- * @since 1.0
- */
-public class CFEventQueue extends CFMirror implements EventQueue {
-
- private static boolean TRACE = false;
-
- private EventRequestManager eventmgr = null;
- private boolean disposed = false;
-
- /**
- * Constructor
- *
- * @param vm
- * @param manager
- */
- public CFEventQueue(CFVirtualMachine vm, EventRequestManager manager) {
- super(vm);
- this.eventmgr = manager;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.EventQueue#remove()
- */
- public EventSet remove() {
- return remove(-1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.EventQueue#remove(int)
- */
- public EventSet remove(int timeout) {
- try {
- while(true && !disposed) {
- Event event = crossfire().receiveEvent(timeout);
- String name = event.getEvent();
- CFEventSet set = new CFEventSet(crossfire());
- if(Event.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));
- }
- crossfire().terminate();
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.CLOSED+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_BREAK.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_BREAK+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_SCRIPT.equals(name)) {
- ThreadReference thread = crossfire().findThread(event.getContextId());
- if(thread != null) {
- set.setThread(thread);
- CFScriptReference script = crossfire().addScript(event.getContextId(), event.getBody());
- List scripts = eventmgr.scriptLoadRequests();
- for (Iterator iter = scripts.iterator(); iter.hasNext();) {
- ScriptLoadRequest request = (ScriptLoadRequest) iter.next();
- set.add(new CFScriptLoadEvent(crossfire(), request, thread, script));
- }
- }
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_SCRIPT+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_CONTEXT_CREATED.equals(name)) {
- List threads = eventmgr.threadEnterRequests();
- CFThreadReference thread = crossfire().addThread(event.getContextId(), (String) event.getBody().get(CFThreadReference.HREF));
- for (Iterator iter = threads.iterator(); iter.hasNext();) {
- ThreadEnterRequest request = (ThreadEnterRequest) iter.next();
- set.add(new CFThreadEnterEvent(crossfire(), request, thread));
- }
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_CONTEXT_CREATED+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_CONTEXT_DESTROYED.equals(name)) {
- ThreadReference thread = crossfire().findThread(event.getContextId());
- crossfire().removeThread(event.getContextId());
- if(thread != null) {
- List threads = eventmgr.threadExitRequests();
- for (Iterator iter = threads.iterator(); iter.hasNext();) {
- ThreadExitRequest request = (ThreadExitRequest) iter.next();
- set.add(new CFThreadExitEvent(crossfire(), request, thread));
- }
- }
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_CONTEXT_DESTROYED+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_CONSOLE_DEBUG.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_CONSOLE_DEBUG+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_CONSOLE_ERROR.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_CONSOLE_ERROR+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_CONSOLE_INFO.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_CONSOLE_INFO+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_CONSOLE_LOG.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_CONSOLE_LOG+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_CONSOLE_WARN.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_CONSOLE_WARN+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_INSPECT_NODE.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_INSPECT_NODE+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_RESUME.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_RESUME+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if(Event.ON_TOGGLE_BREAKPOINT.equals(name)) {
- if(TRACE) {
- Tracing.writeString("QUEUE: [event - "+Event.ON_TOGGLE_BREAKPOINT+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else {
- if(TRACE) {
- Tracing.writeString("QUEUE: [unknown event - "+name+"] "+JSON.serialize(event)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- if (set.isEmpty()) {
- set.resume();
- continue;
- }
- return set;
- }
- }
- catch(DisconnectedException de) {
- crossfire().disconnectVM();
- handleException(de.getMessage(), de);
- }
- catch(TimeoutException te) {
- CrossFirePlugin.log(te);
- }
- return null;
- }
-
- /**
- * Flushes and cleans up the queue
- */
- public void dispose() {
- disposed = true;
- }
-
- /**
- * Turns on / off tracing in the event queue
- * @param tracing
- */
- public static void setTracing(boolean tracing) {
- TRACE = tracing;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEventSet.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEventSet.java
deleted file mode 100644
index f1d2a90..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFEventSet.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.event;
-
-import java.util.HashSet;
-
-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.EventSet;
-
-/**
- * Default implementation of {@link EventSet} for Crossfire
- *
- * @since 1.0
- */
-public class CFEventSet extends HashSet implements EventSet {
-
- private VirtualMachine vm = null;
- private ThreadReference thread = null;
-
- /**
- * Constructor
- * @param vm
- */
- public CFEventSet(VirtualMachine vm) {
- this.vm = vm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.EventSet#suspended()
- */
- public boolean suspended() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.EventSet#resume()
- */
- public void resume() {
- if(thread != null) {
- thread.resume();
- }
- else {
- vm.resume();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Mirror#virtualMachine()
- */
- public VirtualMachine virtualMachine() {
- return vm;
- }
-
- /**
- * Sets the thread context for the set
- * @param thread
- */
- public void setThread(ThreadReference thread) {
- this.thread = thread;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFLocatableEvent.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFLocatableEvent.java
deleted file mode 100644
index 4299cf9..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFLocatableEvent.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.LocatableEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-
-/**
- * Default implementation of {@link LocatableEvent} for Crossfire
- *
- * @sicne 1.0
- */
-public class CFLocatableEvent extends CFEvent implements LocatableEvent {
-
- private ThreadReference thread = null;
- private Location location = null;
-
- /**
- * Constructor
- * @param vm
- * @param request
- */
- public CFLocatableEvent(VirtualMachine vm, EventRequest request, ThreadReference thread, Location location) {
- super(vm, request);
- this.thread = thread;
- this.location = location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Locatable#location()
- */
- public Location location() {
- return location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.LocatableEvent#thread()
- */
- public ThreadReference thread() {
- return thread;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFScriptLoadEvent.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFScriptLoadEvent.java
deleted file mode 100644
index ada21e5..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFScriptLoadEvent.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.event;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference;
-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.ScriptLoadEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-
-/**
- * Default implementation of {@link ScriptLoadEvent} for Crossfire
- *
- * @since 1.0
- */
-public class CFScriptLoadEvent extends CFLocatableEvent implements ScriptLoadEvent {
-
- private ScriptReference script = null;
-
- /**
- * Constructor
- * @param vm
- * @param request
- */
- public CFScriptLoadEvent(VirtualMachine vm, EventRequest request, ThreadReference thread, ScriptReference script) {
- super(vm, request, thread, null);
- this.script = script;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.ScriptLoadEvent#script()
- */
- public ScriptReference script() {
- return script;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFThreadEnterEvent.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFThreadEnterEvent.java
deleted file mode 100644
index 9ba26c9..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFThreadEnterEvent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.event;
-
-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.ThreadEnterEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-
-/**
- * Default implementation of {@link ThreadEnterEvent} for Crossfire
- *
- * @since 1.0
- */
-public class CFThreadEnterEvent extends CFLocatableEvent implements ThreadEnterEvent {
-
- /**
- * Constructor
- * @param vm
- * @param request
- * @param thread
- */
- public CFThreadEnterEvent(VirtualMachine vm, EventRequest request, ThreadReference thread) {
- super(vm, request, thread, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFThreadExitEvent.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFThreadExitEvent.java
deleted file mode 100644
index e0052fb..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFThreadExitEvent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.event;
-
-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.ThreadExitEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-
-/**
- * Default implementation of {@link ThreadExitEvent} for Crossfire
- *
- * @since 1.0
- */
-public class CFThreadExitEvent extends CFLocatableEvent implements ThreadExitEvent {
-
- /**
- * Constructor
- * @param vm
- * @param request
- * @param thread
- */
- public CFThreadExitEvent(VirtualMachine vm, EventRequest request, ThreadReference thread) {
- super(vm, request, thread, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFVMDeathEvent.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFVMDeathEvent.java
deleted file mode 100644
index feef5ef..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/event/CFVMDeathEvent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.VMDeathEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-
-/**
- * Default implementation of a {@link VMDeathEvent} for Crossfire
- *
- * @since 1.0
- */
-public class CFVMDeathEvent extends CFEvent implements VMDeathEvent {
-
- /**
- * Constructor
- * @param vm
- * @param request
- */
- public CFVMDeathEvent(VirtualMachine vm, EventRequest request) {
- super(vm, request);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFBooleanValue.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFBooleanValue.java
deleted file mode 100644
index e27ea20..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFBooleanValue.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.BooleanValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Default implementation of a {@link BooleanValue} for Crossfire
- *
- * @since 1.0
- */
-public class CFBooleanValue extends CFMirror implements BooleanValue {
-
- private boolean bool = false;
-
- /**
- * Constructor
- *
- * @param vm
- * @param bool the underlying boolean value
- */
- public CFBooleanValue(VirtualMachine vm, boolean bool) {
- super(vm);
- this.bool = bool;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#intValue()
- */
- public int intValue() {
- return (bool ? 1 : 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#doubleValue()
- */
- public double doubleValue() {
- return (bool ? 1 : 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#booleanValue()
- */
- public boolean booleanValue() {
- return bool;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#stringValue()
- */
- public String stringValue() {
- return Boolean.toString(bool);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return stringValue();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return stringValue();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFEventRequestManager.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFEventRequestManager.java
deleted file mode 100644
index a90c2b0..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFEventRequestManager.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-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.request.BreakpointRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.DebuggerStatementRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ExceptionRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ScriptLoadRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.StepRequest;
-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.core.jsdi.request.VMDisconnectRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFBreakpointRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFDeathRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFDebuggerRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFDisconnectRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFExceptionRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFScriptLoadRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFStepRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFSuspendRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFThreadEnterRequest;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.request.CFThreadExitRequest;
-
-/**
- * Default {@link EventRequestManager} for Crossfire
- *
- * @since 1.0
- */
-public class CFEventRequestManager implements EventRequestManager {
-
- private List threadexits = Collections.synchronizedList(new ArrayList(4));
- private List threadenters = Collections.synchronizedList(new ArrayList(4));
- private List breakpoints = Collections.synchronizedList(new ArrayList(4));
- private List debuggers = Collections.synchronizedList(new ArrayList(4));
- private List exceptions = Collections.synchronizedList(new ArrayList(4));
- private List loads = Collections.synchronizedList(new ArrayList(4));
- private List steps = Collections.synchronizedList(new ArrayList(4));
- private List suspends = Collections.synchronizedList(new ArrayList(4));
- private List disconnects = Collections.synchronizedList(new ArrayList(4));
- private List deaths = Collections.synchronizedList(new ArrayList(4));
-
- private HashMap kind = new HashMap(10);
-
- private VirtualMachine vm = null;
-
- /**
- * Constructor
- *
- * @param vm
- */
- public CFEventRequestManager(VirtualMachine vm) {
- this.vm = vm;
- kind.put(CFBreakpointRequest.class, breakpoints);
- kind.put(CFDebuggerRequest.class, debuggers);
- kind.put(CFExceptionRequest.class, exceptions);
- kind.put(CFScriptLoadRequest.class, loads);
- kind.put(CFStepRequest.class, steps);
- kind.put(CFSuspendRequest.class, suspends);
- kind.put(CFThreadEnterRequest.class, threadenters);
- kind.put(CFThreadExitRequest.class, threadexits);
- kind.put(CFDisconnectRequest.class, disconnects);
- kind.put(CFDeathRequest.class, deaths);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createBreakpointRequest(org.eclipse.wst.jsdt.debug.core.jsdi.Location)
- */
- public BreakpointRequest createBreakpointRequest(Location location) {
- CFBreakpointRequest request = new CFBreakpointRequest(vm, location);
- request.setEnabled(true);
- breakpoints.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#breakpointRequests()
- */
- public List breakpointRequests() {
- return Collections.unmodifiableList(breakpoints);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createDebuggerStatementRequest()
- */
- public DebuggerStatementRequest createDebuggerStatementRequest() {
- CFDebuggerRequest request = new CFDebuggerRequest(vm);
- request.setEnabled(true);
- debuggers.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#debuggerStatementRequests()
- */
- public List debuggerStatementRequests() {
- return Collections.unmodifiableList(debuggers);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createExceptionRequest()
- */
- public ExceptionRequest createExceptionRequest() {
- CFExceptionRequest request = new CFExceptionRequest(vm);
- request.setEnabled(true);
- exceptions.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#exceptionRequests()
- */
- public List exceptionRequests() {
- return Collections.unmodifiableList(exceptions);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createScriptLoadRequest()
- */
- public ScriptLoadRequest createScriptLoadRequest() {
- CFScriptLoadRequest request = new CFScriptLoadRequest(vm);
- request.setEnabled(true);
- loads.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#scriptLoadRequests()
- */
- public List scriptLoadRequests() {
- return Collections.unmodifiableList(loads);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createStepRequest(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference, int)
- */
- public StepRequest createStepRequest(ThreadReference thread, int step) {
- CFStepRequest request = new CFStepRequest(vm, thread, step);
- request.setEnabled(true);
- steps.add(request);
- return request;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#stepRequests()
- */
- public List stepRequests() {
- return Collections.unmodifiableList(steps);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createSuspendRequest(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public SuspendRequest createSuspendRequest(ThreadReference thread) {
- CFSuspendRequest request = new CFSuspendRequest(vm, thread);
- request.setEnabled(true);
- suspends.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#suspendRequests()
- */
- public List suspendRequests() {
- return Collections.unmodifiableList(suspends);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createThreadEnterRequest()
- */
- public ThreadEnterRequest createThreadEnterRequest() {
- CFThreadEnterRequest request = new CFThreadEnterRequest(vm);
- request.setEnabled(true);
- threadenters.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#threadEnterRequests()
- */
- public List threadEnterRequests() {
- return Collections.unmodifiableList(threadenters);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createThreadExitRequest()
- */
- public ThreadExitRequest createThreadExitRequest() {
- CFThreadExitRequest request = new CFThreadExitRequest(vm);
- request.setEnabled(true);
- threadexits.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#threadExitRequests()
- */
- public List threadExitRequests() {
- return Collections.unmodifiableList(threadexits);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#deleteEventRequest(org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest)
- */
- public void deleteEventRequest(EventRequest eventRequest) {
- List requests = (List) kind.get(eventRequest.getClass());
- if(requests != null) {
- requests.remove(eventRequest);
- eventRequest.setEnabled(false);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#deleteEventRequest(java.util.List)
- */
- public void deleteEventRequest(List eventRequests) {
- for (Iterator iter = eventRequests.iterator(); iter.hasNext();) {
- deleteEventRequest((EventRequest) iter.next());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createVMDeathRequest()
- */
- public VMDeathRequest createVMDeathRequest() {
- CFDeathRequest request = new CFDeathRequest(vm);
- request.setEnabled(true);
- deaths.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#vmDeathRequests()
- */
- public List vmDeathRequests() {
- return Collections.unmodifiableList(deaths);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createVMDisconnectRequest()
- */
- public VMDisconnectRequest createVMDisconnectRequest() {
- CFDisconnectRequest request = new CFDisconnectRequest(vm);
- request.setEnabled(true);
- disconnects.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#vmDisconnectRequests()
- */
- public List vmDisconnectRequests() {
- return Collections.unmodifiableList(disconnects);
- }
-
- /**
- * Cleans up all requests
- */
- public void dispose() {
- for (Iterator iter = kind.keySet().iterator(); iter.hasNext();) {
- List list = (List) kind.get(iter.next());
- list.clear();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFLocation.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFLocation.java
deleted file mode 100644
index e783e98..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFLocation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.Location;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Default implementation of {@link Location} for Crossfire
- *
- * @since 1.0
- */
-public class CFLocation extends CFMirror implements Location {
-
- private CFScriptReference script = null;
- private String function = null;
- private int line = -1;
-
- /**
- * Constructor
- * @param vm
- * @param script
- * @param function
- * @param line
- */
- public CFLocation(VirtualMachine vm, CFScriptReference script, String function, int line) {
- super(vm);
- this.script = script;
- this.function = function;
- this.line = line;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Location#scriptReference()
- */
- public ScriptReference scriptReference() {
- return script;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Location#lineNumber()
- */
- public int lineNumber() {
- return line;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Location#functionName()
- */
- public String functionName() {
- return function;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("LocationImpl: "); //$NON-NLS-1$
- buffer.append("[script - ").append(script.sourceURI()).append("] "); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("[function - ").append(function).append("] "); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("[line - ").append(line).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFMirror.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFMirror.java
deleted file mode 100644
index 675ca56..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFMirror.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.Mirror;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Default implementation for a {@link Mirror} for Crossfire
- *
- * @since 1.0
- */
-public class CFMirror implements Mirror {
-
- private VirtualMachine vm = null;
-
- /**
- * Constructor
- * For use by the {@link CFVirtualMachine} only
- * @noreference This constructor is not intended to be referenced by clients.
- */
- public CFMirror() {
- vm = (VirtualMachine) this;
- }
-
- /**
- * Constructor
- */
- public CFMirror(VirtualMachine vm) {
- this.vm = vm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Mirror#virtualMachine()
- */
- public VirtualMachine virtualMachine() {
- return this.vm;
- }
-
- /**
- * Re-throws the given exception as a {@link RuntimeException} with the given message
- * @param message
- * @param t
- */
- protected void handleException(String message, Throwable t) {
- throw new RuntimeException(message, t);
- }
-
- /**
- * Returns the handle to the {@link CFVirtualMachine}
- *
- * @return the {@link CFVirtualMachine} handle
- */
- protected CFVirtualMachine crossfire() {
- return (CFVirtualMachine) vm;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFNullValue.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFNullValue.java
deleted file mode 100644
index 1ffc40c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFNullValue.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.NullValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Default implementation of the {@link NullValue} for Crossfire
- *
- * @since 1.0
- */
-public class CFNullValue extends CFMirror implements NullValue {
-
- public static final String NULL = "null"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public CFNullValue(VirtualMachine vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return CFNullValue.NULL;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return valueString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFNumberValue.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFNumberValue.java
deleted file mode 100644
index 09e08ce..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFNumberValue.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.NumberValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Default implementation of {@link NumberValue} for Crossfire
- *
- * @since 1.0
- */
-public class CFNumberValue extends CFMirror implements NumberValue {
-
- private Number number = null;
-
- /**
- * Constructor
- * @param vm
- * @param number
- */
- public CFNumberValue(VirtualMachine vm, Number number) {
- super(vm);
- this.number = number;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#intValue()
- */
- public int intValue() {
- return number.intValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#doubleValue()
- */
- public double doubleValue() {
- return number.doubleValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#booleanValue()
- */
- public boolean booleanValue() {
- return number.intValue() > 0 ? true : false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#stringValue()
- */
- public String stringValue() {
- return number.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return stringValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.NumberValue#value()
- */
- public Number value() {
- return number;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.NumberValue#isNaN()
- */
- public boolean isNaN() {
- return number == null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFScriptReference.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFScriptReference.java
deleted file mode 100644
index f8ada77..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFScriptReference.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Location;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.CrossFirePlugin;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Attributes;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Commands;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Response;
-
-/**
- * Default implementation of {@link ScriptReference} for Crossfire
- *
- * @since 1.0
- */
-public class CFScriptReference extends CFMirror implements ScriptReference {
-
- /**
- * The "id" attribute
- */
- public static final String ID = "id"; //$NON-NLS-1$
- /**
- * The "sourceLength" attribute
- */
- public static final String SOURCE_LENGTH = "sourceLength"; //$NON-NLS-1$
- /**
- * The "lineCount" attribute
- */
- public static final String LINE_COUNT = "lineCount"; //$NON-NLS-1$
- /**
- * The "lineOffset" attribute
- */
- public static final String LINE_OFFSET = "lineOffset"; //$NON-NLS-1$
- /**
- * The "columnOffset" attribute
- */
- public static final String COLUMN_OFFSET = "columnOffset"; //$NON-NLS-1$
-
- private String context_id = null;
- private String id = null;
- private int srclength = 0;
- private int linecount = 0;
- private int coloffset = 0;
- private int lineoffset = 0;
- private String source = null;
- private URI sourceuri = null;
-
- private List linelocs = new ArrayList();
-
- /**
- * Constructor
- * @param vm
- * @param context_id
- * @param json
- */
- public CFScriptReference(VirtualMachine vm, String context_id, Map json) {
- super(vm);
- this.context_id = context_id;
- this.id = (String) json.get(ID);
- if(id == null) {
- this.id = (String) json.get(Attributes.DATA);
- }
- Number value = (Number) json.get(SOURCE_LENGTH);
- if(value != null) {
- this.srclength = value.intValue();
- }
- value = (Number) json.get(LINE_COUNT);
- if(value != null) {
- this.linecount = value.intValue();
- }
- value = (Number) json.get(LINE_OFFSET);
- if(value != null) {
- this.lineoffset = value.intValue();
- }
- value = (Number) json.get(COLUMN_OFFSET);
- if(value != null) {
- this.coloffset = value.intValue();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#allLineLocations()
- */
- public List allLineLocations() {
- return Collections.unmodifiableList(linelocs);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#lineLocation(int)
- */
- public Location lineLocation(int lineNumber) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#allFunctionLocations()
- */
- public List allFunctionLocations() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#functionLocation(java.lang.String)
- */
- public Location functionLocation(String functionName) {
- return null;
- }
-
- /**
- * The id of the script
- * @return the id
- */
- public String id() {
- return id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#source()
- */
- public synchronized String source() {
- if(source == null) {
- Request request = new Request(Commands.SOURCE, context_id);
- request.addAdditionalParam(ID, id);
- Response response = crossfire().sendRequest(request);
- if(response.isSuccess()) {
- //source = "//TODO get the actual script source for "+id; //$NON-NLS-1$
- }
- }
- return source;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#sourceURI()
- */
- public synchronized URI sourceURI() {
- if(sourceuri == null) {
- try {
- sourceuri = URI.create(id);
- }
- catch(IllegalArgumentException iae) {
- try {
- sourceuri = CrossFirePlugin.fileURI(new Path(id));
- } catch (URISyntaxException e) {
- CrossFirePlugin.log(e);
- }
- }
- }
- return sourceuri;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("ScriptReference: [context_id - ").append(context_id).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append(" [id - ").append(id).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append(" [srclength - ").append(srclength).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append(" [linecount - ").append(linecount).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append(" [lineoffset - ").append(lineoffset).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append(" [coloffset - ").append(coloffset).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("\nSource: \n").append(source); //$NON-NLS-1$
- return super.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFStackFrame.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFStackFrame.java
deleted file mode 100644
index 04254b0..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFStackFrame.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.Location;
-import org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Value;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Variable;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Default implementation of {@link StackFrame} for Crossfire
- *
- * @since 1.0
- */
-public class CFStackFrame extends CFMirror implements StackFrame {
-
- /**
- * Constructor
- * @param vm
- * @param json
- */
- public CFStackFrame(VirtualMachine vm, Map json) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame#thisObject()
- */
- public Variable thisObject() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame#variables()
- */
- public List variables() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame#location()
- */
- public Location location() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame#evaluate(java.lang.String)
- */
- public Value evaluate(String expression) {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFStringValue.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFStringValue.java
deleted file mode 100644
index dc78af0..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFStringValue.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.StringValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Default implementation of {@link StringValue} for Crossfire
- *
- * @since 1.0
- */
-public class CFStringValue extends CFMirror implements StringValue {
-
- private String string = null;
-
- /**
- * Constructor
- *
- * @param vm
- * @param string
- */
- public CFStringValue(VirtualMachine vm, String string) {
- super(vm);
- this.string = string;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return string;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StringValue#value()
- */
- public String value() {
- return string;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return string;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFThreadReference.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFThreadReference.java
deleted file mode 100644
index 692dc49..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFThreadReference.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Commands;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Response;
-
-/**
- * Default implementation of {@link ThreadReference} for Crossfire
- *
- * @since 1.0
- */
-public class CFThreadReference extends CFMirror implements ThreadReference {
- /**
- * The "crossfire_id" attribute
- */
- public static final String CROSSFIRE_ID = "crossfire_id"; //$NON-NLS-1$
- /**
- * The "href" attribute
- */
- public static final String HREF = "href"; //$NON-NLS-1$
-
- static final int RUNNING = 0;
- static final int SUSPENDED = 1;
- static final int TERMINATED = 2;
-
- private String id = null;
- private String href = null;
- private int state = RUNNING;
- private ArrayList frames = null;
-
-
- /**
- * Constructor
- *
- * @param vm
- * @param id
- * @param href
- */
- public CFThreadReference(VirtualMachine vm, String id, String href) {
- super(vm);
- this.id = id;
- this.href = href;
- }
-
- /**
- * Constructor
- * @param vm
- * @param json
- */
- public CFThreadReference(VirtualMachine vm, Map json) {
- super(vm);
- this.id = (String) json.get(CROSSFIRE_ID);
- this.href = (String) json.get(HREF);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#frameCount()
- */
- public int frameCount() {
- return frames == null ? 0 : frames.size();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#frame(int)
- */
- public synchronized StackFrame frame(int index) {
- if(frames == null || index < 0 || index > frames.size()) {
- return null;
- }
- return (StackFrame) frames.get(index);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#frames()
- */
- public synchronized List frames() {
- //TODO we require some way to batch retrieve the frames from a given context
- //unless there is only ever one frame?
- if(frames == null) {
- frames = new ArrayList();
- Request request = new Request(Commands.FRAME, id);
- Response response = crossfire().sendRequest(request);
- if(response.isSuccess()) {
- frames.add(new CFStackFrame(virtualMachine(), response.getBody()));
- }
- }
- return frames;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#interrupt()
- */
- public void interrupt() {
- try {
-
- }
- finally {
- state = TERMINATED;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#resume()
- */
- public void resume() {
- try {
- if(frames != null) {
- frames.clear();
- frames = null;
- }
- }
- finally {
- state = RUNNING;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#suspend()
- */
- public void suspend() {
- try {
-
- }
- finally {
- state = SUSPENDED;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#status()
- */
- public int status() {
- return THREAD_STATUS_RUNNING;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#isAtBreakpoint()
- */
- public boolean isAtBreakpoint() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#isSuspended()
- */
- public boolean isSuspended() {
- return state == SUSPENDED;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#name()
- */
- public String name() {
- String url = href;
- if(href.length() > 50) {
- url = href.substring(0, 47) + "..."; //$NON-NLS-1$
- }
- return NLS.bind(Messages.thread_name, new Object[] {id, url});
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("ThreadReference: [crossfire_id - ").append(id).append("] [href - ").append(href).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return buffer.toString();
- }
-
- /**
- * Returns the Crossfire id for this thread
- *
- * @return the id
- */
- public String id() {
- return id;
- }
-
- /**
- * Returns the href context for this thread
- *
- * return the href context
- */
- public String href() {
- return href;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFUndefinedValue.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFUndefinedValue.java
deleted file mode 100644
index 945102c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFUndefinedValue.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.UndefinedValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Default implementation for an {@link UndefinedValue} for Crossfire
- *
- * @since 1.0
- */
-public class CFUndefinedValue extends CFMirror implements UndefinedValue {
-
- public static final String UNDEFINED = "undefined"; //$NON-NLS-1$
-
- /**
- * Constructor
- *
- * @param vm
- */
- public CFUndefinedValue(VirtualMachine vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return UNDEFINED;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return valueString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFVirtualMachine.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFVirtualMachine.java
deleted file mode 100644
index 47e3099..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/CFVirtualMachine.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.jsdt.debug.core.jsdi.BooleanValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.NullValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.NumberValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.StringValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.UndefinedValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.core.jsdi.event.EventQueue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.Constants;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.CrossFirePlugin;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.event.CFEventQueue;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Attributes;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Commands;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.DebugSession;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.DisconnectedException;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Event;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Response;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.transport.TimeoutException;
-
-/**
- * Default CrossFire implementation of {@link VirtualMachine}
- *
- * @since 1.0
- */
-public class CFVirtualMachine extends CFMirror implements VirtualMachine {
-
- private final NullValue nullvalue = new CFNullValue(this);
- private final UndefinedValue undefinedvalue = new CFUndefinedValue(this);
-
- private final DebugSession session;
- private final CFEventRequestManager ermanager = new CFEventRequestManager(this);
- private final CFEventQueue queue = new CFEventQueue(this, ermanager);
- private boolean disconnected = false;
-
- private Map threads = null;
- private Map scripts = null;
-
- /**
- * Constructor
- *
- * @param session
- */
- public CFVirtualMachine(DebugSession session) {
- super();
- this.session = session;
- }
-
- /**
- * @return the 'readiness' of the VM - i.e. is it in a state to process requests, etc
- */
- boolean ready() {
- return !disconnected;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#resume()
- */
- public void resume() {
- if(ready()) {
- //TODO make this work
- Response response = sendRequest(new Request(Commands.CONTINUE, null));
- if(response.isSuccess()) {
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#suspend()
- */
- public void suspend() {
- if(ready()) {
- //TODO make this work
- Response response = sendRequest(new Request(Commands.SUSPEND, null));
- if(response.isSuccess()) {
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#terminate()
- */
- public void terminate() {
- if(ready()) {
- disconnectVM();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#name()
- */
- public String name() {
- return NLS.bind(Messages.vm_name, version());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#description()
- */
- public String description() {
- return Messages.crossfire_vm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#version()
- */
- public synchronized String version() {
- if(ready()) {
- Request request = new Request(Commands.VERSION, null);
- Response response = sendRequest(request);
- if(response.isSuccess()) {
- Map json = response.getBody();
- return (String) json.get(Commands.VERSION);
- }
- }
- return Constants.UNKNOWN;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#allThreads()
- */
- public synchronized List allThreads() {
- if(threads == null) {
- threads = new HashMap();
- Request request = new Request(Commands.LISTCONTEXTS, null);
- Response response = sendRequest(request);
- if(response.isSuccess()) {
- List contexts = (List) response.getBody().get(Attributes.CONTEXTS);
- for (Iterator iter = contexts.iterator(); iter.hasNext();) {
- Map json = (Map) iter.next();
- CFThreadReference thread = new CFThreadReference(this, json);
- threads.put(thread.id(), thread);
- }
- }
- }
- return new ArrayList(threads.values());
- }
-
- /**
- * Adds a thread to the listing
- *
- * @param id
- * @param href
- * @return the new thread
- */
- public CFThreadReference addThread(String id, String href) {
- if(threads == null) {
- allThreads();
- }
- CFThreadReference thread = new CFThreadReference(this, id, href);
- threads.put(thread.id(), thread);
- return thread;
- }
-
- /**
- * Removes the thread with the given id
- *
- * @param id the id of the thread to remove
- */
- public void removeThread(String id) {
- if(threads != null) {
- threads.remove(id);
- }
- }
-
- /**
- * Returns the thread with the given id or <code>null</code>
- *
- * @param id
- * @return the thread or <code>null</code>
- */
- public synchronized CFThreadReference findThread(String id) {
- if(threads == null) {
- allThreads();
- }
- return (CFThreadReference) threads.get(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#allScripts()
- */
- public synchronized List allScripts() {
- if(scripts == null) {
- scripts = new HashMap();
- List threads = allThreads();
- for (Iterator iter = threads.iterator(); iter.hasNext();) {
- CFThreadReference thread = (CFThreadReference) iter.next();
- Request request = new Request(Commands.SCRIPTS, thread.id());
- Response response = sendRequest(request);
- if(response.isSuccess()) {
- List scriptz = (List) response.getBody().get(Commands.SCRIPTS);
- for (Iterator iter2 = scriptz.iterator(); iter2.hasNext();) {
- CFScriptReference script = new CFScriptReference(this, thread.id(), (Map) iter2.next());
- scripts.put(script.id(), script);
- }
- }
- }
- }
- return new ArrayList(scripts.values());
- }
-
- /**
- * Adds the given script to the listing
- *
- * @param context_id
- * @param json
- * @return the new script
- */
- public CFScriptReference addScript(String context_id, Map json) {
- if(scripts == null) {
- allScripts();
- }
- CFScriptReference script = new CFScriptReference(this, context_id, json);
- scripts.put(script.id(), script);
- return script;
- }
-
- /**
- * Removes the script with the given id form the listing
- *
- * @param id the script to remove
- */
- public void removeScript(String id) {
- if(scripts != null) {
- scripts.remove(id);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#dispose()
- */
- public synchronized void dispose() {
- try {
- queue.dispose();
- ermanager.dispose();
- }
- finally {
- //fallack in case the VM has been disposed but not disconnected
- disconnectVM();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOfUndefined()
- */
- public UndefinedValue mirrorOfUndefined() {
- return undefinedvalue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOfNull()
- */
- public NullValue mirrorOfNull() {
- return nullvalue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOf(boolean)
- */
- public BooleanValue mirrorOf(boolean bool) {
- return new CFBooleanValue(this, bool);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOf(java.lang.Number)
- */
- public NumberValue mirrorOf(Number number) {
- return new CFNumberValue(this, number);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOf(java.lang.String)
- */
- public StringValue mirrorOf(String string) {
- return new CFStringValue(this, string);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#eventRequestManager()
- */
- public synchronized EventRequestManager eventRequestManager() {
- return ermanager;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#eventQueue()
- */
- public synchronized EventQueue eventQueue() {
- return queue;
- }
-
- /**
- * Receives an {@link Event} from the underlying {@link DebugSession},
- * waiting for the {@link VirtualMachine#DEFAULT_TIMEOUT}.
- *
- * @return the next {@link Event} never <code>null</code>
- * @throws TimeoutException
- * @throws DisconnectedException
- */
- public Event receiveEvent() throws TimeoutException, DisconnectedException {
- return session.receiveEvent(DEFAULT_TIMEOUT);
- }
-
- /**
- * Receives an {@link Event} from the underlying {@link DebugSession},
- * waiting for the {@link VirtualMachine#DEFAULT_TIMEOUT}.
- * @param timeout
- * @return the next {@link Event} never <code>null</code>
- * @throws TimeoutException
- * @throws DisconnectedException
- */
- public Event receiveEvent(int timeout) throws TimeoutException, DisconnectedException {
- return session.receiveEvent(timeout);
- }
-
- /**
- * Sends a request to the underlying {@link DebugSession}, waiting
- * for the {@link VirtualMachine#DEFAULT_TIMEOUT}.
- *
- * @param request
- * @return the {@link Response} for the request
- */
- public Response sendRequest(Request request) {
- try {
- session.sendRequest(request);
- return session.receiveResponse(request.getSequence(), 3000);
- }
- catch(DisconnectedException de) {
- disconnectVM();
- handleException(de.getMessage(), de);
- }
- catch(TimeoutException te) {
- CrossFirePlugin.log(te);
- }
- return Response.FAILED;
- }
-
- /**
- * disconnects the VM
- */
- public synchronized void disconnectVM() {
- if (disconnected) {
- // no-op it is already disconnected
- return;
- }
- try {
- if(threads != null) {
- threads.clear();
- }
- if(scripts != null) {
- scripts.clear();
- }
- this.queue.dispose();
- this.ermanager.dispose();
- this.session.dispose();
- } finally {
- disconnected = true;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/Messages.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/Messages.java
deleted file mode 100644
index de129f0..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/Messages.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.messages"; //$NON-NLS-1$
- public static String crossfire_vm;
- public static String thread_name;
- public static String vm_name;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/messages.properties b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/messages.properties
deleted file mode 100644
index b63696d..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/jsdi/messages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-crossfire_vm=Crossfire VM
-thread_name={0} - {1}
-vm_name=CrossFire VM [version - {0}]
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFBreakpointRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFBreakpointRequest.java
deleted file mode 100644
index 2797401..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFBreakpointRequest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-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.request.BreakpointRequest;
-
-/**
- * Default implementation of {@link BreakpointRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFBreakpointRequest extends CFThreadEventRequest implements BreakpointRequest {
-
- private String condition = null;
- private int hitcount = 0;
- private Location location = null;
-
- /**
- * Constructor
- * @param vm
- * @param location
- */
- public CFBreakpointRequest(VirtualMachine vm, Location location) {
- super(vm);
- this.location = location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Locatable#location()
- */
- public Location location() {
- return location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.BreakpointRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public void addThreadFilter(ThreadReference thread) {
- setThread(thread);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.BreakpointRequest#addConditionFilter(java.lang.String)
- */
- public void addConditionFilter(String condition) {
- this.condition = condition;
- }
-
- /**
- * Returns the {@link String} condition set for this request using {@link #addConditionFilter(String)} or <code>null</code>
- *
- * @return the condition filter or <code>null</code>
- */
- public String getConditionFilter() {
- return condition;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.BreakpointRequest#addHitCountFilter(int)
- */
- public void addHitCountFilter(int hitcount) {
- this.hitcount = hitcount;
- }
-
- /**
- * Returns the hit count set using {@link #addHitCountFilter(int)} or <code>0</code>
- *
- * @return the specified hit count or <code>0</code>
- */
- public int getHitCount() {
- return hitcount;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDeathRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDeathRequest.java
deleted file mode 100644
index ab8bc70..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDeathRequest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.VMDeathRequest;
-
-/**
- * Default implementation of {@link VMDeathRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFDeathRequest extends CFEventRequest implements VMDeathRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public CFDeathRequest(VirtualMachine vm) {
- super(vm);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDebuggerRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDebuggerRequest.java
deleted file mode 100644
index 5b65094..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDebuggerRequest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-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.request.DebuggerStatementRequest;
-
-/**
- * Default implementation of {@link DebuggerStatementRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFDebuggerRequest extends CFThreadEventRequest implements DebuggerStatementRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public CFDebuggerRequest(VirtualMachine vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.DebuggerStatementRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public void addThreadFilter(ThreadReference thread) {
- setThread(thread);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDisconnectRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDisconnectRequest.java
deleted file mode 100644
index 5cf1913..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFDisconnectRequest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.VMDisconnectRequest;
-
-/**
- * Default implementation of {@link VMDisconnectRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFDisconnectRequest extends CFEventRequest implements VMDisconnectRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public CFDisconnectRequest(VirtualMachine vm) {
- super(vm);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFEventRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFEventRequest.java
deleted file mode 100644
index 8d6f89d..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFEventRequest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-
-/**
- * Default {@link EventRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFEventRequest implements EventRequest {
-
- private boolean enabled = false;
- private VirtualMachine vm = null;
-
- /**
- * Constructor
- */
- public CFEventRequest(VirtualMachine vm) {
- this.vm = vm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Mirror#virtualMachine()
- */
- public VirtualMachine virtualMachine() {
- return vm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest#isEnabled()
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFExceptionRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFExceptionRequest.java
deleted file mode 100644
index 9633811..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFExceptionRequest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-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.request.ExceptionRequest;
-
-/**
- * Default implementation of {@link ExceptionRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFExceptionRequest extends CFThreadEventRequest implements ExceptionRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public CFExceptionRequest(VirtualMachine vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.ExceptionRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public void addThreadFilter(ThreadReference thread) {
- setThread(thread);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFScriptLoadRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFScriptLoadRequest.java
deleted file mode 100644
index 6d3bc91..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFScriptLoadRequest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ScriptLoadRequest;
-
-/**
- * Default implementation of {@link ScriptLoadRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFScriptLoadRequest extends CFEventRequest implements ScriptLoadRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public CFScriptLoadRequest(VirtualMachine vm) {
- super(vm);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFStepRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFStepRequest.java
deleted file mode 100644
index 34180a7..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFStepRequest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-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.request.StepRequest;
-
-/**
- * Default implementation of {@link StepRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFStepRequest extends CFThreadEventRequest implements StepRequest {
-
- private int stepkind = 0;
-
- /**
- * Constructor
- * @param vm
- */
- public CFStepRequest(VirtualMachine vm, ThreadReference thread, int step) {
- super(vm);
- setThread(thread);
- this.stepkind = step;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.StepRequest#step()
- */
- public int step() {
- return stepkind;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFSuspendRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFSuspendRequest.java
deleted file mode 100644
index 62fd7f6..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFSuspendRequest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-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.request.SuspendRequest;
-
-/**
- * Default implementation of {@link SuspendRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFSuspendRequest extends CFThreadEventRequest implements SuspendRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public CFSuspendRequest(VirtualMachine vm, ThreadReference thread) {
- super(vm);
- setThread(thread);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadEnterRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadEnterRequest.java
deleted file mode 100644
index 25b3cb5..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadEnterRequest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-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.request.ThreadEnterRequest;
-
-/**
- * Default implementation of {@link ThreadEnterRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFThreadEnterRequest extends CFThreadEventRequest implements ThreadEnterRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public CFThreadEnterRequest(VirtualMachine vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadEnterRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public void addThreadFilter(ThreadReference thread) {
- setThread(thread);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadEventRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadEventRequest.java
deleted file mode 100644
index c44ce0b..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadEventRequest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Abstract notion of an event that knows about a thread
- *
- * @since 1.0
- */
-public class CFThreadEventRequest extends CFEventRequest {
-
- private ThreadReference thread = null;
-
- /**
- * Constructor
- * @param vm
- */
- public CFThreadEventRequest(VirtualMachine vm) {
- super(vm);
- }
-
- /**
- * Sets the backing {@link ThreadReference} for the request
- * @param thread
- */
- public void setThread(ThreadReference thread) {
- this.thread = thread;
- }
-
- /**
- * Returns the underlying {@link ThreadReference} this request is filtered to.
- * @return the thread filter
- */
- public ThreadReference thread() {
- return this.thread;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadExitRequest.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadExitRequest.java
deleted file mode 100644
index a9434bf..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/request/CFThreadExitRequest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.request;
-
-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.request.ThreadExitRequest;
-
-/**
- * Default implementation of {@link ThreadExitRequest} for Crossfire
- *
- * @since 1.0
- */
-public class CFThreadExitRequest extends CFThreadEventRequest implements ThreadExitRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public CFThreadExitRequest(VirtualMachine vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadExitRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public void addThreadFilter(ThreadReference thread) {
- setThread(thread);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Attributes.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Attributes.java
deleted file mode 100644
index 35355a1..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Attributes.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-/**
- * Interface for all the attribute constants
- *
- * @since 1.0
- */
-public interface Attributes {
-
- /**
- * The "arguments" attribute
- */
- public static final String ARGUMENTS = "arguments"; //$NON-NLS-1$
- /**
- * The "body" attribute
- */
- public static final String BODY = "body"; //$NON-NLS-1$
- /**
- * The "command" attribute
- */
- public static final String COMMAND = "command"; //$NON-NLS-1$
- /**
- * The "context_id" attribute
- */
- public static final String CONTEXT_ID = "context_id"; //$NON-NLS-1$
- /**
- * The "contexts" attribute
- */
- public static final String CONTEXTS = "contexts"; //$NON-NLS-1$
- /**
- * The "data" attribute
- */
- public static final String DATA = "data"; //$NON-NLS-1$
- /**
- * The "handshake" attribute
- */
- public static final String HANDSHAKE = "handshake"; //$NON-NLS-1$
- /**
- * The message attribute for this packet
- */
- public static final String MESSAGE = "message"; //$NON-NLS-1$
- /**
- * The "request_seq" attribute
- */
- public static final String REQUEST_SEQ = "request_seq"; //$NON-NLS-1$
- /**
- * The running attribute for this packet
- */
- public static final String RUNNING = "running"; //$NON-NLS-1$
- /**
- * The "seq" attribute
- */
- public static final String SEQ = "seq"; //$NON-NLS-1$
- /**
- * The success attribute for this packet
- */
- public static final String SUCCESS = "success"; //$NON-NLS-1$
- /**
- * The "type" attribute
- */
- public static final String TYPE = "type"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Commands.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Commands.java
deleted file mode 100644
index 84ebe4c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Commands.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-/**
- * Interface for all the command constants
- *
- * @since 1.0
- */
-public interface Commands {
-
- /**
- * The "backtrace" command
- */
- public static final String BACKTRACE = "backtrace"; //$NON-NLS-1$
- /**
- * The "changebreakpoint" command
- */
- public static final String CHANGE_BREAKPOINT = "changebreakpoint"; //$NON-NLS-1$
- /**
- * The "clearbreakpoint" command
- */
- public static final String CLEAR_BREAKPOINT = "clearbreakpoint"; //$NON-NLS-1$
- /**
- * The "continue" command
- */
- public static final String CONTINUE = "continue"; //$NON-NLS-1$
- /**
- * The "evaluate" command
- */
- public static final String EVALUATE = "evaluate"; //$NON-NLS-1$
- /**
- * The "frame" command
- */
- public static final String FRAME = "frame"; //$NON-NLS-1$
- /**
- * The "getbreakpoint" command
- */
- public static final String GET_BREAKPOINT = "getbreakpoint"; //$NON-NLS-1$
- /**
- * The "getbreakpoints" command
- */
- public static final String GET_BREAKPOINTS = "getbreakpoints"; //$NON-NLS-1$
- /**
- * The "inspect" command
- */
- public static final String INSPECT = "inspect"; //$NON-NLS-1$
- /**
- * The "listcontexts" command
- */
- public static final String LISTCONTEXTS = "listcontexts"; //$NON-NLS-1$
- /**
- * The "lookup" command
- */
- public static final String LOOKUP = "lookup"; //$NON-NLS-1$
- /**
- * The "scopes" command
- */
- public static final String SCOPES = "scopes"; //$NON-NLS-1$
- /**
- * The "scripts" command
- */
- public static final String SCRIPTS = "scripts"; //$NON-NLS-1$
- /**
- * The "setbreakpoint" command
- */
- public static final String SET_BREAKPOINT = "setbreakpoint"; //$NON-NLS-1$
- /**
- * The "source" command
- */
- public static final String SOURCE = "source"; //$NON-NLS-1$
- /**
- * The "suspend" command
- */
- public static final String SUSPEND = "suspend"; //$NON-NLS-1$
- /**
- * The "version" command
- */
- public static final String VERSION = "version"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Connection.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Connection.java
deleted file mode 100644
index e638a07..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Connection.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.io.IOException;
-
-
-/**
- * Describes a socket connection to a debugger
- *
- * @since 1.0
- */
-public interface Connection {
-
- /**
- * Returns if the debug connection is open.
- *
- * @return <code>true</code> if the connection is open <code>false</code> otherwise
- */
- public abstract boolean isOpen();
-
- /**
- * Closes the connection.
- *
- * @throws IOException if the connection failed to close or is already closed
- */
- public abstract void close() throws IOException;
-
- /**
- * Writes the given packet to the connection
- *
- * @param packet the packet to write, <code>null</code> is not accepted
- * @throws IOException if the write failed
- */
- public abstract void writePacket(Packet packet) throws IOException;
-
- /**
- * Reads the next packet from the connection. This is non-blocking.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the next {@link Packet} from the connection
- * @throws IOException if the connection is prematurely closed or the read failed
- */
- public abstract Packet readPacket() throws IOException;
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/DebugSession.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/DebugSession.java
deleted file mode 100644
index 0c3e69a..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/DebugSession.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import org.eclipse.wst.jsdt.debug.internal.crossfire.Tracing;
-
-
-/**
- * A {@link DebugSession} controls a {@link PacketSendManager} and {@link PacketReceiveManager}
- * that is uses to communicate to a debug target using the underlying {@link Connection}
- *
- * @since 1.0
- */
-public class DebugSession {
-
- /**
- * The default receive manager
- */
- private final PacketReceiveManager packetReceiveManager;
- /**
- * The default send manager
- */
- private final PacketSendManager packetSendManager;
-
- /**
- * Constructor
- *
- * Starts the send / receive managers on the given connection.
- *
- * @param connection
- */
- public DebugSession(Connection connection) {
- packetReceiveManager = new PacketReceiveManager(connection);
- Thread receiveThread = new Thread(packetReceiveManager, "Debug Session - Receive Manager"); //$NON-NLS-1$
- receiveThread.setDaemon(true);
-
- packetSendManager = new PacketSendManager(connection);
- Thread sendThread = new Thread(packetSendManager, "Debug Session - Send Manager"); //$NON-NLS-1$
- sendThread.setDaemon(true);
-
- packetReceiveManager.setPartnerThread(sendThread);
- packetSendManager.setPartnerThread(receiveThread);
-
- receiveThread.start();
- sendThread.start();
- }
-
- /**
- * Stops the debug sessions and disconnects the send / receive managers
- */
- public void dispose() {
- packetReceiveManager.disconnect();
- packetSendManager.disconnect();
- }
-
- /**
- * Sends the given {@link Request} using the underlying {@link PacketSendManager}.
- *
- * @param request the request to send, <code>null</code> is not accepted
- * @throws DisconnectedException if the {@link PacketSendManager} has been disconnected
- */
- public void sendRequest(Request request) throws DisconnectedException {
- if(request == null) {
- throw new IllegalArgumentException("You cannot send a null request"); //$NON-NLS-1$
- }
- if(Packet.TRACE) {
- Tracing.writeString("SEND REQUEST: "+request); //$NON-NLS-1$
- }
- packetSendManager.sendPacket(request);
- }
-
- /**
- * Sends the given {@link Event} using the underlying {@link PacketSendManager}.
- *
- * @param event the event to send, <code>null</code> is not accepted
- * @throws DisconnectedException if the {@link PacketSendManager} has been disconnected
- */
- public void sendEvent(Event event) throws DisconnectedException {
- if(event == null) {
- throw new IllegalArgumentException("You cannot send a null event"); //$NON-NLS-1$
- }
- if(Packet.TRACE) {
- Tracing.writeString("SEND EVENT: "+event); //$NON-NLS-1$
- }
- packetSendManager.sendPacket(event);
- }
-
- /**
- * Sends the given {@link Response} using the underlying {@link PacketSendManager}.
- *
- * @param response the response to send, <code>null</code> is not accepted
- * @throws DisconnectedException if the {@link PacketSendManager} has been disconnected
- */
- public void sendResponse(Response response) throws DisconnectedException {
- if(response == null) {
- throw new IllegalArgumentException("You cannot send a null response"); //$NON-NLS-1$
- }
- if(Packet.TRACE) {
- Tracing.writeString("SEND RESPONSE: "+response); //$NON-NLS-1$
- }
- packetSendManager.sendPacket(response);
- }
-
- /**
- * Waits for the given timeout for a {@link Response} response in the given sequence
- * from the {@link PacketReceiveManager}.<br>
- * <br>
- * This method does not return <code>null</code> - one of the listed exceptions will be thrown
- * if an {@link Response} cannot be returned.
- *
- * @param timeout the amount of time in milliseconds to wait to a {@link Response}
- * @return a new {@link Request} from the {@link PacketReceiveManager} never <code>null</code>
- * @throws TimeoutException if the timeout lapses with no {@link Response} returned
- * @throws DisconnectedException if the {@link PacketReceiveManager} has been disconnected
- */
- public Response receiveResponse(int requestSequence, int timeout) throws TimeoutException, DisconnectedException {
- Response response = packetReceiveManager.getResponse(requestSequence, timeout);
- if(Packet.TRACE) {
- Tracing.writeString("REC RESPONSE: "+response); //$NON-NLS-1$
- }
- return response;
- }
-
- /**
- * Waits for the given timeout for a {@link Event} response from the {@link PacketReceiveManager}.<br>
- * <br>
- * This method does not return <code>null</code> - one of the listed exceptions will be thrown
- * if an {@link Event} cannot be returned.
- *
- * @param timeout the amount of time in milliseconds to wait to a {@link Event}
- * @return a new {@link Request} from the {@link PacketReceiveManager} never <code>null</code>
- * @throws TimeoutException if the timeout lapses with no {@link Event} returned
- * @throws DisconnectedException if the {@link PacketReceiveManager} has been disconnected
- */
- public Event receiveEvent(int timeout) throws TimeoutException, DisconnectedException {
- Event event = (Event) packetReceiveManager.getCommand(Event.EVENT, timeout);
- if(Packet.TRACE) {
- Tracing.writeString("REC EVENT: "+event); //$NON-NLS-1$
- }
- return event;
- }
-
- /**
- * Waits for the given timeout for a request response from the {@link PacketReceiveManager}.<br>
- * <br>
- * This method does not return <code>null</code> - one of the listed exceptions will be thrown
- * if a {@link Request} cannot be returned.
- *
- * @param timeout the amount of time in milliseconds to wait to a {@link Request}
- * @return a new {@link Request} from the {@link PacketReceiveManager} never <code>null</code>
- * @throws TimeoutException if the timeout lapses with no {@link Request} returned
- * @throws DisconnectedException if the {@link PacketReceiveManager} has been disconnected
- */
- public Request receiveRequest(int timeout) throws TimeoutException, DisconnectedException {
- Request request = (Request) packetReceiveManager.getCommand(Request.REQUEST, timeout);
- if(Packet.TRACE) {
- Tracing.writeString("REC REQUEST: "+request); //$NON-NLS-1$
- }
- return request;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/DisconnectedException.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/DisconnectedException.java
deleted file mode 100644
index d029db4..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/DisconnectedException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-
-/**
- * A {@link DisconnectedException} is thrown by either of the {@link PacketSendManager}
- * or {@link PacketReceiveManager} when a request is made and they have been disconnected
- *
- * @since 1.0
- */
-public final class DisconnectedException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 3233213787459625769L;
-
- /**
- * Constructor
- *
- * @param message
- * @param exception
- */
- public DisconnectedException(String message, Exception exception) {
- super(message, exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Event.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Event.java
deleted file mode 100644
index 795fe97..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Event.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * An {@link Event} is a specialized {@link Packet}
- * that only handles <code>event</code> data.
- *
- * @since 1.0
- */
-public class Event extends Packet {
-
- /**
- * The type of this packet
- */
- public static final String EVENT = "event"; //$NON-NLS-1$
- /**
- * The "closed" event kind
- */
- public static final String CLOSED = "closed"; //$NON-NLS-1$
- /**
- * The "onScript" event kind
- */
- public static final String ON_SCRIPT = "onScript"; //$NON-NLS-1$
- /**
- * The "onBreak" event kind
- */
- public static final String ON_BREAK = "onBreak"; //$NON-NLS-1$
- /**
- * The "onConsoleDebug" event kind
- */
- public static final String ON_CONSOLE_DEBUG = "onConsoleDebug"; //$NON-NLS-1$
- /**
- * The "onConsoleError" event kind
- */
- public static final String ON_CONSOLE_ERROR = "onConsoleError"; //$NON-NLS-1$
- /**
- * The "onConsoleInfo" event kind
- */
- public static final String ON_CONSOLE_INFO = "onConsoleInfo"; //$NON-NLS-1$
- /**
- * The "onConsoleLog" event kind
- */
- public static final String ON_CONSOLE_LOG = "onConsoleLog"; //$NON-NLS-1$
- /**
- * The "onConsoleWarn" event kind
- */
- public static final String ON_CONSOLE_WARN = "onConsoleWarn"; //$NON-NLS-1$
- /**
- * The "onInspectNode" event kind
- */
- public static final String ON_INSPECT_NODE = "onInspectNode"; //$NON-NLS-1$
- /**
- * The "onResume" event kind
- */
- public static final String ON_RESUME = "onResume"; //$NON-NLS-1$
- /**
- * The "onToggleBreakpoint" event kind
- */
- public static final String ON_TOGGLE_BREAKPOINT = "onToggleBreakpoint"; //$NON-NLS-1$
- /**
- * The "onContextCreated" event kind
- */
- public static final String ON_CONTEXT_CREATED = "onContextCreated"; //$NON-NLS-1$
- /**
- * The "onContextDestroyed" event kind
- */
- public static final String ON_CONTEXT_DESTROYED = "onContextDestroyed"; //$NON-NLS-1$
-
- private final String event;
- private final Map body = Collections.synchronizedMap(new HashMap());
-
- /**
- * Constructor
- * @param event
- */
- public Event(String event) {
- super(EVENT, null);
- this.event = event.intern();
- }
-
- /**
- * Constructor
- * @param json
- */
- public Event(Map json) {
- super(json);
- String packetEvent = (String) json.get(EVENT);
- event = packetEvent.intern();
- Object data = json.get(Attributes.DATA);
- if(data instanceof Map) {
- body.putAll((Map) data);
- }
- if(data instanceof String) {
- body.put(Attributes.DATA, data);
- }
- }
-
- /**
- * Returns the underlying event data
- * @return the event data
- */
- public String getEvent() {
- return event;
- }
-
- /**
- * Returns the underlying body of the event packet
- * @return the body of the packet
- */
- public Map getBody() {
- return body;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet#toJSON()
- */
- public Map toJSON() {
- Map json = super.toJSON();
- json.put(EVENT, event);
- json.put(Attributes.BODY, body);
- return json;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- Object json = toJSON();
- buffer.append("Event: "); //$NON-NLS-1$
- JSON.writeValue(json, buffer);
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/HandShake.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/HandShake.java
deleted file mode 100644
index f0628c7..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/HandShake.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * {@link Packet} for replying to the Crossfire handshake request
- *
- * @since 1.0
- */
-public class HandShake extends Packet {
-
- /**
- * handshake
- */
- private static String CROSSFIRE_HANDSHAKE;
- static {
- String hs = "CrossfireHandshake\r\n"; //$NON-NLS-1$
- try {
- CROSSFIRE_HANDSHAKE = new String(hs.getBytes(), "utf-8"); //$NON-NLS-1$
- } catch (UnsupportedEncodingException e) {
- CROSSFIRE_HANDSHAKE = hs;
- }
- }
-
- /**
- * Constructor
- * @param type
- */
- protected HandShake() {
- super(Response.RESPONSE, null);
- }
-
- /**
- * @return the handshake
- */
- public static String getHandshake() {
- return CROSSFIRE_HANDSHAKE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Packet#toString()
- */
- public String toString() {
- return CROSSFIRE_HANDSHAKE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.crossfire.transport.Packet#toJSON()
- */
- public Map toJSON() {
- Map json = new HashMap(1);
- json.put(Attributes.HANDSHAKE, CROSSFIRE_HANDSHAKE);
- return json;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/JSON.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/JSON.java
deleted file mode 100644
index e1f1e2c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/JSON.java
+++ /dev/null
@@ -1,527 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.math.BigDecimal;
-import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.internal.crossfire.Tracing;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFNullValue;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.jsdi.CFUndefinedValue;
-
-/**
- * Class for reading / writing JSON objects
- * <br><br>
- * Crossfire has the following types:
- * <ul>
- * <li>object</li>
- * <li>function</li>
- * <li>boolean</li>
- * <li>number</li>
- * <li>string</li>
- * <li>undefined</li>
- * <li>ref</li>
- * </ul>
- * @since 1.0
- */
-public final class JSON {
-
- /**
- * Standard line feed / control feed terminus for Crossfire packets
- */
- public static final String LINE_FEED = "\r\n"; //$NON-NLS-1$
- /**
- * The default <code>Content-Length:</code> pre-amble
- */
- public static final String CONTENT_LENGTH = "Content-Length:"; //$NON-NLS-1$
-
- /**
- * Constructor
- *
- * No instantiation
- */
- private JSON() {}
-
- /**
- * Writes the given key / value pair to the buffer in the form: <code>"key":["]value["]</code>
- *
- * @param key
- * @param value
- * @param buffer
- */
- public static void writeKeyValue(String key, Object value, StringBuffer buffer) {
- writeString(key, buffer);
- buffer.append(':');
- writeValue(value, buffer);
- }
-
- /**
- * Writes out the given value to the buffer. <br><br>
- * Values are written out as:
- * <ul>
- * <li>Boolean / Number: <code>value.toString()</code></li>
- * <li>String: <code>"value"</code></li>
- * <li>null: <code>null</code>
- * <li>Collection: <code>[{@link #writeValue(Object, StringBuffer)},...]</code></li>
- * <li>Map: <code>{"key":{@link #writeValue(Object, StringBuffer)},...}</code></li>
- * </ul>
- *
- * @param value
- * @param buffer
- */
- public static void writeValue(Object value, StringBuffer buffer) {
- if (value == null) {
- buffer.append(CFNullValue.NULL);
- }
- else if (value instanceof Boolean || value instanceof Number) {
- buffer.append(value.toString());
- }
- else if (value instanceof String) {
- writeString((String) value, buffer);
- }
- else if(value instanceof Collection) {
- writeArray((Collection) value, buffer);
- }
- else if(value instanceof Map) {
- writeObject((Map) value, buffer);
- }
- }
-
- /**
- * Writes the given {@link String} into the given {@link StringBuffer} properly escaping
- * all control characters
- *
- * @param string
- * @param buffer
- */
- public static void writeString(String string, StringBuffer buffer) {
- buffer.append('"');
- int length = string.length();
- for (int i = 0; i < length; i++) {
- char c = string.charAt(i);
- switch (c) {
- case '"' :
- case '\\' :
- case '/' : {
- buffer.append('\\');
- buffer.append(c);
- break;
- }
- case '\b' : {
- buffer.append("\\b"); //$NON-NLS-1$
- break;
- }
- case '\f' : {
- buffer.append("\\f"); //$NON-NLS-1$
- break;
- }
- case '\n' : {
- buffer.append("\\n"); //$NON-NLS-1$
- break;
- }
- case '\r' : {
- buffer.append("\\r"); //$NON-NLS-1$
- break;
- }
- case '\t' : {
- buffer.append("\\t"); //$NON-NLS-1$
- break;
- }
- default :
- if (Character.isISOControl(c)) {
- buffer.append("\\u"); //$NON-NLS-1$
- String hexString = Integer.toHexString(c);
- for (int j = hexString.length(); j < 4; j++) {
- buffer.append('0');
- }
- buffer.append(hexString);
- } else {
- buffer.append(c);
- }
- }
- }
- buffer.append('"');
- }
-
- /**
- * Writes the given collection into an array string of the form: <code>[{@link #writeValue(Object, StringBuffer)},...]</code>
- *
- * @param collection
- * @param buffer
- */
- static void writeArray(Collection collection, StringBuffer buffer) {
- buffer.append('[');
- for (Iterator iterator = collection.iterator(); iterator.hasNext();) {
- writeValue(iterator.next(), buffer);
- if(iterator.hasNext()) {
- buffer.append(',');
- }
- }
- buffer.append(']');
- }
-
- /**
- * Writes an object mapping to the given buffer in the form: <code>{"key":{@link #writeValue(Object, StringBuffer)},...}</code>
- *
- * @param map
- * @param buffer
- */
- public static void writeObject(Map map, StringBuffer buffer) {
- buffer.append('{');
- for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
- String key = (String) iterator.next();
- writeString(key, buffer);
- buffer.append(':');
- writeValue(map.get(key), buffer);
- if(iterator.hasNext()) {
- buffer.append(',');
- }
- }
- buffer.append('}');
- }
-
- /**
- * Writes the <code>Content-Length:N</code> pre-amble to the head of the given buffer
- *
- * @param buffer
- * @param length
- */
- public static void writeContentLength(StringBuffer buffer, int length) {
- StringBuffer buff = new StringBuffer(18);
- buff.append(CONTENT_LENGTH).append(length).append(LINE_FEED);
- buffer.insert(0, buff);
- }
-
- /**
- * Serializes the given {@link Packet} to a {@link String}
- *
- * @param packet the packet to serialize
- *
- * @return the serialized {@link String}, never <code>null</code>
- */
- public static String serialize(Packet packet) {
- Object json = packet.toJSON();
- StringBuffer buffer = new StringBuffer();
- writeValue(json, buffer);
- int length = buffer.length();
- buffer.append(LINE_FEED);
- writeContentLength(buffer, length);
- if(Packet.TRACE) {
- Tracing.writeString("SERIALIZE: " + packet.getType() +" packet as "+buffer.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return buffer.toString();
- }
-
- /**
- * Reads and returns a new object from the given json {@link String}. This method
- * will throw an {@link IllegalStateException} if parsing fails.
- *
- * @param jsonString
- * @return the object, never <code>null</code>
- */
- public static Object read(String jsonString) {
- return parse(new StringCharacterIterator(jsonString));
- }
-
- /**
- * Reads and returns a new object form the given {@link CharacterIterator} that corresponds to
- * a properly formatted json string. This method will throw an {@link IllegalStateException} if
- * parsing fails.
- *
- * @param it the {@link CharacterIterator} to parse
- * @return the object, never <code>null</code>
- */
- public static Object parse(CharacterIterator it) {
- parseWhitespace(it);
- Object result = parseValue(it);
- parseWhitespace(it);
- if (it.current() != CharacterIterator.DONE) {
- throw error("should be done", it); //$NON-NLS-1$
- }
- return result;
- }
-
- /**
- * Creates an {@link IllegalStateException} for the given message and iterator
- *
- * @param message the message for the exception
- * @param it the {@link CharacterIterator} to parse
- *
- * @return a new {@link IllegalStateException}
- */
- private static RuntimeException error(String message, CharacterIterator it) {
- return new IllegalStateException("[" + it.getIndex() + "] " + message); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * Chews up whitespace from the iterator
- *
- * @param it the {@link CharacterIterator} to parse
- */
- private static void parseWhitespace(CharacterIterator it) {
- char c = it.current();
- while (Character.isWhitespace(c)) {
- c = it.next();
- }
- }
-
- /**
- * Parses the {@link Object} from the {@link CharacterIterator}. This method
- * delegates to the proper parsing method depending on the current iterator context.
- * This method will throw an {@link IllegalStateException} if parsing fails.
- *
- * @param it the {@link CharacterIterator} to parse
- *
- * @return the new object, never <code>null</code>
- * @see #parseString(CharacterIterator)
- * @see #parseNumber(CharacterIterator)
- * @see #parseArray(CharacterIterator)
- * @see #parseObject(CharacterIterator)
- */
- private static Object parseValue(CharacterIterator it) {
- switch (it.current()) {
- case '{' : {
- return parseObject(it);
- }
- case '[' : {
- return parseArray(it);
- }
- case '"' : {
- return parseString(it);
- }
- case '-' :
- case '0' :
- case '1' :
- case '2' :
- case '3' :
- case '4' :
- case '5' :
- case '6' :
- case '7' :
- case '8' :
- case '9' : {
- return parseNumber(it);
- }
- case 't' : {
- parseText(Boolean.TRUE.toString(), it);
- return Boolean.TRUE;
- }
- case 'f' : {
- parseText(Boolean.FALSE.toString(), it);
- return Boolean.FALSE;
- }
- case 'n' : {
- parseText(CFNullValue.NULL, it);
- return null;
- }
- case 'u': {
- parseText(CFUndefinedValue.UNDEFINED, it);
- return null;
- }
- }
- throw error("Bad JSON starting character '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$;
- }
-
- /**
- * Parses the JSON string from the {@link CharacterIterator}
- *
- * @param it the {@link CharacterIterator} to parse
- * @return the JSON {@link String}, never <code>null</code>
- */
- private static String parseString(CharacterIterator it) {
- char c = it.next();
- if (c == '"') {
- it.next();
- return ""; //$NON-NLS-1$
- }
- StringBuffer buffer = new StringBuffer();
- while (c != '"') {
- if (Character.isISOControl(c)) {
- throw error("illegal iso control character: '" + Integer.toHexString(c) + "'", it); //$NON-NLS-1$ //$NON-NLS-2$);
- }
- if (c == '\\') {
- c = it.next();
- switch (c) {
- case '"' :
- case '\\' :
- case '/' : {
- buffer.append(c);
- break;
- }
- case 'b' : {
- buffer.append('\b');
- break;
- }
- case 'f' : {
- buffer.append('\f');
- break;
- }
- case 'n' : {
- buffer.append('\n');
- break;
- }
- case 'r' : {
- buffer.append('\r');
- break;
- }
- case 't' : {
- buffer.append('\t');
- break;
- }
- case 'u' : {
- StringBuffer unicode = new StringBuffer(4);
- for (int i = 0; i < 4; i++) {
- unicode.append(it.next());
- }
- try {
- buffer.append((char) Integer.parseInt(unicode.toString(), 16));
- } catch (NumberFormatException e) {
- throw error("expected a unicode hex number but was '" + unicode.toString() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$););
- }
- break;
- }
- default : {
- throw error("illegal escape character '" + c + "'", it); //$NON-NLS-1$ //$NON-NLS-2$););
- }
- }
- } else {
- buffer.append(c);
- }
- c = it.next();
- }
- c = it.next();
- return buffer.toString();
- }
-
- /**
- * Parses an {@link Map} object from the iterator or throws an
- * {@link IllegalStateException} if parsing fails.
- *
- * @param it the {@link CharacterIterator} to parse
- * @return a new {@link Map} object, never <code>null</code>
- */
- private static Map parseObject(CharacterIterator it) {
- it.next();
- parseWhitespace(it);
- if (it.current() == '}') {
- it.next();
- return Collections.EMPTY_MAP;
- }
-
- Map map = new HashMap();
- while (true) {
- if (it.current() != '"') {
- throw error("expected a string start '\"' but was '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$
- }
- String key = parseString(it);
- if (map.containsKey(key)) {
- throw error("' already defined" + "key '" + key, it); //$NON-NLS-1$ //$NON-NLS-2$
- }
- parseWhitespace(it);
- if (it.current() != ':') {
- throw error("expected a pair separator ':' but was '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$
- }
- it.next();
- parseWhitespace(it);
- Object value = parseValue(it);
- map.put(key, value);
- parseWhitespace(it);
- if (it.current() == ',') {
- it.next();
- parseWhitespace(it);
- continue;
- }
- if (it.current() != '}') {
- throw error("expected an object close '}' but was '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- }
- it.next();
- return map;
- }
-
- /**
- * Parses an {@link ArrayList} from the given iterator or throws an
- * {@link IllegalStateException} if parsing fails
- *
- * @param it the {@link CharacterIterator} to parse
- * @return a new {@link ArrayList} object never <code>null</code>
- */
- private static List parseArray(CharacterIterator it) {
- it.next();
- parseWhitespace(it);
- if (it.current() == ']') {
- it.next();
- return Collections.EMPTY_LIST;
- }
-
- List list = new ArrayList();
- while (true) {
- Object value = parseValue(it);
- list.add(value);
- parseWhitespace(it);
- if (it.current() == ',') {
- it.next();
- parseWhitespace(it);
- continue;
- }
- if (it.current() != ']') {
- throw error("expected an array close ']' but was '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- }
- it.next();
- return list;
- }
-
- /**
- * @param string
- * @param it
- */
- private static void parseText(String string, CharacterIterator it) {
- int length = string.length();
- char c = it.current();
- for (int i = 0; i < length; i++) {
- if (c != string.charAt(i)) {
- throw error("expected to parse '" + string + "' but character " + (i + 1) + " was '" + c + "'", it); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$;
- }
- c = it.next();
- }
- }
-
- /**
- * Parses a {@link Number} object from the given {@link CharacterIterator}
- *
- * @param it
- * @return a new {@link Number}, never <code>null</code>
- */
- private static Object parseNumber(CharacterIterator it) {
- StringBuffer buffer = new StringBuffer();
- char c = it.current();
- while (Character.isDigit(c) || c == '-' || c == '+' || c == '.' || c == 'e' || c == 'E') {
- buffer.append(c);
- c = it.next();
- }
- try {
- return new BigDecimal(buffer.toString());
- } catch (NumberFormatException e) {
- throw error("expected a number but was '" + buffer.toString() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Packet.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Packet.java
deleted file mode 100644
index ba4278a..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Packet.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Abstract description of a packet for sending / receiving information to the debug client
- * using JSON
- *
- * @since 1.0
- */
-public abstract class Packet {
-
- /**
- * Debugging flag
- */
- public static boolean TRACE = false;
-
- private static int currentSequence = 0;
- private final int sequence;
- private final String type;
- private final String context_id;
-
- /**
- * Constructor
- *
- * @param type the type for the {@link Packet} <code>null</code> is not accepted
- */
- protected Packet(String type, String context_id) {
- if(type == null) {
- throw new IllegalArgumentException("The type for a packet cannot be null"); //$NON-NLS-1$
- }
- this.sequence = nextSequence();
- this.type = type.intern();
- this.context_id = context_id;
- }
-
- /**
- * Constructor
- *
- * @param json the pre-composed map of attributes for the packet, <code>null</code> is not accepted
- */
- protected Packet(Map json) {
- if(json == null) {
- throw new IllegalArgumentException("The JSON map for a packet cannot be null"); //$NON-NLS-1$
- }
- Number packetSeq = (Number) json.get(Attributes.SEQ);
- this.sequence = packetSeq.intValue();
- String packetType = (String) json.get(Attributes.TYPE);
- this.type = packetType.intern();
- this.context_id = (String) json.get(Attributes.CONTEXT_ID);
- }
-
- /**
- * @return a next value for the sequence
- */
- private static synchronized int nextSequence() {
- return ++currentSequence;
- }
-
- /**
- * @return the current sequence
- */
- public int getSequence() {
- return sequence;
- }
-
- /**
- * @return the context id or <code>null</code>
- */
- public String getContextId() {
- return context_id;
- }
-
- /**
- * Returns the type of this packet.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the type, never <code>null</code>
- */
- public String getType() {
- return type;
- }
-
- /**
- * Returns the type and sequence composed in a JSON map.<br>
- * <br>
- * This method cannot return <code>null</code>
- * @return the JSON map
- */
- public Map toJSON() {
- Map json = new HashMap();
- json.put(Attributes.SEQ, new Integer(sequence));
- json.put(Attributes.TYPE, type);
- if(context_id != null) {
- json.put(Attributes.CONTEXT_ID, context_id);
- }
- return json;
- }
-
- /**
- * Returns the type from the given JSON map.<br>
- * <br>
- * This method can return <code>null</code> if the map is not correctly
- * formed.
- *
- * @param json the JSON map, <code>null</code> is not accepted
- * @return the type from the JSON map or <code>null</code>
- */
- public static String getType(Map json) {
- if(json == null) {
- throw new IllegalArgumentException("A null JSON map is not allowed when trying to get the packet type"); //$NON-NLS-1$
- }
- return (String) json.get(Attributes.TYPE);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- Object json = toJSON();
- buffer.append("Packet: "); //$NON-NLS-1$
- JSON.writeValue(json, buffer);
- return buffer.toString();
- }
-
- /**
- * Sets if packet transfer should be traced
- * @param tracing
- */
- public static void setTracing(boolean tracing) {
- TRACE = tracing;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketManager.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketManager.java
deleted file mode 100644
index a350448..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketManager.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.io.IOException;
-
-/**
- * Default manager for sending / receiving packets to / from the connected {@link VirtualMachine}
- *
- * @since 1.0
- */
-public abstract class PacketManager implements Runnable {
-
- /**
- * Connector that performs IO to Virtual Machine.
- */
- private final Connection connection;
- /**
- * Thread that handles the communication the other way (e.g. if we are sending, the receiving thread).
- */
- private volatile Thread partnerThread;
- /**
- * The disconnected exception, if there is one
- */
- private volatile IOException disconnectedException;
-
- /**
- * Constructor
- *
- * @param connection the connection to communicate on, <code>null</code> is not accepted
- */
- protected PacketManager(Connection connection) {
- if(connection == null) {
- throw new IllegalArgumentException("You cannot create a new PacketManager with a null Connection"); //$NON-NLS-1$
- }
- this.connection = connection;
- }
-
- /**
- * Returns the {@link Connection} this manager is communicating on.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the backing {@link Connection} to the {@link VirtualMachine}
- */
- public Connection getConnection() {
- return this.connection;
- }
-
- /**
- * Used to indicate that an IO exception occurred, closes the {@link Connection}
- * to the {@link VirtualMachine}.
- *
- * @param disconnectedException the IOException that occurred or <code>null</code>
- */
- public void disconnect(IOException exception) {
- this.disconnectedException = exception;
- disconnect();
- }
-
- /**
- * Closes the {@link Connection} to the {@link VirtualMachine}.
- */
- public void disconnect() {
- try {
- this.connection.close();
- } catch (IOException e) {
- this.disconnectedException = e;
- }
- if (this.partnerThread != null) {
- this.partnerThread.interrupt();
- }
- }
-
- /**
- * Returns if the manager is disconnected or not.
- *
- * @return <code>true</code> if the manager is disconnected false otherwise
- */
- public boolean isDisconnected() {
- return this.connection == null || !this.connection.isOpen();
- }
-
- /**
- * Returns the underlying {@link IOException} from a disconnect.<br>
- * <br>
- * This method can return <code>null</code> if the manager has not been disconnected
- *
- * @return the underlying {@link IOException} from a disconnect or <code>null</code> if none
- */
- public IOException getDisconnectedException() {
- return this.disconnectedException;
- }
-
- /**
- * Assigns thread of partner, to be notified if we have an {@link IOException}.
- *
- * @param thread the new partner thread, <code>null</code> is not accepted
- */
- public void setPartnerThread(Thread thread) {
- if(thread == null) {
- throw new IllegalArgumentException("You cannot send a null partner thread on the PacketManager"); //$NON-NLS-1$
- }
- this.partnerThread = thread;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketReceiveManager.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketReceiveManager.java
deleted file mode 100644
index e70f47c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketReceiveManager.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-
-/**
- * Default implementation of {@link PacketManager} for receiving packets from the
- * {@link VirtualMachine}
- *
- * @since 1.0
- */
-public class PacketReceiveManager extends PacketManager {
-
- /**
- * Generic timeout value for not blocking. <br>
- * Value is: <code>0</code>
- */
- public static final int TIMEOUT_NOT_BLOCKING = 0;
- /**
- * Generic timeout value for infinite timeout. <br>
- * Value is: <code>-1</code>
- */
- public static final int TIMEOUT_INFINITE = -1;
- /**
- * List of Command packets received from Virtual Machine.
- */
- private List commandPackets = new LinkedList();
- /**
- * List of Reply packets received from Virtual Machine.
- */
- private List responsePackets = new LinkedList();
- /**
- * List of Packets that have timed out already. Maintained so that responses can be discarded if/when they are received.
- */
- private List timedOutPackets = new ArrayList();
-
- /**
- * Constructor
- *
- * @param connection the underlying connection to communicate on, <code>null</code> is not accepted
- */
- public PacketReceiveManager(Connection connection) {
- super(connection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.PacketManager#disconnect()
- */
- public void disconnect() {
- super.disconnect();
- synchronized (this.commandPackets) {
- this.commandPackets.notifyAll();
- }
- synchronized (this.responsePackets) {
- this.responsePackets.notifyAll();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- try {
- while (!isDisconnected()) {
- // Read a packet from the input stream.
- readAvailablePacket();
- }
- }
- // if the remote runtime is interrupted, drop the connection and clean up, don't wait for it to happen on its own
- catch (InterruptedIOException e) {
- disconnect(e);
- } catch (IOException e) {
- disconnect(e);
- }
- }
-
- /**
- * Returns a specified command {@link Packet} from the {@link VirtualMachine}.<br>
- * <br>
- * This method cannot return <code>null</code> an exception is thrown if the desired packet cannot
- * be returned.
- *
- * @param type the type of the packet to get
- * @param timeToWait the amount of time to wait for the {@link Packet} to arrive
- *
- * @return the specified command packet never <code>null</code>
- * @throws TimeoutException if the request times out
- * @throws DisconnectedException if the manager is disconnected
- */
- public Packet getCommand(String type, long timeToWait) throws TimeoutException, DisconnectedException {
- synchronized (this.commandPackets) {
- long remainingTime = timeToWait;
- // Wait until command is available.
- //even if disconnected try to send the remaining events
- while (!isDisconnected() || !this.commandPackets.isEmpty()) {
- Packet packet = removeCommandPacket(type);
- if (packet != null)
- return packet;
-
- if (remainingTime < 0 && timeToWait != TIMEOUT_INFINITE)
- break;
-
- long timeBeforeWait = System.currentTimeMillis();
- try {
- waitForPacketAvailable(remainingTime, this.commandPackets);
- } catch (InterruptedException e) {
- break;
- }
- long waitedTime = System.currentTimeMillis() - timeBeforeWait;
- remainingTime -= waitedTime;
- }
- }
- // Check for an IO Exception.
- if (isDisconnected()) {
- throw new DisconnectedException("Runtime disconnected", getDisconnectedException()); //$NON-NLS-1$
- }
- // Check for a timeout.
- throw new TimeoutException("Timed out waiting for command packet: " + type); //$NON-NLS-1$
- }
-
- /**
- * Returns a specified response packet from the {@link VirtualMachine}.<br>
- * <br>
- * This method cannot return <code>null</code> an exception is thrown if the desired response cannot
- * be returned.
- *
- * @param requestSequence the sequence of the response to acquire
- * @param timeToWait the amount of time to wait for the {@link Response}
- *
- * @return a specified response packet from the {@link VirtualMachine} never <code>null</code>
- * @throws TimeoutException if the request times out
- * @throws DisconnectedException if the manager is disconnected
- */
- public Response getResponse(int requestSequence, long timeToWait) throws TimeoutException, DisconnectedException {
- synchronized (this.responsePackets) {
- long remainingTime = timeToWait;
- // Wait until command is available.
- while (!isDisconnected()) {
- Response response = removeResponsePacket(requestSequence);
- if (response != null)
- return response;
-
- if (remainingTime < 0 && timeToWait != TIMEOUT_INFINITE)
- break;
-
- long timeBeforeWait = System.currentTimeMillis();
- try {
- waitForPacketAvailable(remainingTime, this.responsePackets);
- } catch (InterruptedException e) {
- break;
- }
- long waitedTime = System.currentTimeMillis() - timeBeforeWait;
- remainingTime -= waitedTime;
- }
- }
- // Check for an IO Exception.
- if (isDisconnected()) {
- throw new DisconnectedException("Runtime disconnected", getDisconnectedException()); //$NON-NLS-1$
- }
-
- synchronized (this.responsePackets) {
- this.timedOutPackets.add(new Integer(requestSequence));
- }
- throw new TimeoutException("Timed out waiting for packet: " + requestSequence); //$NON-NLS-1$
- }
-
- /**
- * Wait for an available packet from the Virtual Machine.
- */
- private void waitForPacketAvailable(long timeToWait, Object lock) throws InterruptedException {
- if (timeToWait == 0)
- return;
- else if (timeToWait < 0)
- lock.wait();
- else
- lock.wait(timeToWait);
- }
-
- /**
- * Removes and returns the command packet for the given type or <code>null</code> if there is no command packet for the given type.
- *
- * @param type
- * @return The command packet for the given type that has been removed
- */
- private Packet removeCommandPacket(String type) {
- ListIterator iter = this.commandPackets.listIterator();
- while (iter.hasNext()) {
- Packet packet = (Packet) iter.next();
- if (type == null || packet.getType().equals(type)) {
- iter.remove();
- return packet;
- }
- }
- return null;
- }
-
- /**
- * Removes and returns the response packet with the given request sequence or <code>null</code> if there is no response packet with the given request sequence
- *
- * @param requestSequence
- * @return the response packet with the given request sequence that has been removed
- */
- private Response removeResponsePacket(int requestSequence) {
- ListIterator iter = this.responsePackets.listIterator();
- while (iter.hasNext()) {
- Response response = (Response) iter.next();
- if (requestSequence == response.getRequestSequence()) {
- iter.remove();
- return response;
- }
- }
- return null;
- }
-
- /**
- * Adds the given command packet to the listing of command packets. This method is a no-op if the given packet is <code>null</code>
- *
- * @param packet
- */
- private void addCommandPacket(Packet packet) {
- if (packet == null) {
- return;
- }
- synchronized (this.commandPackets) {
- this.commandPackets.add(packet);
- this.commandPackets.notifyAll();
- }
- }
-
- /**
- * Adds the given response packet to the listing of response packets. This method is a no-op if the given packet is <code>null</code>
- *
- * @param response
- */
- private void addResponsePacket(Response response) {
- if (response == null) {
- return;
- }
- synchronized (this.responsePackets) {
- if (!this.timedOutPackets.isEmpty()) {
- Integer requestSeq = new Integer(response.getRequestSequence());
- if (this.timedOutPackets.remove(requestSeq))
- return; // already timed out. No need to keep this one
- }
- this.responsePackets.add(response);
- this.responsePackets.notifyAll();
- }
- }
-
- /**
- * Reads the next packet from the underlying connection and adds it to the correct packet listing.
- *
- * @throws IOException
- */
- private void readAvailablePacket() throws IOException {
- // Read a packet from the Input Stream.
- Packet packet = getConnection().readPacket();
- if (packet instanceof Response) {
- addResponsePacket((Response) packet);
- }
- else {
- addCommandPacket(packet);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketSendManager.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketSendManager.java
deleted file mode 100644
index 5050d3f..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/PacketSendManager.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * Default implementation of {@link PacketManager} for sending packets to the
- * {@link VirtualMachine}
- *
- * @since 1.0
- */
-public class PacketSendManager extends PacketManager {
-
- /**
- * List of packets to be sent to Virtual Machine
- */
- private final List outgoingPackets = new ArrayList();
-
- /**
- * Create a new thread that send packets to the {@link VirtualMachine}.
- *
- * @param connection the underlying connection to communicate on, <code>null</code> is not accepted
- */
- public PacketSendManager(Connection connection) {
- super(connection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.PacketManager#disconnect()
- */
- public void disconnect() {
- super.disconnect();
- synchronized (outgoingPackets) {
- outgoingPackets.notifyAll();
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run() {
- while (!isDisconnected()) {
- try {
- sendAvailablePackets();
- }
- // in each case if the remote runtime fails, or has been interrupted, disconnect and force a clean up, don't wait for it to happen
- catch (InterruptedException e) {
- disconnect();
- } catch (InterruptedIOException e) {
- disconnect(e);
- } catch (IOException e) {
- disconnect(e);
- }
- }
- }
-
- /**
- * Sends the given {@link Packet}.
- *
- * @param packet the packet to send, <code>null</code> is not accepted
- *
- * @throws DisconnectedException
- */
- public void sendPacket(Packet packet) throws DisconnectedException {
- if(packet == null) {
- throw new IllegalArgumentException("You cannot send a null packet"); //$NON-NLS-1$
- }
- if (isDisconnected()) {
- throw new DisconnectedException("Runtime disconnected", getDisconnectedException()); //$NON-NLS-1$
- }
- synchronized (outgoingPackets) {
- // Add packet to list of packets to send.
- outgoingPackets.add(packet);
- // Notify PacketSendThread that data is available.
- outgoingPackets.notifyAll();
- }
- }
-
- /**
- * Send available packets to the Virtual Machine.
- */
- private void sendAvailablePackets() throws InterruptedException, IOException {
- Object[] packetsToSend;
- synchronized (outgoingPackets) {
- while (outgoingPackets.size() == 0) {
- outgoingPackets.wait();
- }
- packetsToSend = outgoingPackets.toArray();
- outgoingPackets.clear();
- }
-
- // Put available packets on Output Stream.
- for (int i = 0; i < packetsToSend.length; i++) {
- getConnection().writePacket((Packet) packetsToSend[i]);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Request.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Request.java
deleted file mode 100644
index eea2a88..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Request.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * Default request implementation using JSON
- *
- * @since 1.0
- */
-public class Request extends Packet {
-
- /**
- * The type of this packet
- */
- public static final String REQUEST = "request"; //$NON-NLS-1$
-
- private final String command;
- private final Map arguments = Collections.synchronizedMap(new HashMap());
- private final Map params = Collections.synchronizedMap(new HashMap());
-
-
- /**
- * Constructor
- *
- * @param command the command, <code>null</code> is not accepted
- * @param context_id the id of the context to scope the request to
- * @see http://getfirebug.com/wiki/index.php/Crossfire_Protocol_Reference for
- * requests that do not require a context id.
- */
- public Request(String command, String context_id) {
- super(REQUEST, context_id);
- if(command == null) {
- throw new IllegalArgumentException("The request command kind cannot be null"); //$NON-NLS-1$
- }
- this.command = command.intern();
- }
-
- /**
- * Constructor
- *
- * @param json map of JSON attributes, <code>null</code> is not accepted
- */
- public Request(Map json) {
- super(json);
- if(json == null) {
- throw new IllegalArgumentException("The JSON map for a request packet cannot be null"); //$NON-NLS-1$
- }
- String value = (String) json.get(Attributes.COMMAND);
- this.command = value.intern();
- Map packetArguments = (Map) json.get(Attributes.ARGUMENTS);
- arguments.putAll(packetArguments);
- }
-
- /**
- * Allows additional parameters to be added to the request
- *
- * @param key
- * @param value
- */
- public void addAdditionalParam(String key, Object value) {
- params.put(key, value);
- }
-
- /**
- * Returns the command that this {@link Request} will was created for.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the underlying command, never <code>null</code>
- */
- public String getCommand() {
- return command;
- }
-
- /**
- * Returns the complete collection of JSON arguments in the {@link Request}.<br>
- * <br>
- * This method cannot return <code>null</code>, an empty map will be returned
- * if there are no properties.
- *
- * @return the arguments or an empty map never <code>null</code>
- */
- public Map getArguments() {
- return arguments;
- }
-
- /**
- * Sets the given argument in the JSON map.
- *
- * @param key the key for the attribute, <code>null</code> is not accepted
- * @param argument the value for the argument, <code>null</code> is not accepted
- */
- public void setArgument(String key, Object argument) {
- if(key == null) {
- throw new IllegalArgumentException("The argument key cannot be null"); //$NON-NLS-1$
- }
- if(argument == null) {
- throw new IllegalArgumentException("A null argument is not allowed"); //$NON-NLS-1$
- }
- arguments.put(key, argument);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet#toJSON()
- */
- public Map toJSON() {
- Map json = super.toJSON();
- json.put(Attributes.COMMAND, command);
- if(!arguments.isEmpty()) {
- json.put(Attributes.ARGUMENTS, arguments);
- }
- Entry entry = null;
- for(Iterator iter = params.entrySet().iterator(); iter.hasNext();) {
- entry = (Entry) iter.next();
- json.put(entry.getKey(), entry.getValue());
- }
- return json;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- Object json = toJSON();
- buffer.append("Request: "); //$NON-NLS-1$
- JSON.writeValue(json, buffer);
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Response.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Response.java
deleted file mode 100644
index bae58e0..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/Response.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Default {@link Response} implementation using JSON
- *
- * @since 1.0
- */
-public class Response extends Packet {
-
- /**
- * The type of this packet
- */
- public static final String RESPONSE = "response"; //$NON-NLS-1$
-
- static final Map failed_attributes;
- static {
- failed_attributes = new HashMap();
- Integer value = new Integer(-1);
- failed_attributes.put(Attributes.SEQ, value);
- failed_attributes.put(Attributes.TYPE, RESPONSE);
- failed_attributes.put(Attributes.REQUEST_SEQ, value);
- failed_attributes.put(Attributes.COMMAND, "failed"); //$NON-NLS-1$
- failed_attributes.put(Attributes.SUCCESS, Boolean.FALSE);
- failed_attributes.put(Attributes.RUNNING, Boolean.FALSE);
- }
-
- public static final Response FAILED = new Response(failed_attributes);
-
- private String command;
- private int requestSequence;
- private Map body = Collections.synchronizedMap(new HashMap());
- private volatile boolean success = true;
- private volatile boolean running = true;
- private volatile String message;
-
- /**
- * Constructor
- *
- * @param requestSequence the sequence
- * @param command the command, <code>null</code> is not accepted
- */
- public Response(int requestSequence, String command) {
- super(RESPONSE, null);
- if(command == null) {
- throw new IllegalArgumentException("The command string for a response packet cannot be null"); //$NON-NLS-1$
- }
- this.requestSequence = requestSequence;
- this.command = command.intern();
- }
-
- /**
- * Constructor
- *
- * @param json the JSON map for a response, <code>null</code> is not accepted
- */
- public Response(Map json) {
- super(json);
- Number packetRequestSeq = (Number) json.get(Attributes.REQUEST_SEQ);
- requestSequence = packetRequestSeq.intValue();
-
- String packetCommand = (String) json.get(Attributes.COMMAND);
- command = packetCommand.intern();
-
- Map packetBody = (Map) json.get(Attributes.BODY);
- if(packetBody != null) {
- body.putAll(packetBody);
- }
-
- Boolean packetSuccess = (Boolean) json.get(Attributes.SUCCESS);
- success = packetSuccess.booleanValue();
-
- Boolean packetRunning = (Boolean) json.get(Attributes.RUNNING);
- running = packetRunning.booleanValue();
-
- message = (String) json.get(Attributes.MESSAGE);
- }
-
- /**
- * Returns the request sequence
- *
- * @return the request sequence
- */
- public int getRequestSequence() {
- return requestSequence;
- }
-
- /**
- * Returns the underlying command.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the underlying command, never <code>null</code>
- */
- public String getCommand() {
- return command;
- }
-
- /**
- * Returns the body of the command.<br>
- * <br>
- * This method cannot return <code>null</code>, if there is no body
- * an empty {@link Map} is returned.
- *
- * @return the body of the JSON response or an empty {@link Map} never <code>null</code>
- */
- public Map getBody() {
- return body;
- }
-
- /**
- * Returns <code>true</code> if the {@link Request} was successful
- *
- * @return <code>true</code> if the {@link Request} was successful, <code>false</code> otherwise
- */
- public boolean isSuccess() {
- return success;
- }
-
- /**
- * Set the success flag for the response
- *
- * @param success the new success flag
- */
- public void setSuccess(boolean success) {
- this.success = success;
- }
-
- /**
- * Returns <code>true</code> if the underlying command is currently running.
- *
- * @return <code>true</code> if the underlying command is running, <code>false</code> otherwise
- */
- public boolean isRunning() {
- return running;
- }
-
- /**
- * Sets the running state of the underlying command
- *
- * @param running the new running state for the underlying command
- */
- public void setRunning(boolean running) {
- this.running = running;
- }
-
- /**
- * Returns the status message for this {@link Response}.<br>
- * <br>
- * This method can return <code>null</code>
- *
- * @return the status message for this {@link Response} or <code>null</code>
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Set the status message for this {@link Response}
- *
- * @param message the new message, <code>null</code> is accepted
- */
- public void setMessage(String message) {
- this.message = message;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet#toJSON()
- */
- public Map toJSON() {
- Map json = super.toJSON();
- json.put(Attributes.REQUEST_SEQ, new Integer(requestSequence));
- json.put(Attributes.COMMAND, command);
- json.put(Attributes.BODY, body);
- json.put(Attributes.SUCCESS, new Boolean(success));
- json.put(Attributes.RUNNING, new Boolean(running));
- if (message != null) {
- json.put(Attributes.MESSAGE, message);
- }
- return json;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- Object json = toJSON();
- buffer.append("Response: "); //$NON-NLS-1$
- JSON.writeValue(json, buffer);
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/SocketConnection.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/SocketConnection.java
deleted file mode 100644
index 1452491..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/SocketConnection.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.net.Socket;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.internal.crossfire.Constants;
-import org.eclipse.wst.jsdt.debug.internal.crossfire.Tracing;
-
-/**
- * A specialized {@link Connection} that communicates using {@link Socket}s
- *
- * @since 1.0
- */
-public class SocketConnection implements Connection {
-
- private Writer writer;
- private Reader reader;
- private Socket socket;
-
- /**
- * Constructor
- *
- * @param socket the underlying {@link Socket}, <code>null</code> is not accepted
- *
- * @throws IOException
- */
- public SocketConnection(Socket socket) throws IOException {
- if(socket == null) {
- throw new IllegalArgumentException("You cannot create a new SocketConnection on a null Socket"); //$NON-NLS-1$
- }
- this.socket = socket;
- writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), Constants.UTF_8));
- reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), Constants.UTF_8));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#isOpen()
- */
- public boolean isOpen() {
- return !socket.isClosed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#close()
- */
- public void close() throws IOException {
- socket.close();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#writePacket(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet)
- */
- public void writePacket(Packet packet) throws IOException {
- String serialized = JSON.serialize(packet);
- if(Packet.TRACE) {
- Tracing.writeString("WRITE PACKET: "+serialized); //$NON-NLS-1$
- }
- writer.write(serialized);
- writer.flush();
- }
-
- /**
- * Writes the standard handshake packet to connect
- *
- * @param packet
- * @throws IOException
- */
- public void writeHandShake() throws IOException {
- if(Packet.TRACE) {
- Tracing.writeString("WRITE HANDSHAKE: "+HandShake.getHandshake()); //$NON-NLS-1$
- }
- writer.write(HandShake.getHandshake());
- writer.flush();
- }
-
- /**
- * Reads the {@link HandShake} packet from the the stream
- *
- * @return the {@link HandShake}, never <code>null</code>
- * @throws IOException
- */
- public Packet readHandShake() throws IOException {
- StringBuffer buffer = new StringBuffer();
- //read the header first
- int c = 0;
- boolean r = false;
- while((c = reader.read()) > -1) {
- buffer.append((char)c);
- if(r) {
- if(c == '\n') {
- break;
- }
- }
- r = c == '\r';
- }
- if(buffer.toString().equals(HandShake.getHandshake())) {
- HandShake ack = new HandShake();
- if(Packet.TRACE) {
- Tracing.writeString("ACK HANDSHAKE: "+ack); //$NON-NLS-1$
- }
- return ack;
- }
- throw new IOException("Did not get correct CrossFire handshake"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#readPacket()
- */
- public Packet readPacket() throws IOException {
- StringBuffer buffer = new StringBuffer();
- int c = -1;
- boolean len = false;
- while((c = reader.read()) > -1) {
- if(c == '\r') {
- break;
- }
- if(len) {
- buffer.append((char)c);
- continue;
- }
- len = c == ':';
- }
- int length = 0;
- try {
- length = Integer.parseInt(buffer.toString());
- } catch (NumberFormatException e) {
- throw new IOException("Failed to parse content length: " + buffer.toString()); //$NON-NLS-1$
- }
- c = reader.read();
- if(c != '\n') {
- throw new IOException("Failed to parse content length: " + buffer.toString() + "next char was not '\n'" + (char)c); //$NON-NLS-1$ //$NON-NLS-2$
- }
- char[] message = new char[length];
- int n = 0;
- int off = 0;
- while (n < length) {
- int count = reader.read(message, off + n, length - n);
- if (count < 0) {
- throw new EOFException();
- }
- n += count;
- }
- if(Packet.TRACE) {
- Tracing.writeString("READ PACKET: [length - "+length+"]"+new String(message)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- Map json = (Map) JSON.read(new String(message));
- String type = Packet.getType(json);
- if (Event.EVENT.equals(type)) {
- return new Event(json);
- }
- if (Request.REQUEST.equals(type)) {
- return new Request(json);
- }
- if (Response.RESPONSE.equals(type)) {
- return new Response(json);
- }
- throw new IOException("Unknown packet type: " + type); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/SocketTransportService.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/SocketTransportService.java
deleted file mode 100644
index e27d716..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/SocketTransportService.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.internal.crossfire.Constants;
-
-
-/**
- * Implementation of a transport service that using a {@link Socket} for communication
- *
- * @since 1.0
- */
-public class SocketTransportService implements TransportService {
-
- static final Class serverSocketClass = ServerSocket.class; // temporary used to pre-load the ServerSocket.class
-
- /**
- * Key implementation
- */
- public static class SocketListenerKey implements ListenerKey {
-
- private String address;
-
- public SocketListenerKey(String address) {
- this.address = address;
- }
-
- public String address() {
- return address;
- }
- }
-
- /**
- * Map of {@link ListenerKey} to {@link ServerSocket}s
- */
- Map listeners = new HashMap();
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#startListening(java.lang.String)
- */
- public synchronized ListenerKey startListening(String address) throws IOException {
- String host = null;
- int port = 0;
- if (address != null) {
- String[] strings = address.split(Constants.COLON);
- if (strings.length == 2) {
- host = strings[0];
- port = Integer.parseInt(strings[1]);
- } else {
- port = Integer.parseInt(strings[0]);
- }
- }
- if (host == null) {
- host = LOCALHOST;
- }
- if (!host.equals(LOCALHOST)) {
- throw new IllegalArgumentException("Only localhost is supported."); //$NON-NLS-1$
- }
- ListenerKey key = new SocketListenerKey(host + Constants.COLON + port);
- ServerSocket serverSocket = new ServerSocket(port);
- listeners.put(key, serverSocket);
- return key;
-
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#stopListening(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService.ListenerKey)
- */
- public void stopListening(ListenerKey key) throws IOException {
- ServerSocket serverSocket = (ServerSocket) listeners.remove(key);
- if (serverSocket != null) {
- serverSocket.close();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#accept(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService.ListenerKey, long, long)
- */
- public Connection accept(ListenerKey key, long attachTimeout, long handshakeTimeout) throws IOException {
- ServerSocket serverSocket = (ServerSocket) listeners.get(key);
- if (serverSocket == null) {
- throw new IllegalStateException("Accept failed. Not listening for address: key.address()"); //$NON-NLS-1$
- }
- int timeout = (int) attachTimeout;
- if (timeout > 0) {
- if (timeout > Integer.MAX_VALUE) {
- timeout = Integer.MAX_VALUE; // approximately 25 days!
- }
- serverSocket.setSoTimeout(timeout);
- }
- SocketConnection connection = new SocketConnection(serverSocket.accept());
- Packet packet = connection.readHandShake();
- if (!(packet instanceof HandShake)) {
- throw new IOException("failure establishing connection"); //$NON-NLS-1$
- }
- connection.writeHandShake();
- return connection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#attach(java.lang.String, long, long)
- */
- public Connection attach(String address, long attachTimeout, long handshakeTimeout) throws IOException {
- String host = null;
- int port = 0;
- if (address != null) {
- String[] strings = address.split(Constants.COLON);
- if (strings.length == 2) {
- host = strings[0];
- port = Integer.parseInt(strings[1]);
- } else {
- port = Integer.parseInt(strings[0]);
- }
- }
- if (host == null) {
- host = LOCALHOST;
- }
- SocketConnection connection = new SocketConnection(new Socket(host, port));
- connection.writeHandShake();
- Packet packet = connection.readPacket();
- if (!(packet instanceof HandShake)) {
- throw new IOException("failure establishing connection"); //$NON-NLS-1$
- }
- return connection;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/TimeoutException.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/TimeoutException.java
deleted file mode 100644
index 0c93e70..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/TimeoutException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-/**
- * This exception is thrown if the {@link PacketSendManager} or {@link PacketReceiveManager}
- * times out while waiting for a response
- *
- * @since 1.0
- */
-public final class TimeoutException extends Exception {
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor
- *
- * @param message the message for the exception
- */
- public TimeoutException(String message) {
- super(message);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/TransportService.java b/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/TransportService.java
deleted file mode 100644
index 5436b74..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.crossfire/src/org/eclipse/wst/jsdt/debug/internal/crossfire/transport/TransportService.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.crossfire.transport;
-
-import java.io.IOException;
-
-
-/**
- * A transport service is used to attach and / or listen to a
- * {@link Connection} exactly how the service communicates is an implementation detail.
- *
- * @since 1.0
- */
-public interface TransportService {
-
- public static final String LOCALHOST = "localhost"; //$NON-NLS-1$
- public static final String PORT = "port"; //$NON-NLS-1$
-
- /**
- * Describes a unique address to listen on
- */
- public interface ListenerKey {
- public String address();
- }
-
- /**
- * Registers that this service should begin listening to the given address
- *
- * @param address the address to listen on - e.g. localhost:12000
- * @return the key that uniquely identifies this service
- * @throws IOException
- */
- public ListenerKey startListening(String address) throws IOException;
-
- /**
- * Stops listening for the given key
- *
- * @param listenerKey
- * @throws IOException
- */
- public void stopListening(ListenerKey listenerKey) throws IOException;
-
- /**
- * Listens for a connection to be made to and accepts it. The method can block until a connection is made.
- *
- * @param listenerKey
- * @param attachTimeout
- * @param handshakeTimeout
- * @return the resulting {@link Connection}
- * @throws IOException
- */
- public Connection accept(ListenerKey listenerKey, long attachTimeout, long handshakeTimeout) throws IOException;
-
- /**
- * Attaches to the given address and returns the resulting connection. This method can block until a connection is made
- *
- * @param address
- * @param attachTimeout
- * @param handshakeTimeout
- * @return the resulting {@link Connection}
- * @throws IOException
- */
- public Connection attach(String address, long attachTimeout, long handshakeTimeout) throws IOException;
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.classpath b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.classpath
deleted file mode 100644
index 2fbb7a2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.project b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.project
deleted file mode 100644
index edf6952..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.jsdt.debug.rhino.debugger</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index de9eac3..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,90 +0,0 @@
-#Fri Apr 30 10:04:28 CDT 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
-org.eclipse.jdt.core.compiler.problem.deadCode=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=error
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index b76afaa..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Sun Feb 28 13:50:08 EST 2010
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/META-INF/MANIFEST.MF
deleted file mode 100644
index 20a246f..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-Vendor: %Bundle-Vendor
-Bundle-SymbolicName: org.eclipse.wst.jsdt.debug.rhino.debugger
-Bundle-Version: 1.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Export-Package: org.eclipse.wst.jsdt.debug.internal.rhino.debugger;x-internal:=true,
- org.eclipse.wst.jsdt.debug.internal.rhino.transport;x-friends:="org.eclipse.wst.jsdt.debug.rhino",
- org.eclipse.wst.jsdt.debug.rhino.debugger,
- org.eclipse.wst.jsdt.debug.rhino.debugger.shell
-Import-Package: org.mozilla.javascript;resolution:=optional,
- org.mozilla.javascript.debug;resolution:=optional,
- org.mozilla.javascript.tools.shell;resolution:=optional
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/OSGI-INF/l10n/bundle.properties
deleted file mode 100644
index b38b565..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/OSGI-INF/l10n/bundle.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-Bundle-Vendor = Eclipse Web Tools Platform
-Bundle-Name = Rhino Debugger
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/about.html b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/about.html
deleted file mode 100755
index b4a1c56..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>March 10, 2010</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/build.properties b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/build.properties
deleted file mode 100644
index 04fa2df..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- OSGI-INF/l10n/bundle.properties
-src.includes = about.html
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/Breakpoint.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/Breakpoint.java
deleted file mode 100644
index 3ebb1bb..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/Breakpoint.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-import java.util.HashMap;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-
-/**
- * Implementation of a breakpoint wrt Rhino debugging
- *
- * @since 1.0
- */
-public class Breakpoint {
-
- final Long breakpointId;
- final ScriptSource script;
- final Integer lineNumber;
- final Object functionName;
- final String condition;
- final Long threadId;
-
- /**
- * Constructor
- *
- * @param breakpointId the id for the breakpoint
- * @param script the script the breakpoint applies to, <code>null</code> is not accepted
- * @param lineNumber the line number for the breakpoint
- * @param functionName the name of the function the breakpoint is set on, <code>null</code> is accepted
- * @param condition the condition for the breakpoint, <code>null</code> is accepted
- * @param threadId the id of the thread the breakpoint is for
- */
- public Breakpoint(Long breakpointId, ScriptSource script, Integer lineNumber, String functionName, String condition, Long threadId) {
- if (script == null) {
- throw new IllegalArgumentException("The parent script cannot be null"); //$NON-NLS-1$
- }
- this.breakpointId = breakpointId;
- this.script = script;
- this.lineNumber = lineNumber;
- this.functionName = functionName;
- this.condition = condition;
- this.threadId = threadId;
- }
-
- /**
- * @return the breakpoint as a JSON entry
- */
- public Object toJSON() {
- HashMap result = new HashMap();
- result.put(JSONConstants.BREAKPOINT_ID, breakpointId);
- result.put(JSONConstants.SCRIPT_ID, script.getId());
- if (lineNumber != null) {
- result.put(JSONConstants.LINE, lineNumber);
- }
- if (functionName != null) {
- result.put(JSONConstants.FUNCTION, functionName);
- }
- if (condition != null) {
- result.put(JSONConstants.CONDITION, condition);
- }
- if (threadId != null) {
- result.put(JSONConstants.THREAD_ID, threadId);
- }
- return result;
- }
-
- /**
- * Deletes the breakpoint from the script it is associated with. Does
- * not clear any of the handle information so the deleted breakpoint can be
- * returned as an event if required.
- */
- public void delete() {
- this.script.removeBreakpoint(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ContextData.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ContextData.java
deleted file mode 100644
index 1d609cc..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ContextData.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.EventPacket;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-/**
- * Rhino implementation of {@link ContextData}
- *
- * @since 1.0
- */
-public class ContextData {
- private static final int CONTEXT_RUNNING = 0;
- private static final int CONTEXT_SUSPENDED = 1;
-
- private static final int STEP_CONTINUE = 0;
- private static final int STEP_IN = 1;
- private static final int STEP_NEXT = 2;
- private static final int STEP_OUT = 4;
-
- private final Long threadId;
- private final Long contextId;
- private final RhinoDebuggerImpl debugger;
-
- private final LinkedList frames = new LinkedList();
-
- private int contextState = CONTEXT_RUNNING;
- private int stepState = STEP_CONTINUE;
- private StackFrame stepFrame;
-
- /**
- * Constructor
- *
- * @param threadId
- * @param contextId
- * @param debugger
- */
- public ContextData(Long threadId, Long contextId, RhinoDebuggerImpl debugger) {
- this.threadId = threadId;
- this.contextId = contextId;
- this.debugger = debugger;
- }
-
- /**
- * Returns the unique id of this context data
- *
- * @return the unique id
- */
- public Long getId() {
- return contextId;
- }
-
- /**
- * Returns the live list of {@link DebugFrame}s from this context
- *
- * @return the live list of {@link DebugFrame}s
- */
- public synchronized List getFrameIds() {
- List result = new ArrayList();
- for (Iterator iterator = frames.iterator(); iterator.hasNext();) {
- result.add(((StackFrame) iterator.next()).getId());
- }
- return result;
- }
-
- /**
- * Returns the {@link DebugFrame} with the given id or <code>null</code> if no such {@link DebugFrame} exists
- *
- * @param frameId
- * @return the {@link DebugFrame} with the given id or <code>null</code>
- */
- public synchronized StackFrame getFrame(Long frameId) {
- StackFrame frame = null;
- for (Iterator iterator = frames.iterator(); iterator.hasNext();) {
- frame = (StackFrame) iterator.next();
- if (frame.getId().equals(frameId)) {
- return frame;
- }
- }
- return null;
- }
-
- /**
- * Adds the given frame to the top of the frame stack and sends out a break event as needed
- *
- * @param frame
- * @param script
- * @param lineNumber
- * @param functionName
- */
- public synchronized void pushFrame(StackFrame frame, ScriptSource script, Integer lineNumber, String functionName) {
- frames.addFirst(frame);
- Breakpoint breakpoint = script.getBreakpoint(lineNumber, functionName);
- boolean isStepBreak = stepBreak(STEP_IN);
- if (isStepBreak || breakpoint != null) {
- if (sendBreakEvent(script, frame.getLineNumber(), functionName, breakpoint, isStepBreak, false)) {
- suspendState();
- }
- }
- }
-
- /**
- * Returns if the step operation should cause a break
- *
- * @param step
- * @return true if the operation should break false otherwise
- */
- private boolean stepBreak(int step) {
- return ((0 != (step & stepState)) && (stepFrame == null || stepFrame == frames.getFirst()));
- }
-
- /**
- * Suspends the state via {@link #wait()}
- */
- private void suspendState() {
- contextState = CONTEXT_SUSPENDED;
- while (contextState == CONTEXT_SUSPENDED) {
- try {
- wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Removes the first {@link DebugFrame} from the current stack
- *
- * @param byThrow
- * @param resultOrException
- */
- public synchronized void popFrame(boolean byThrow, Object resultOrException) {
- if(!frames.isEmpty()) {
- StackFrame frame = (StackFrame) frames.removeFirst();
- if (stepFrame == frame) {
- stepFrame = null;
- stepState = STEP_OUT;
- }
-
- boolean isStepBreak = stepBreak(STEP_IN | STEP_OUT);
- if (isStepBreak) {
- frame = getTopFrame();
- if (frame != null && sendBreakEvent(frame.getScript(), frame.getLineNumber(), null, null, isStepBreak, false)) {
- suspendState();
- }
- }
- }
- }
-
- /**
- * Resume the state with the given step type
- *
- * @param stepType
- */
- public synchronized void resume(String stepType) {
- try {
- if (stepType == null) {
- stepState = STEP_CONTINUE;
- stepFrame = null;
- } else if (stepType.equals(JSONConstants.STEP_IN)) {
- stepState = STEP_IN;
- stepFrame = null;
- } else if (stepType.equals(JSONConstants.STEP_NEXT)) {
- stepState = STEP_NEXT;
- stepFrame = getTopFrame();
- } else if (stepType.equals(JSONConstants.STEP_OUT)) {
- if (frames.size() > 1) {
- stepState = STEP_OUT;
- stepFrame = (StackFrame) frames.get(1);
- } else {
- stepState = STEP_CONTINUE;
- stepFrame = null;
- }
- } else if (stepType.equals(JSONConstants.STEP_ANY)) {
- stepState = STEP_IN | STEP_OUT | STEP_NEXT;
- stepFrame = null;
- } else {
- throw new IllegalStateException("bad stepType: " + stepType); //$NON-NLS-1$
- }
- }
- finally {
- contextState = CONTEXT_RUNNING;
- notifyAll();
- }
- }
-
- /**
- * Returns the top stack frame iff there are frames.
- * Delegate method to prevent {@link NoSuchElementException}s
- *
- * @return the top frame or <code>null</code>
- */
- private StackFrame getTopFrame() {
- if(this.frames != null && !this.frames.isEmpty()) {
- return (StackFrame) this.frames.getFirst();
- }
- return null;
- }
-
- /**
- * Set the step state to the suspend equivalent
- */
- public synchronized void suspend() {
- stepState = STEP_IN | STEP_NEXT | STEP_OUT;
- stepFrame = null;
- }
-
- /**
- * Handles a <code>debugger;</code> statement
- *
- * @param script
- * @param lineNumber
- */
- public synchronized void debuggerStatement(ScriptSource script, Integer lineNumber) {
- Breakpoint breakpoint = script.getBreakpoint(lineNumber, null);
- boolean isStepBreak = stepBreak(STEP_IN | STEP_NEXT);
- if (sendBreakEvent(script, lineNumber, null, breakpoint, isStepBreak, true)) {
- suspendState();
- }
- }
-
- /**
- * Handles a line change
- *
- * @param script
- * @param lineNumber
- */
- public synchronized void lineChange(ScriptSource script, Integer lineNumber) {
- Breakpoint breakpoint = script.getBreakpoint(lineNumber, null);
- boolean isStepBreak = stepBreak(STEP_IN | STEP_NEXT);
- if (isStepBreak || breakpoint != null) {
- if (sendBreakEvent(script, lineNumber, null, breakpoint, isStepBreak, false)) {
- suspendState();
- }
- }
- }
-
- /**
- * Handles forwarding an exception event
- *
- * @param ex
- */
- public synchronized void exceptionThrown(Throwable ex) {
- StackFrame frame = getTopFrame();
- if (sendExceptionEvent(frame.getScript(), frame.getLineNumber(), ex)) {
- suspendState();
- }
- }
-
- /**
- * Sends a JSON message for an exception that has occurred
- *
- * @param script
- * @param lineNumber
- * @param ex
- * @return true if the message was sent successfully, false otherwise
- */
- private boolean sendExceptionEvent(ScriptSource script, Integer lineNumber, Throwable ex) {
- EventPacket exceptionEvent = new EventPacket(JSONConstants.EXCEPTION);
- Map body = exceptionEvent.getBody();
- body.put(JSONConstants.CONTEXT_ID, contextId);
- body.put(JSONConstants.THREAD_ID, threadId);
- body.put(JSONConstants.SCRIPT_ID, script.getId());
- body.put(JSONConstants.LINE_NUMBER, lineNumber);
- body.put(JSONConstants.MESSAGE, ex.getMessage());
- return debugger.sendEvent(exceptionEvent);
- }
-
- /**
- * Sends a JSON message for a break event
- *
- * @param script
- * @param lineNumber
- * @param functionName
- * @param breakpoint
- * @param isStepBreak
- * @param isDebuggerStatement
- * @return true if the message was sent successfully, false otherwise
- */
- private boolean sendBreakEvent(ScriptSource script, Integer lineNumber, String functionName, Breakpoint breakpoint, boolean isStepBreak, boolean isDebuggerStatement) {
- EventPacket breakEvent = new EventPacket(JSONConstants.BREAK);
- Map body = breakEvent.getBody();
- body.put(JSONConstants.THREAD_ID, threadId);
- body.put(JSONConstants.CONTEXT_ID, contextId);
- body.put(JSONConstants.SCRIPT_ID, script.getId());
- if (functionName != null) {
- body.put(JSONConstants.FUNCTION_NAME, functionName);
- }
- body.put(JSONConstants.LINE_NUMBER, lineNumber);
- if (breakpoint != null) {
- body.put(JSONConstants.BREAKPOINT, breakpoint.breakpointId);
- }
-
- if (isStepBreak) {
- String stepType;
- if (stepState == STEP_IN) {
- stepType = JSONConstants.STEP_IN;
- } else if (stepState == STEP_NEXT) {
- stepType = JSONConstants.STEP_NEXT;
- } else if (stepState == STEP_OUT) {
- stepType = JSONConstants.STEP_OUT;
- } else {
- stepType = JSONConstants.SUSPEND;
- }
- body.put(JSONConstants.STEP, stepType);
- stepState = 0;
- }
-
- body.put(JSONConstants.DEBUGGER_STATEMENT, Boolean.valueOf(isDebuggerStatement));
- return debugger.sendEvent(breakEvent);
- }
-
- /**
- * Handles a script load event
- *
- * @param script
- */
- public synchronized void scriptLoaded(ScriptSource script) {
- if (sendScriptEvent(script)) {
- suspendState();
- }
- }
-
- /**
- * Send a JSON message for a script event
- *
- * @param script
- * @return
- */
- private boolean sendScriptEvent(ScriptSource script) {
- EventPacket scriptEvent = new EventPacket(JSONConstants.SCRIPT);
- Map body = scriptEvent.getBody();
- body.put(JSONConstants.THREAD_ID, threadId);
- body.put(JSONConstants.CONTEXT_ID, contextId);
- body.put(JSONConstants.SCRIPT_ID, script.getId());
- return debugger.sendEvent(scriptEvent);
- }
-
- /**
- * Returns the string representation of the state
- *
- * @return the state text
- */
- public synchronized String getState() {
- return contextState == CONTEXT_RUNNING ? JSONConstants.RUNNING : JSONConstants.SUSPENDED;
- }
-
- /**
- * Returns the underlying thread id
- *
- * @return the underlying thread id
- */
- public Long getThreadId() {
- return threadId;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/DebugSessionManager.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/DebugSessionManager.java
deleted file mode 100644
index 2ea8891..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/DebugSessionManager.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-import java.io.IOException;
-import java.text.DateFormat;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Connection;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.DebugSession;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.DisconnectedException;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.EventPacket;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Response;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.SocketTransportService;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TimeoutException;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TransportService;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TransportService.ListenerKey;
-
-/**
- * Delegate for {@link DebugSession} communication
- *
- * @since 1.1
- */
-public class DebugSessionManager {
-
- public class DebugSessionThread extends Thread {
-
- private ListenerKey listenerKey;
- private Connection connection;
- private RequestHandler requestHandler;
-
- public DebugSessionThread(String name, RhinoDebuggerImpl debugger) {
- super(name);
- requestHandler = new RequestHandler(debugger);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- try {
- listenerKey = transportService.startListening(address);
- while (!shutdown) {
- try {
- acceptConnection(10000);
- } catch (IOException e) {
- if (connection == null) {
- continue;
- }
- }
- while (!shutdown && connection.isOpen()) {
- try {
- Request request = debugSession.receiveRequest(1000);
- if (DEBUG)
- System.out.println(request);
- Response response = requestHandler.handleRequest(request);
- if (DEBUG)
- System.out.println(response);
- debugSession.sendResponse(response);
- } catch (TimeoutException e) {
- // ignore
- } catch (DisconnectedException e) {
- break;
- }
- }
- closeConnection();
- }
- } catch (IOException e) {
- sendDeathEvent();
- /* e.printStackTrace(); */
- } finally {
- try {
- if (listenerKey != null)
- transportService.stopListening(listenerKey);
- } catch (IOException e) {
- sendDeathEvent();
- /* e.printStackTrace(); */
- }
- }
- }
-
- /**
- * Close the active connection
- *
- * @throws IOException
- */
- private void closeConnection() throws IOException {
- if (connection != null) {
- setDebugSession(null);
- connection.close();
- connection = null;
- }
- }
-
- /**
- * Waits for a connection for the given timeout
- *
- * @param timeout
- * @throws IOException
- */
- private void acceptConnection(long timeout) throws IOException {
- if (connection == null) {
- connection = transportService.accept(listenerKey, timeout, timeout);
- setDebugSession(new DebugSession(connection));
- }
- }
-
- }
-
- private static final boolean DEBUG = false;
-
- private static final String ADDRESS = "address"; //$NON-NLS-1$
- private static final String SOCKET = "socket"; //$NON-NLS-1$
- private static final String TRANSPORT = "transport"; //$NON-NLS-1$
-
- private final TransportService transportService;
- private final String address;
- private final boolean startSuspended;
-
- private DebugSession debugSession;
- private Thread debuggerThread;
- private volatile boolean shutdown = false;
-
- /**
- * Constructor
- *
- * @param transportService
- * @param address
- * @param startSuspended
- */
- public DebugSessionManager(TransportService transportService, String address, boolean startSuspended) {
- this.transportService = transportService;
- this.address = address;
- this.startSuspended = startSuspended;
- prettyPrintHeader();
- }
-
- /**
- * Creates a new session manager
- *
- * @param configString
- * @return
- */
- static DebugSessionManager create(String configString) {
- Map config = parseConfigString(configString);
- String transport = (String) config.get(TRANSPORT);
- if (!SOCKET.equals(transport)) {
- throw new IllegalArgumentException("Transport service must be 'socket': " + transport); //$NON-NLS-1$
- }
- TransportService parsedTransportService = new SocketTransportService();
- String parsedAddress = (String) config.get(ADDRESS);
- String suspend = (String) config.get(JSONConstants.SUSPEND);
- boolean parsedStartSuspended = false;
- if (suspend != null) {
- parsedStartSuspended = (Boolean.valueOf(suspend).booleanValue() || suspend.trim().equalsIgnoreCase("y")); //$NON-NLS-1$
- }
- return new DebugSessionManager(parsedTransportService, parsedAddress, parsedStartSuspended);
- }
-
- /**
- * Parses the command line configuration string
- *
- * @param configString
- * @return the map of command line arguments
- */
- private static Map parseConfigString(String configString) {
- Map config = new HashMap();
- StringTokenizer tokenizer = new StringTokenizer(configString, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken();
- int equalsIndex = token.indexOf('=');
- if (equalsIndex == -1)
- config.put(token, null);
- else
- config.put(token.substring(0, equalsIndex), token.substring(equalsIndex + 1));
- }
- return config;
- }
-
- /**
- * Pretty print the header for the debugger
- *
- * @since 1.1
- */
- private void prettyPrintHeader() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("Rhino attaching debugger\n"); //$NON-NLS-1$
- buffer.append("Start at time: ").append(getStartAtDate()); //$NON-NLS-1$
- buffer.append("\nListening to "); //$NON-NLS-1$
- buffer.append(this.transportService instanceof SocketTransportService ? "socket on " : "transport service on "); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("port: ").append(this.address); //$NON-NLS-1$
- if (startSuspended) {
- buffer.append("\nStarted suspended - waiting for client resume..."); //$NON-NLS-1$
- }
- System.out.println(buffer.toString());
- }
-
- /**
- * Returns the formatted date
- *
- * @return the formatted date
- * @see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4981314
- * @since 1.1
- */
- String getStartAtDate() {
- try {
- return DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(Calendar.getInstance().getTime());
- } catch (Throwable t) {
- return "<unknown>"; //$NON-NLS-1$
- }
- }
-
- /**
- * @return true if the <code>suspend=true</code> command line argument is
- * set
- */
- public boolean isStartSuspended() {
- return startSuspended;
- }
-
- /**
- * Returns if a {@link DebugSession} has successfully connected to this
- * debugger.
- *
- * @return <code>true</code> if the debugger has a connected
- * {@link DebugSession} <code>false</code> otherwise
- */
- public synchronized boolean isConnected() {
- return debugSession != null;
- }
-
- /**
- * Starts the debugger
- */
- public synchronized void start(RhinoDebuggerImpl debugger) {
- debuggerThread = new DebugSessionThread("RhinoDebugger - Request Handler", debugger); //$NON-NLS-1$
- debuggerThread.start();
- if (startSuspended) {
- try {
- wait(300000);
- } catch (InterruptedException e) {
- /* e.printStackTrace(); */
- }
- // TODO: We might want to check if debugSession is null and if so
- // call "stop" and throw an exception
- }
- }
-
- /**
- * Stops the debugger
- */
- public synchronized void stop() {
- shutdown = true;
- try {
- debuggerThread.interrupt();
- if (debuggerThread.isAlive())
- wait();
- debuggerThread.join();
- } catch (InterruptedException e) {
- /* e.printStackTrace(); */
- }
- }
-
- private synchronized void setDebugSession(DebugSession session) {
- if (debugSession != session) {
- if (debugSession != null) {
- debugSession.dispose();
- }
- debugSession = session;
- notify();
- }
- }
-
- /**
- * Sends the given {@link EventPacket} using the underlying
- * {@link DebugRuntime} and returns if it was sent successfully
- *
- * @param event
- * @return true if the event was sent successfully, false otherwise
- */
- public synchronized boolean sendEvent(EventPacket event) {
- try {
- if (debugSession != null) {
- if (DEBUG)
- System.out.println(event);
- debugSession.sendEvent(event);
- return true;
- }
- } catch (DisconnectedException e) {
- e.printStackTrace();
- }
- return false;
- }
-
- /**
- * Sends out an event that the debugger has died in an unexpected way.
- * Debugger death can result from:
- * <ul>
- * <li>an {@link IOException} while the debugger is running</li>
- * <li>an {@link InterruptedException} processing I/O</li>
- * </ul>
- */
- private void sendDeathEvent() {
- EventPacket event = new EventPacket(JSONConstants.VMDEATH);
- sendEvent(event);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/FunctionSource.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/FunctionSource.java
deleted file mode 100644
index 2f207199..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/FunctionSource.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-
-/**
- * Handle for a {@link DebuggableScript} function
- *
- * @since 1.0
- */
-public class FunctionSource {
-
- final ScriptSource parent;
- final String name;
- String source;
- final int linenumber;
-
- /**
- * Constructor
- *
- * @param script the parent - cannot be <code>null</code>
- * @param name the name of the function - can be <code>null</code>
- * @param source the underlying source for the function - can be <code>null</code>
- */
- public FunctionSource(ScriptSource script, String name, String source, int linenumber) {
- if(script == null) {
- throw new IllegalArgumentException("The parent script cannot be null"); //$NON-NLS-1$
- }
- this.parent = script;
- this.name = name;
- this.source = source;
- this.linenumber = linenumber;
- }
-
- /**
- * @return the parent {@link ScriptSource} this function appears in
- */
- public ScriptSource parent() {
- return this.parent;
- }
-
- /**
- * @return the name of the function
- */
- public String name() {
- return this.name;
- }
-
- /**
- * @return the source for the function
- */
- public String source() {
- return this.source;
- }
-
- /**
- * Sets the underlying source to the given string
- *
- * @param source the new source
- */
- public void setSource(String source) {
- this.source = source;
- }
-
- /**
- * @return the line number this function appears on
- */
- public int linenumber() {
- return this.linenumber;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("FunctionSource: [name - ").append(this.name).append("] [linenumber - ").append(linenumber).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- buffer.append("\tparent: ").append(parent.getLocation()); //$NON-NLS-1$
- buffer.append("\tsource: ").append(this.source).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/LineData.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/LineData.java
deleted file mode 100644
index 1e81c5d..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/LineData.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-/**
- * Class to hold information about a given line such as:
- * <ul>
- * <li>FunctionSource at the line</li>
- * <li>Breakpoint set on the line</li>
- * </ul>
- * @since 1.0
- */
-public class LineData {
-
- Breakpoint breakpoint = null;
- FunctionSource function = null;
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/RequestHandler.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/RequestHandler.java
deleted file mode 100644
index 51199e0..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/RequestHandler.java
+++ /dev/null
@@ -1,454 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Response;
-
-/**
- * Rhino request handler used to craft response bodies for given JSON requests
- *
- * @since 1.0
- */
-public class RequestHandler {
-
- public static final String VERSION_1_6 = "1.6"; //$NON-NLS-1$
- private RhinoDebuggerImpl debugger;
-
- /**
- * Constructor
- *
- * @param debugger
- */
- public RequestHandler(RhinoDebuggerImpl debugger) {
- this.debugger = debugger;
- }
-
- /**
- * Handles a general request - delegating to the correct command type
- *
- * @param request
- * @return
- */
- public Response handleRequest(Request request) {
- String command = request.getCommand();
- Response response = new Response(request.getSequence(), command);
- try {
- if (command.equals(JSONConstants.VERSION)) {
- handleVersionRequest(request, response);
- } else if (command.equals(JSONConstants.SUSPEND)) {
- handleSuspendRequest(request, response);
- } else if (command.equals(JSONConstants.CONTINUE)) {
- handleContinueRequest(request, response);
- } else if (command.equals(JSONConstants.DISPOSE)) {
- handleDisposeRequest(request, response);
- } else if (command.equals(JSONConstants.THREADS)) {
- handleThreadsRequest(request, response);
- } else if (command.equals(JSONConstants.THREAD)) {
- handleThreadRequest(request, response);
- } else if (command.equals(JSONConstants.FRAMES)) {
- handleFramesRequest(request, response);
- } else if (command.equals(JSONConstants.FRAME)) {
- handleFrameRequest(request, response);
- } else if (command.equals(JSONConstants.SCRIPTS)) {
- handleScriptsRequest(request, response);
- } else if (command.equals(JSONConstants.SCRIPT)) {
- handleScriptRequest(request, response);
- } else if (command.equals(JSONConstants.EVALUATE)) {
- handleEvaluateRequest(request, response);
- } else if (command.equals(JSONConstants.LOOKUP)) {
- handleLookupRequest(request, response);
- } else if (command.equals(JSONConstants.BREAKPOINTS)) {
- handleBreakpointsRequest(request, response);
- } else if (command.equals(JSONConstants.BREAKPOINT)) {
- handleBreakpointRequest(request, response);
- } else if (command.equals(JSONConstants.SETBREAKPOINT)) {
- handleSetBreakpointRequest(request, response);
- } else if (command.equals(JSONConstants.CLEARBREAKPOINT)) {
- handleClearBreakpointRequest(request, response);
- } else {
- response.setSuccess(false);
- response.setMessage("command not supported"); //$NON-NLS-1$
- }
- } catch (Throwable t) {
- response.setSuccess(false);
- response.setMessage(t.getClass().getName() + " - " + t.getMessage()); //$NON-NLS-1$
- t.printStackTrace();
- }
- return response;
- }
-
- /**
- * Handles a clear breakpoint request
- *
- * @param request
- * @param response
- */
- private void handleClearBreakpointRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long breakpointId = numberToLong((Number) arguments.get(JSONConstants.BREAKPOINT_ID));
- if (breakpointId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.BREAKPOINT_ID));
- return;
- }
- Breakpoint breakpoint = debugger.clearBreakpoint(breakpointId);
- if (breakpoint == null) {
- response.setSuccess(false);
- response.setMessage(JSONConstants.NOT_FOUND);
- return;
- }
- response.getBody().put(JSONConstants.BREAKPOINT, breakpoint.toJSON());
- }
-
- /**
- * Handles a set breakpoint request
- *
- * @param request
- * @param response
- */
- private void handleSetBreakpointRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long scriptId = numberToLong((Number) arguments.get(JSONConstants.SCRIPT_ID));
- Integer line = numberToInteger((Number) arguments.get(JSONConstants.LINE));
- String function = (String) arguments.get(JSONConstants.FUNCTION);
- Long threadId = numberToLong((Number) arguments.get(JSONConstants.THREAD_ID));
- String condition = (String) arguments.get(JSONConstants.CONDITION);
- Breakpoint breakpoint = debugger.setBreakpoint(scriptId, line, function, condition, threadId);
- if(breakpoint != null) {
- response.getBody().put(JSONConstants.BREAKPOINT, breakpoint.toJSON());
- }
- }
-
- /**
- * Handles a breakpoint request
- *
- * @param request
- * @param response
- */
- private void handleBreakpointRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long breakpointId = numberToLong((Number) arguments.get(JSONConstants.BREAKPOINT_ID));
- if (breakpointId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.BREAKPOINT_ID));
- return;
- }
- Breakpoint breakpoint = debugger.getBreakpoint(breakpointId);
- if (breakpoint == null) {
- response.setSuccess(false);
- response.setMessage(JSONConstants.NOT_FOUND);
- return;
- }
- response.getBody().put(JSONConstants.BREAKPOINT, breakpoint.toJSON());
- }
-
- /**
- * Handles a breakpoints request
- *
- * @param request
- * @param response
- */
- private void handleBreakpointsRequest(Request request, Response response) {
- Collection breakpoints = debugger.getBreakpoints();
- response.getBody().put(JSONConstants.BREAKPOINTS, breakpoints);
- }
-
- /**
- * Handles an evaluate request
- *
- * @param request
- * @param response
- */
- private void handleEvaluateRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long threadId = numberToLong((Number) arguments.get(JSONConstants.THREAD_ID));
- if (threadId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.THREAD_ID));
- return;
- }
- Long frameId = numberToLong((Number) arguments.get(JSONConstants.FRAME_ID));
- if (frameId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.FRAME_ID));
- return;
- }
- String evaluate = (String) arguments.get(JSONConstants.EXPRESSION);
- if (evaluate == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.EXPRESSION));
- return;
- }
- StackFrame frame = debugger.getFrame(threadId, frameId);
- if (frame == null) {
- response.setSuccess(false);
- response.setMessage(JSONConstants.NOT_FOUND);
- return;
- }
- Object result = frame.evaluate(evaluate);
- response.getBody().put(JSONConstants.EVALUATE, result);
- }
-
- /**
- * Handles a lookup request
- *
- * @param request
- * @param response
- */
- private void handleLookupRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long threadId = numberToLong((Number) arguments.get(JSONConstants.THREAD_ID));
- if (threadId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.THREAD_ID));
- return;
- }
- Long frameId = numberToLong((Number) arguments.get(JSONConstants.FRAME_ID));
- if (frameId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.FRAME_ID));
- return;
- }
- Long handle = numberToLong((Number) arguments.get(JSONConstants.HANDLE));
- if (handle == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.HANDLE));
- return;
- }
- StackFrame frame = debugger.getFrame(threadId, frameId);
- if (frame == null) {
- response.setSuccess(false);
- response.setMessage(JSONConstants.NOT_FOUND);
- return;
- }
- Object result = frame.lookup(handle);
- response.getBody().put(JSONConstants.LOOKUP, result);
- }
-
- /**
- * Handles a script request
- *
- * @param request
- * @param response
- */
- private void handleScriptRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long scriptId = numberToLong((Number) arguments.get(JSONConstants.SCRIPT_ID));
- if (scriptId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.SCRIPT_ID));
- return;
- }
- ScriptSource script = debugger.getScript(scriptId);
- if (script == null) {
- response.setSuccess(false);
- response.setMessage(JSONConstants.NOT_FOUND);
- return;
- }
- response.getBody().put(JSONConstants.SCRIPT, script.toJSON());
- }
-
- /**
- * Handles a scripts request
- *
- * @param request
- * @param response
- */
- private void handleScriptsRequest(Request request, Response response) {
- List scriptIds = debugger.getScriptIds();
- response.getBody().put(JSONConstants.SCRIPTS, scriptIds);
- }
-
- /**
- * Handles a frame request
- *
- * @param request
- * @param response
- */
- private void handleFrameRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long threadId = numberToLong((Number) arguments.get(JSONConstants.THREAD_ID));
- if (threadId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.THREAD_ID));
- return;
- }
- Long frameId = numberToLong((Number) arguments.get(JSONConstants.FRAME_ID));
- if (frameId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.FRAME_ID));
- return;
- }
- StackFrame frame = debugger.getFrame(threadId, frameId);
- if (frame == null) {
- response.setSuccess(false);
- response.setMessage(JSONConstants.NOT_FOUND);
- return;
- }
- response.getBody().put(JSONConstants.FRAME, frame.toJSON());
- }
-
- /**
- * Handles a frames request
- *
- * @param request
- * @param response
- */
- private void handleFramesRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long threadId = numberToLong((Number) arguments.get(JSONConstants.THREAD_ID));
- if (threadId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.THREAD_ID));
- return;
- }
- List frameIds = debugger.getFrameIds(threadId);
- response.getBody().put(JSONConstants.FRAMES, frameIds);
- }
-
- /**
- * Handles a thread request
- *
- * @param request
- * @param response
- */
- private void handleThreadRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long threadId = numberToLong((Number) arguments.get(JSONConstants.THREAD_ID));
- if (threadId == null) {
- response.setSuccess(false);
- response.setMessage(missingArgument(JSONConstants.THREAD_ID));
- return;
- }
- ThreadData threadData = debugger.getThreadData(threadId);
- if (threadData == null) {
- response.setSuccess(false);
- response.setMessage(JSONConstants.NOT_FOUND);
- return;
- }
- response.getBody().put(JSONConstants.THREAD, threadData.toJSON());
- }
-
- /**
- * Reports a missing argument
- *
- * @param key
- * @return
- */
- private String missingArgument(String key) {
- // TODO NLS this
- return "Missing Argument: "+key; //$NON-NLS-1$
- }
-
- /**
- * Handles a threads request
- *
- * @param request
- * @param response
- */
- private void handleThreadsRequest(Request request, Response response) {
- List threadIds = debugger.getThreadIds();
- response.getBody().put(JSONConstants.THREADS, threadIds);
- }
-
- /**
- * Handles a dispose request by disconnecting the underlying {@link RhinoDebuggerImpl}
- *
- * @param request
- * @param response
- */
- private void handleDisposeRequest(Request request, Response response) {
- debugger.disconnect();
- }
-
- /**
- * Handles a continue request
- *
- * @param request
- * @param response
- */
- private void handleContinueRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long threadId = numberToLong((Number) arguments.get(JSONConstants.THREAD_ID));
- if (threadId == null) {
- debugger.resumeAll();
- return;
- }
- String stepType = (String) arguments.get(JSONConstants.STEP);
- debugger.resume(threadId, stepType);
- }
-
- /**
- * Handles a suspend request
- *
- * @param request
- * @param response
- */
- private void handleSuspendRequest(Request request, Response response) {
- Map arguments = request.getArguments();
- Long threadId = numberToLong((Number) arguments.get(JSONConstants.THREAD_ID));
- if (threadId == null) {
- debugger.suspendAll();
- return;
- }
- debugger.suspend(threadId);
- }
-
- /**
- * Wrappers the given {@link Number} as a {@link Long}
- *
- * @param number
- * @return a new {@link Long}
- */
- private static Long numberToLong(Number number) {
- if (number == null)
- return null;
- return new Long(number.longValue());
- }
-
- /**
- * Wrappers the given {@link Number} as an {@link Integer}
- *
- * @param number
- * @return a new {@link Integer}
- */
- private Integer numberToInteger(Number number) {
- if (number == null) {
- return null;
- }
- return new Integer(number.intValue());
- }
-
- /**
- * Appends version infos to the given response body
- *
- * @param request
- * @param response
- *
- * @see JSONConstants#ECMASCRIPT_VERSION
- * @see JSONConstants#JAVASCRIPT_VERSION
- * @see JSONConstants#VM_NAME
- * @see JSONConstants#VM_VENDOR
- * @see JSONConstants#VM_VERSION
- */
- private void handleVersionRequest(Request request, Response response) {
- Map body = response.getBody();
- body.put(JSONConstants.JAVASCRIPT_VERSION, VERSION_1_6);
- body.put(JSONConstants.ECMASCRIPT_VERSION, "3"); //$NON-NLS-1$
- body.put(JSONConstants.VM_NAME, "Rhino"); //$NON-NLS-1$
- body.put(JSONConstants.VM_VERSION, VERSION_1_6);
- body.put(JSONConstants.VM_VENDOR, "Mozilla"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/RhinoDebuggerImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/RhinoDebuggerImpl.java
deleted file mode 100644
index ea66902..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/RhinoDebuggerImpl.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.EventPacket;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONUtil;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TransportService;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.ContextFactory;
-import org.mozilla.javascript.debug.DebugFrame;
-import org.mozilla.javascript.debug.DebuggableScript;
-import org.mozilla.javascript.debug.Debugger;
-
-/**
- * Rhino implementation of {@link Debugger}
- * <br><br>
- * Events fired:
- * <ul>
- * <li><b>Thread enter event</b> - when a new context is created see: {@link #contextCreated(Context)}</li>
- * <li><b>Thread exit event</b> - when a context is exited see: {@link #contextReleased(Context)}</li>
- * <li><b>VM death event</b> - if the debugger dies: this event can only be received if the underlying communication channel has not been interrupted</li>
- * </ul>
- * @since 1.0
- */
-public class RhinoDebuggerImpl implements Debugger, ContextFactory.Listener {
-
- public static final DebuggableScript[] NO_SCRIPTS = new DebuggableScript[0];
- private static final String RHINO_SCHEME = "rhino"; //$NON-NLS-1$
-
- private final Map threadToThreadId = new HashMap();
- private final Map threadIdToData = new HashMap();
- private final Map breakpoints = new HashMap();
-
- private long currentThreadId = 0L;
- private long currentBreakpointId = 0L;
- private long currentScriptId = 0L;
- private ArrayList disabledThreads = new ArrayList();
-
- /**
- * Mapping of the URI string to the {@link ScriptSource}
- */
- private HashMap/*<String, ScriptSource>*/ uriToScript = new HashMap();
- /**
- * Mapping of the id to the {@link ScriptSource}
- */
- private HashMap/*<Long, ScriptSource>*/ idToScript = new HashMap();
-
- private final DebugSessionManager sessionManager;
-
- /**
- * This constructor will only accept a <code>transport</code> argument
- * of <code>socket</code>. I.e. <code>transport=socket</code>.<br><br>
- *
- * To use a differing {@link TransportService} pleas use the other constructor:
- * {@link #RhinoDebugger(TransportService, String, boolean)}
- *
- * @param configString the configuration string, for example: <code>transport=socket,suspend=y,address=9000</code>
- */
- public RhinoDebuggerImpl(String configString) {
- sessionManager = DebugSessionManager.create(configString);
- }
-
- /**
- * This constructor allows you to specify a custom {@link TransportService} to use other than <code>socket</code>.
- *
- * @param transportService the {@link TransportService} to use for debugger communication
- * @param address the address to communicate on
- * @param startSuspended if the debugger should wait while accepting a connection. The wait time for stating suspended is not indefinite,
- * and is equal to 300000ms.
- */
- public RhinoDebuggerImpl(TransportService transportService, String address, boolean startSuspended) {
- sessionManager = new DebugSessionManager( transportService, address, startSuspended);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.debug.Debugger#getFrame(org.mozilla.javascript.Context, org.mozilla.javascript.debug.DebuggableScript)
- */
- public synchronized DebugFrame getFrame(Context context, DebuggableScript debuggableScript) {
- ScriptSource script = getScript(debuggableScript);
- if(script != null && !script.isStdIn()) {
- ContextData contextData = (ContextData) context.getDebuggerContextData();
- ThreadData thread = (ThreadData) threadIdToData.get(contextData.getThreadId());
- FunctionSource function = script.getFunction(debuggableScript);
- return thread.getFrame(context, function, script);
- }
- return null;
- }
-
- /**
- * Returns the root {@link ScriptSource} context
- *
- * @param script
- * @return the root {@link ScriptSource} context
- */
- private ScriptSource getScript(DebuggableScript script) {
- synchronized (uriToScript) {
- DebuggableScript root = script;
- while (!root.isTopLevel()) {
- root = root.getParent();
- }
- URI uri = getSourceUri(root, parseSourceProperties(root.getSourceName()));
- if(uri != null) {
- return (ScriptSource) uriToScript.get(uri);
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.debug.Debugger#handleCompilationDone(org.mozilla.javascript.Context, org.mozilla.javascript.debug.DebuggableScript, java.lang.String)
- */
- public void handleCompilationDone(Context context, DebuggableScript script, String source) {
- if (!script.isTopLevel()) {
- return;
- }
- Map properties = parseSourceProperties(script.getSourceName());
- URI uri = getSourceUri(script, properties);
- if(uri == null) {
- //if the source cannot be located don't load or notify
- return;
- }
- final ScriptSource newscript = new ScriptSource(script, source, uri, script.isGeneratedScript(), properties);
- synchronized (uriToScript) {
- ScriptSource old = (ScriptSource) uriToScript.remove(uri);
- Long id = null;
- if(old != null) {
- //recycle the id for a re-loaded script
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=306832
- id = old.getId();
- idToScript.remove(old.getId());
- newscript.clone(old);
- }
- else {
- //a totally new script is loaded
- id = scriptId();
- newscript.setId(id);
- }
- uriToScript.put(uri, newscript);
- idToScript.put(id, newscript);
- }
- ContextData contextData = (ContextData) context.getDebuggerContextData();
- contextData.scriptLoaded(newscript);
- }
-
- /**
- * Composes a {@link URI} representing the path to the source of the given script
- *
- * @param script the script to create a {@link URI} for
- * @param properties any special properties @see {@link #parseSourceProperties(String)}
- * @return the {@link URI} for the source or <code>null</code>
- */
- private URI getSourceUri(DebuggableScript script, Map properties) {
- String sourceName = script.getSourceName();
- if(properties != null) {
- String jsonName = (String) properties.get(JSONConstants.NAME);
- if (jsonName != null)
- sourceName = jsonName;
- }
-
- // handle null sourceName
- if (sourceName == null)
- return null;
-
- // handle input from the Rhino Shell
- if (sourceName.equals("<stdin>")) { //$NON-NLS-1$
- sourceName = "stdin"; //$NON-NLS-1$
- } else {
- // try to parse it as a file
- File sourceFile = new File(sourceName);
- if (sourceFile.exists())
- return sourceFile.toURI();
-
- //try to just create a URI from the name
- try {
- return new URI(sourceName);
- } catch(URISyntaxException e) {
- //do nothing and fall through
- }
- }
-
- //fall back to creating a rhino specific URI from the script source name as a path
- try {
- if (! (sourceName.charAt(0) == '/'))
- sourceName = "/" + sourceName; //$NON-NLS-1$
- return new URI(RHINO_SCHEME, null, sourceName, null);
- } catch (URISyntaxException e) {
- return null;
- }
- }
-
- /**
- * Returns any special properties specified in the source name or <code>null</code>
- *
- * @param sourceName
- * @return any special properties specified in the source name or <code>null</code>
- */
- Map parseSourceProperties(String sourceName) {
- if (sourceName != null && sourceName.charAt(0) == '{') {
- try {
- Object json = JSONUtil.read(sourceName);
- if (json instanceof Map) {
- return (Map) json;
- }
- } catch (RuntimeException e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Returns the next script id to use
- *
- * @return the next id
- */
- synchronized Long scriptId() {
- return new Long(currentScriptId++);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.ContextFactory.Listener#contextCreated(org.mozilla.javascript.Context)
- */
- public synchronized void contextCreated(Context context) {
- Thread thread = Thread.currentThread();
- if (disabledThreads.contains(thread)) {
- return;
- }
- Long threadId = (Long) threadToThreadId.get(thread);
- if (threadId == null) {
- threadId = new Long(currentThreadId++);
- threadToThreadId.put(thread, threadId);
- }
- ThreadData threadData = (ThreadData) threadIdToData.get(threadId);
- if (threadData == null) {
- threadData = new ThreadData(threadId, this);
- threadIdToData.put(threadId, threadData);
- sendThreadEvent(JSONConstants.ENTER, threadId);
- }
- threadData.contextCreated(context);
- }
-
- /**
- * Sends a thread event for the given type
- *
- * @param type the type of event to send
- * @param threadId the id of the thread the even is for
- *
- * @see JSONConstants#ENTER
- * @see JSONConstants#EXIT
- */
- private void sendThreadEvent(String type, Long threadId) {
- EventPacket threadEvent = new EventPacket(JSONConstants.THREAD);
- Map body = threadEvent.getBody();
- body.put(JSONConstants.TYPE, type);
- body.put(JSONConstants.THREAD_ID, threadId);
- sendEvent(threadEvent);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.ContextFactory.Listener#contextReleased(org.mozilla.javascript.Context)
- */
- public synchronized void contextReleased(Context context) {
- Thread thread = Thread.currentThread();
- if (disabledThreads.contains(thread)) {
- return;
- }
- Long threadId = (Long) threadToThreadId.get(thread);
- if (threadId == null) {
- return;
- }
- ThreadData threadData = (ThreadData) threadIdToData.get(threadId);
- threadData.contextReleased(context);
- if (!threadData.hasContext()) {
- threadToThreadId.remove(thread);
- threadIdToData.remove(threadId);
- sendThreadEvent(JSONConstants.EXIT, threadId);
- }
- }
-
- /**
- * Resumes a thread with the given id for the given step type. Has no effect if no such thread exists
- *
- * @param threadId
- * @param stepType
- */
- public synchronized void resume(Long threadId, String stepType) {
- ThreadData threadData = (ThreadData) threadIdToData.get(threadId);
- if (threadData != null) {
- threadData.resume(stepType);
- }
- }
-
- /**
- * Resumes all threads currently in the debugger
- */
- public synchronized void resumeAll() {
- for (Iterator it = threadIdToData.keySet().iterator(); it.hasNext();) {
- Long threadId = (Long) it.next();
- resume(threadId, null);
- }
- }
-
- /**
- * Suspend the thread with the given id. Has no effect if no such thread exists
- *
- * @param threadId
- */
- public synchronized void suspend(Long threadId) {
- ThreadData threadData = (ThreadData) threadIdToData.get(threadId);
- if (threadData != null) {
- threadData.suspend();
- }
- }
-
- /**
- * Suspend all threads currently in the debugger
- */
- public synchronized void suspendAll() {
- for (Iterator it = threadIdToData.keySet().iterator(); it.hasNext();) {
- Long threadId = (Long) it.next();
- suspend(threadId);
- }
- }
-
- /**
- * Disconnects the debugger
- */
- public void disconnect() {
- }
-
- /**
- * Returns all of the stack frame ids for the thread with the given id. Returns an empty list if no such thread exists, never <code>null</code>
- *
- * @param threadId
- * @return the complete list of stack frame ids from the thread with the given id
- */
- public synchronized List getFrameIds(Long threadId) {
- ThreadData threadData = (ThreadData) threadIdToData.get(threadId);
- if (threadData == null) {
- return Collections.EMPTY_LIST;
- }
- return threadData.getFrameIds();
- }
-
- /**
- * Returns a {@link DebugFrame} with the given id from the thread with the given thread id. Returns <code>null</code> if the no such thread exists with the given id and / or no such {@link DebugFrame} exists with the given id
- *
- * @param threadId
- * @param frameId
- * @return the {@link DebugFrame} with the given id from the thread with the given id
- */
- public synchronized StackFrame getFrame(Long threadId, Long frameId) {
- ThreadData threadData = (ThreadData) threadIdToData.get(threadId);
- if (threadData != null) {
- return threadData.getFrame(frameId);
- }
- return null;
- }
-
- /**
- * @return the ids of all of the scripts currently known to the debugger
- */
- public synchronized List getScriptIds() {
- return new ArrayList(idToScript.keySet());
- }
-
- /**
- * Returns the script with the given id or <code>null</code> if no such script exists with the given id
- *
- * @param scriptId
- * @return the script with the given id or <code>null</code>
- */
- public synchronized ScriptSource getScript(Long scriptId) {
- return (ScriptSource) idToScript.get(scriptId);
- }
-
- /**
- * @return the complete collection of breakpoints currently known to the debugger
- */
- public synchronized Collection getBreakpoints() {
- return breakpoints.keySet();
- }
-
- /**
- * Creates a breakpoint in the script with the given id and the given breakpoint attributes.
- * Returns the new breakpoint or <code>null</code> if:
- * <ul>
- * <li>no such script exists with the given id</li>
- * <li>the given line number is not a valid line number</li>
- * </ul>
- * <p>
- * If a breakpoint already exists at the given location it is removed and the new breakpoint is set.
- * </p>
- * @param scriptId
- * @param lineNumber
- * @param functionName
- * @param condition
- * @param threadId
- * @return the new breakpoint or <code>null</code> if no script exists with the given id
- */
- public synchronized Breakpoint setBreakpoint(Long scriptId, Integer lineNumber, String functionName, String condition, Long threadId) {
- ScriptSource script = (ScriptSource) idToScript.get(scriptId);
- if (script == null || !script.isValid(lineNumber, functionName)) {
- return null;
- }
-
-
- Breakpoint newbreakpoint = new Breakpoint(nextBreakpointId(), script, lineNumber, functionName, condition, threadId);
- Breakpoint oldbp = script.getBreakpoint(lineNumber, functionName);
- if(oldbp != null) {
- breakpoints.remove(oldbp.breakpointId);
- }
- breakpoints.put(newbreakpoint.breakpointId, newbreakpoint);
- script.addBreakpoint(newbreakpoint);
- return newbreakpoint;
- }
-
- /**
- * @return the next unique breakpoint id to use
- */
- private synchronized Long nextBreakpointId() {
- return new Long(currentBreakpointId++);
- }
-
- /**
- * Clears the breakpoint out of the cache with the given id and returns it. Returns <code>null</code> if no breakpoint exists with the given id.
- *
- * @param breakpointId
- * @return the removed breakpoint or <code>null</code>
- */
- public synchronized Breakpoint clearBreakpoint(Long breakpointId) {
- Breakpoint breakpoint = (Breakpoint) breakpoints.remove(breakpointId);
- if (breakpoint != null) {
- breakpoint.delete();
- }
- return breakpoint;
- }
-
- /**
- * Sends the given {@link EventPacket} using the underlying {@link DebugRuntime} and returns if it was sent successfully
- *
- * @param event
- * @return true if the event was sent successfully, false otherwise
- */
- public boolean sendEvent(EventPacket event) {
- return sessionManager.sendEvent(event);
- }
-
- /**
- * Gets a breakpoint with the given id, returns <code>null</code> if no such breakpoint exists with the given id
- *
- * @param breakpointId
- * @return the breakpoint with the given id or <code>null</code>
- */
- public Breakpoint getBreakpoint(Long breakpointId) {
- return (Breakpoint) breakpoints.get(breakpointId);
- }
-
- /**
- * Gets the thread for the thread with the given id, returns <code>null</code> if no such thread exists with the goven id
- *
- * @param threadId
- * @return the thread data for the thread with the given id or <code>null</code>
- */
- public synchronized ThreadData getThreadData(Long threadId) {
- return (ThreadData) threadIdToData.get(threadId);
- }
-
- /**
- * @return the complete list of thread ids known to the debugger
- */
- public synchronized List getThreadIds() {
- return new ArrayList(threadIdToData.keySet());
- }
-
- /**
- * Caches the current thread as disabled
- */
- public synchronized void disableThread() {
- disabledThreads.add(Thread.currentThread());
- }
-
- /**
- * Removes the current thread as being disabled
- */
- public synchronized void enableThread() {
- disabledThreads.remove(Thread.currentThread());
- }
-
- public void start() {
- sessionManager.start(this);
- }
-
- public void stop() {
- sessionManager.stop();
- }
-
- /**
- * Returns if a {@link DebugSession} has successfully connected to this debugger.
- *
- * @return <code>true</code> if the debugger has a connected {@link DebugSession} <code>false</code> otherwise
- */
- public boolean isConnected() {
- return sessionManager.isConnected();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ScriptSource.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ScriptSource.java
deleted file mode 100644
index b551bc1..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ScriptSource.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Constants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.mozilla.javascript.debug.DebuggableScript;
-
-/**
- * Rhino script implementation
- *
- * @since 1.0
- */
-public class ScriptSource {
-
- /**
- * No line information
- */
- static final LineData[] NO_LINES = new LineData[0];
-
- /**
- * The id of the script
- */
- private Long scriptId;
- /**
- * Any special source properties to consider
- */
- private final Map properties;
- /**
- * The backing source String that was compiled to give us this proxy
- */
- private final String source;
- /**
- * If this {@link ScriptSource} was generated
- */
- private final boolean generated;
- /**
- * The ordered list of function names
- */
- private ArrayList functionNames = null;
-
- private Integer firstLine = null;
-
- /**
- * The location of the script
- */
- private URI uri = null;
- /**
- * The array of cached {@link FunctionSource}s
- */
- private FunctionSource[] functionSources = null;
- /**
- * Sparse array of line information. This array only has entries present for
- * lines that are returned
- */
- private LineData[] lines = null;
- /**
- * Mapping of the {@link DebuggableScript} backing the FunctionSource to the FunctionSource handle
- */
- private HashMap/*<DebuggableScript, FunctionSource>*/ scriptToFunction = new HashMap();
-
- /**
- * Constructor
- *
- * @param scriptId
- * @param debuggableScript
- * @param source
- */
- public ScriptSource(DebuggableScript script, String source, URI uri, boolean generated, Map properties) {
- this.uri = uri;
- this.source = source;
- this.properties = properties;
- this.generated = generated;
-
- if(isStdIn()) {
- //do not compute line data
- return;
- }
- int[] rootlines = script.getLineNumbers();
- DebuggableScript[] functions = collectFunctions(script);
- int flength = functions.length;
- int max = 0;
- int min = Integer.MAX_VALUE;
- HashSet lineNumbers = new HashSet(flength+rootlines.length+1);
- //dump in the line #'s from the root script
- for (int i = 0; i < rootlines.length; i++) {
- int line = rootlines[i];
- if(line > max) {
- max = line;
- }
- if(line < min) {
- min = line;
- }
- lineNumbers.add(new Integer(line));
- }
- //dump in the line numbers from the expanded set of functions
- if(flength > 0) {
- functionSources = new FunctionSource[flength];
- functionNames = new ArrayList(flength);
-
- int start = 0, end = 0;;
- for (int i = 0; i < functions.length; i++) {
- int[] lines = functions[i].getLineNumbers();
- if(lines != null && lines.length > 0) {
- start = lines[0] + 1;
- for (int j = 0; j < lines.length; j++) {
- int currentLine = lines[j];
- if(currentLine > max) {
- max = currentLine;
- }
- if(currentLine < min) {
- min = currentLine;
- }
- if (currentLine < start) {
- start = currentLine;
- }
- else if(currentLine > end) {
- end = currentLine;
- }
- lineNumbers.add(new Integer(currentLine));
- }
- }
- String name = functions[i].getFunctionName();
- name = (name == null ? Constants.EMPTY_STRING : name);
- functionSources[i] = new FunctionSource(this, name, computeFunctionSource(0, 0, source), start);
- functionNames.add(name);
- scriptToFunction.put(functions[i], functionSources[i]);
- start = 0;
- }
- }
- //create the sparse array and populate the valid line numbers
- if(max == 0) {
- this.lines = NO_LINES;
- }
- else {
- this.lines = new LineData[max+1];
- for (Iterator iter = lineNumbers.iterator(); iter.hasNext();) {
- Integer value = (Integer) iter.next();
- this.lines[value.intValue()] = new LineData();
- iter.remove();
- }
- lineNumbers = null;
- }
- this.firstLine = new Integer(min);
- }
-
- /**
- * Returns the first executable line in the script
- *
- * @return the first executable line in the script
- */
- public Integer firstLine() {
- return this.firstLine;
- }
-
- /**
- * @return if this script represents the stdin script
- */
- public boolean isStdIn() {
- return this.uri.toString().endsWith("stdin"); //$NON-NLS-1$
- }
-
- /**
- * Collects all of the {@link DebuggableScript} objects for the functions
- * @param root the root script
- * @return the collected array of functions - {@link DebuggableScript} - objects or an empty array
- */
- DebuggableScript[] collectFunctions(DebuggableScript root) {
- ArrayList functions = new ArrayList();
- collectFunctions(root, functions);
- int size = functions.size();
- if(size < 1) {
- return RhinoDebuggerImpl.NO_SCRIPTS;
- }
- DebuggableScript[] funcs = new DebuggableScript[size];
- functions.toArray(funcs);
- return funcs;
- }
-
- /**
- * Recursively collects function {@link DebuggableScript}s
- *
- * @param root
- * @param collector
- */
- void collectFunctions(DebuggableScript root, List collector) {
- if(root.isFunction()) {
- collector.add(root);
- }
- for (int i = 0; i < root.getFunctionCount(); i++) {
- collectFunctions(root.getFunction(i), collector);
- }
- }
-
- /**
- * Computes the functions' source from the given compiled buffer
- *
- * @param start
- * @param end
- * @param source
- * @return the string for the source or <code>null</code> if it could not be computed
- */
- String computeFunctionSource(int start, int end, String source) {
- if(start > -1 && end <= source.length()) {
- return source.substring(start, end);
- }
- return null;
- }
-
- /**
- * Sets the id for the script, <code>null</code> will throw and {@link IllegalArgumentException}
- * @param id
- * @throws IllegalArgumentException if <code>null</code> is specified as the new id
- */
- public void setId(Long id) throws IllegalArgumentException {
- if(id == null) {
- throw new IllegalArgumentException();
- }
- this.scriptId = id;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if(obj instanceof ScriptSource) {
- return this.uri.toString().equals(((ScriptSource)obj).uri.toString());
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return this.uri.toString().hashCode();
- }
-
- /**
- * @return a new JSON map
- */
- public Object toJSON() {
- HashMap result = new HashMap();
- result.put(JSONConstants.SCRIPT_ID, this.scriptId);
- result.put(JSONConstants.LOCATION, this.uri.toString());
- result.put(JSONConstants.PROPERTIES, properties);
- result.put(JSONConstants.SOURCE, source);
- result.put(JSONConstants.GENERATED, Boolean.valueOf(generated));
- if(lines != null) {
- HashSet lineNumbers = new HashSet();
- for (int i = 0; i < lines.length; i++) {
- if(lines[i] != null) {
- lineNumbers.add(new Integer(i));
- }
- }
- result.put(JSONConstants.LINES, (lineNumbers == null ? Collections.EMPTY_SET : lineNumbers));
- }
- else {
- result.put(JSONConstants.LINES, Collections.EMPTY_SET);
- }
- result.put(JSONConstants.FUNCTIONS, (functionNames == null ? Collections.EMPTY_LIST : functionNames));
- return result;
- }
-
- /**
- * @return the id for this script object
- */
- public Long getId() {
- return scriptId;
- }
-
- /**
- * Returns the {@link Breakpoint} at the given line number or <code>null</code>
- * if there isn't one
- * @param lineNumber
- * @return
- */
- public Breakpoint getBreakpoint(Integer line, String functionName) {
- synchronized (lines) {
- if(line != null) {
- int value = line.intValue();
- if (value > -1 && value < lines.length && lines[value] != null) {
- return lines[value].breakpoint;
- }
- }
- if(functionNames != null) {
- int index = functionNames.indexOf(functionName);
- FunctionSource func = functionAt(index);
- if(func != null && lines[func.linenumber()] != null) {
- return lines[func.linenumber()].breakpoint;
- }
- }
- return null;
- }
- }
-
- /**
- * Returns if the line number is valid wrt this script
- *
- * @param lineNumber
- * @param functionName
- * @return true if the line number is valid wrt this script
- */
- public boolean isValid(Integer line, String functionName) {
- synchronized (lines) {
- if(line != null) {
- int value = line.intValue();
- if (value > -1 && value < lines.length) {
- return lines[value] != null;
- }
- }
- if(functionNames != null) {
- int index = functionNames.indexOf(functionName);
- FunctionSource func = functionAt(index);
- if(func != null) {
- return lines[func.linenumber()] != null;
- }
- }
- }
- return false;
- }
-
- /**
- * Copies items from the given object to this one
- * @param script
- */
- public void clone(ScriptSource script) {
- this.scriptId = script.scriptId;
- this.lines = script.lines;
- }
-
- /**
- * Adds a breakpoint to this script
- *
- * @param breakpoint
- */
- public void addBreakpoint(Breakpoint breakpoint) {
- synchronized (lines) {
- Integer lineNumber = breakpoint.lineNumber;
- if(lineNumber != null) {
- int value = lineNumber.intValue();
- if(lines[value] != null) {
- lines[value].breakpoint = breakpoint;
- }
- }
- else if(functionNames != null) {
- int index = functionNames.indexOf(breakpoint.functionName);
- FunctionSource func = functionAt(index);
- if(func != null) {
- if(lines[func.linenumber] != null) {
- lines[func.linenumber].breakpoint = breakpoint;
- }
- }
- }
- }
- }
-
- /**
- * Removes a breakpoint from this script
- *
- * @param breakpoint
- */
- public void removeBreakpoint(Breakpoint breakpoint) {
- synchronized (lines) {
- Integer lineNumber = breakpoint.lineNumber;
- if(lineNumber != null) {
- int value = lineNumber.intValue();
- if(lines[value] != null) {
- lines[value].breakpoint = null;
- }
- }
- else if(functionNames != null) {
- int index = functionNames.indexOf(breakpoint.functionName);
- FunctionSource func = functionAt(index);
- if(func != null) {
- if(lines[func.linenumber] != null) {
- lines[func.linenumber].breakpoint = null;
- }
- }
- }
- }
- }
-
- /**
- * @return the string location of this script
- */
- public String getLocation() {
- return this.uri.toString();
- }
-
- /**
- * Returns the {@link FunctionSource} at the given position iff the given index
- * is within the bounds of the sources array.
- *
- * @param index
- * @return the {@link FunctionSource} at the given index or <code>null</code>
- */
- public FunctionSource functionAt(int index) {
- synchronized (functionSources) {
- if(functionSources != null && (index < functionSources.length && index > -1)) {
- return functionSources[index];
- }
- }
- return null;
- }
-
- /**
- * Returns the {@link FunctionSource} for the given {@link DebuggableScript}
- *
- * @param script
- * @return the {@link FunctionSource} for the given {@link DebuggableScript} or <code>null</code>
- */
- public FunctionSource getFunction(DebuggableScript script) {
- synchronized (scriptToFunction) {
- return (FunctionSource) scriptToFunction.get(script);
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("ScriptSource: [id - ").append(scriptId).append("] [uri - ").append(uri.toString()).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- buffer.append("[generated - ").append(generated).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
- if(lines != null) {
- buffer.append("\tline numbers: {"); //$NON-NLS-1$
- for (int i = 0; i < lines.length; i++) {
- if(lines[i] != null) {
- buffer.append(i);
- if(i < lines.length-1) {
- buffer.append(", "); //$NON-NLS-1$
- }
- }
- }
- buffer.append("}\n"); //$NON-NLS-1$
- }
- if(functionNames != null) {
- buffer.append("\tfunction names: {"); //$NON-NLS-1$
- for (int i = 0; i < functionNames.size(); i++) {
- buffer.append(functionNames.get(i));
- if(i < functionNames.size()-1) {
- buffer.append(", "); //$NON-NLS-1$
- }
- }
- buffer.append("}\n"); //$NON-NLS-1$
- }
- if(functionSources != null) {
- buffer.append("\tfunction sources:\n"); //$NON-NLS-1$
- for (int i = 0; i < functionSources.length; i++) {
- buffer.append(functionSources[i]).append("\n"); //$NON-NLS-1$
- }
- }
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/StackFrame.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/StackFrame.java
deleted file mode 100644
index 22c6def..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/StackFrame.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.mozilla.javascript.BaseFunction;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.EcmaError;
-import org.mozilla.javascript.NativeArray;
-import org.mozilla.javascript.NativeJavaObject;
-import org.mozilla.javascript.Script;
-import org.mozilla.javascript.ScriptRuntime;
-import org.mozilla.javascript.Scriptable;
-import org.mozilla.javascript.ScriptableObject;
-import org.mozilla.javascript.Undefined;
-import org.mozilla.javascript.debug.DebugFrame;
-import org.mozilla.javascript.debug.DebuggableObject;
-import org.mozilla.javascript.debug.Debugger;
-
-/**
- * Rhino implementation of {@link DebugFrame}
- *
- * @since 1.0
- */
-public class StackFrame implements DebugFrame {
-
- private final Long id;
- private final Context context;
- private final ContextData contextData;
- private final ScriptSource script;
- private FunctionSource function = null;
- private final HashMap handles = new HashMap();
- private final IdentityHashMap handledObjects = new IdentityHashMap();
- private Scriptable activation;
- private Scriptable thisObj;
- private int lineNumber;
-
- /**
- * Constructor
- *
- * @param frameId
- * @param context
- * @param debuggableScript
- * @param script
- */
- public StackFrame(Long frameId, Context context, FunctionSource function, ScriptSource script) {
- this.id = frameId;
- this.context = context;
- this.contextData = (ContextData) context.getDebuggerContextData();
- this.function = function;
- this.script = script;
- if(function != null) {
- this.lineNumber = function.linenumber();
- }
- else {
- this.lineNumber = script.firstLine().intValue();
- }
- }
-
- /**
- * Returns the id of the frame
- *
- * @return the frame id
- */
- public Long getId() {
- return id;
- }
-
- /**
- * Returns the underlying {@link Script}
- *
- * @return the underlying {@link Script}
- */
- public ScriptSource getScript() {
- return script;
- }
-
- /**
- * Returns the line number for the frame
- *
- * @return the frame line number
- */
- public Integer getLineNumber() {
- return new Integer(lineNumber);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.debug.DebugFrame#onDebuggerStatement(org.mozilla.javascript.Context)
- */
- public void onDebuggerStatement(Context cx) {
- initializeHandles();
- this.lineNumber = 1+lineNumber;
- contextData.debuggerStatement(script, new Integer(lineNumber));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.debug.DebugFrame#onEnter(org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Scriptable, java.lang.Object[])
- */
- public void onEnter(Context cx, Scriptable activation, Scriptable thisObj, Object[] args) {
- this.activation = activation;
- this.thisObj = thisObj;
- initializeHandles();
- contextData.pushFrame(this, this.script, new Integer(lineNumber), getFunctionName());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.debug.DebugFrame#onExit(org.mozilla.javascript.Context, boolean, java.lang.Object)
- */
- public void onExit(Context cx, boolean byThrow, Object resultOrException) {
- this.activation = null;
- this.thisObj = null;
- clearHandles();
- this.contextData.popFrame(byThrow, resultOrException);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.debug.DebugFrame#onExceptionThrown(org.mozilla.javascript.Context, java.lang.Throwable)
- */
- public void onExceptionThrown(Context cx, Throwable ex) {
- initializeHandles();
- this.contextData.exceptionThrown(ex);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.mozilla.javascript.debug.DebugFrame#onLineChange(org.mozilla.javascript.Context, int)
- */
- public void onLineChange(Context cx, int lineNumber) {
- if (this.lineNumber == lineNumber)
- return;
- initializeHandles();
- this.lineNumber = lineNumber;
- Integer line = new Integer(this.lineNumber);
- if(this.script.isValid(line, getFunctionName())) {
- this.contextData.lineChange(this.script, line);
- }
- }
-
- /**
- * @return the name of the function backing this frame or <code>null</code> if there is no function
- * or it has no name.
- */
- String getFunctionName() {
- return (this.function == null ? null : this.function.name());
- }
-
- /**
- * Evaluates the given source
- *
- * @param source
- * @return
- */
- public Object evaluate(String source) {
- RhinoDebuggerImpl rhinoDebugger = (RhinoDebuggerImpl) context.getDebugger();
- rhinoDebugger.disableThread();
-
- Context evalContext = context.getFactory().enter();
- Debugger debugger = evalContext.getDebugger();
- Object debuggerContextData = evalContext.getDebuggerContextData();
- evalContext.setDebugger(null, null);
- try {
- Object result = ScriptRuntime.evalSpecial(evalContext, activation, thisObj, new Object[] { source }, "eval", 0); //$NON-NLS-1$
- Long handle = createHandle(result);
- return serialize(handle, result);
- }
- catch (EcmaError ecma) {
- return null;
- }
- finally {
- evalContext.setDebugger(debugger, debuggerContextData);
- Context.exit();
- rhinoDebugger.enableThread();
- }
- }
-
- /**
- * Evaluates the given condition
- *
- * @param condition
- * @return the status of the condition evaluation
- */
- public boolean evaluateCondition(String condition) {
- RhinoDebuggerImpl rhinoDebugger = (RhinoDebuggerImpl) context.getDebugger();
- rhinoDebugger.disableThread();
-
- Context evalContext = context.getFactory().enter();
- Debugger debugger = evalContext.getDebugger();
- Object debuggerContextData = evalContext.getDebuggerContextData();
- evalContext.setDebugger(null, null);
- try {
- Object result = ScriptRuntime.evalSpecial(evalContext, activation, thisObj, new Object[] { condition }, JSONConstants.CONDITION, 0);
- return ScriptRuntime.toBoolean(result);
- } finally {
- evalContext.setDebugger(debugger, debuggerContextData);
- Context.exit();
- rhinoDebugger.enableThread();
- }
- }
-
- /**
- * Look up the given handle in the known list of handles for this frame
- *
- * @param handle
- * @return the serialized handle never <code>null</code>
- */
- public Object lookup(Long handle) {
-
- Object result = handles.get(handle);
-
- RhinoDebuggerImpl rhinoDebugger = (RhinoDebuggerImpl) context.getDebugger();
- rhinoDebugger.disableThread();
-
- Context lookupContext = context.getFactory().enter();
- Debugger debugger = lookupContext.getDebugger();
- Object debuggerContextData = lookupContext.getDebuggerContextData();
- lookupContext.setDebugger(null, null);
- try {
- return serialize(handle, result);
- } finally {
- lookupContext.setDebugger(debugger, debuggerContextData);
- Context.exit();
- rhinoDebugger.enableThread();
- }
- }
-
- /**
- * Returns a JSON map
- *
- * @return a new JSON object
- */
- public Object toJSON() {
- Map result = new HashMap();
- result.put(JSONConstants.THREAD_ID, contextData.getThreadId());
- result.put(JSONConstants.CONTEXT_ID, contextData.getId());
- result.put(JSONConstants.FRAME_ID, id);
- result.put(JSONConstants.SCRIPT_ID, script.getId());
- result.put(JSONConstants.LINE, new Integer(lineNumber));
- result.put(JSONConstants.REF, new Integer(0));
- //TODO update this
- result.put(JSONConstants.SCOPE_NAME, null);
- return result;
- }
-
- /**
- * Serializes a handle object for this frame
- *
- * @param handle
- * @param object
- * @return the serialized handle, never <code>null</code>
- */
- public Object serialize(Long handle, Object object) {
- Map result = new HashMap();
- result.put(JSONConstants.HANDLE, handle);
-
- // "undefined", "null", "boolean", "number", "string", "object", "function" or "frame"
- if (object == Undefined.instance) {
- serializeUndefined(result);
- } else if (object == null) {
- serializeNull(result);
- } else if (object instanceof Boolean) {
- serializeSimpleType(object, JSONConstants.BOOLEAN, result);
- } else if (object instanceof Number) {
- Object value = (object == ScriptRuntime.NaNobj) ? null : object;
- serializeSimpleType(value, JSONConstants.NUMBER, result);
- } else if (object instanceof String) {
- serializeSimpleType(object, JSONConstants.STRING, result);
- } else if (object instanceof Scriptable) {
- Scriptable scriptable = (Scriptable) object;
- serializeFunctionOrObject(scriptable, result);
- } else if (object == this) {
- serializeFrame(result);
- } else {
- serializeUndefined(result);
- }
- return result;
- }
-
- /**
- * Serialize the undefined value
- *
- * @param result
- * @see JSONConstants#UNDEFINED
- */
- private void serializeUndefined(Map result) {
- result.put(JSONConstants.TYPE, JSONConstants.UNDEFINED);
- }
-
- /**
- * Serialize the null value
- *
- * @param result
- * @see JSONConstants#NULL
- */
- private void serializeNull(Map result) {
- result.put(JSONConstants.TYPE, JSONConstants.NULL);
- }
-
- /**
- * Serialize the given simple type
- *
- * @param object
- * @param type
- * @param result
- */
- private void serializeSimpleType(Object object, String type, Map result) {
- result.put(JSONConstants.TYPE, type);
- result.put(JSONConstants.VALUE, object);
- }
-
- /**
- * Serialize a function or object
- *
- * @param scriptable
- * @param result
- * @see JSONConstants#FUNCTION
- * @see JSONConstants#OBJECT
- */
- private void serializeFunctionOrObject(Scriptable scriptable, Map result) {
- if (scriptable instanceof BaseFunction) {
- result.put(JSONConstants.TYPE, JSONConstants.FUNCTION);
- result.put(JSONConstants.NAME, ((BaseFunction) scriptable).getFunctionName());
- } else if (scriptable instanceof NativeArray) {
- result.put(JSONConstants.TYPE, JSONConstants.ARRAY);
- } else {
- result.put(JSONConstants.TYPE, JSONConstants.OBJECT);
- }
- result.put(JSONConstants.CLASS_NAME, scriptable.getClassName());
-
- Object constructorFunction = null;
- if (ScriptableObject.hasProperty(scriptable, JSONConstants.CONSTRUCTOR)) {
- constructorFunction = ScriptableObject.getProperty(scriptable, JSONConstants.CONSTRUCTOR);
- }
- result.put(JSONConstants.CONSTRUCTOR_FUNCTION, createRef(constructorFunction));
- result.put(JSONConstants.PROTOTYPE_OBJECT, createRef(scriptable.getPrototype()));
- if (scriptable instanceof NativeJavaObject)
- result.put(JSONConstants.PROPERTIES, createJavaObjectProperties((NativeJavaObject) scriptable));
- else
- result.put(JSONConstants.PROPERTIES, createProperties(scriptable));
- }
-
- /**
- * @param javaObject
- * @return
- */
- private Object createJavaObjectProperties(NativeJavaObject javaObject) {
- ArrayList properties = new ArrayList();
- // TODO: The problem here is Rhino treats getters and setters differently and in some cases will call these methods
- // we need to sort out what's reasonable to display without modifying state
- return properties;
- }
-
- /**
- * Serialize a frame
- *
- * @param result
- * @see JSONConstants#FRAME
- * @see JSONConstants#THIS
- */
- private void serializeFrame(Map result) {
- result.put(JSONConstants.TYPE, JSONConstants.FRAME);
- Set properties = new HashSet();
- properties.add(createProperty(JSONConstants.THIS, thisObj));
- properties.addAll(createProperties(activation));
- Scriptable parent = activation.getParentScope();
- while(parent != null) {
- properties.addAll(createProperties(parent));
- parent = parent.getParentScope();
- }
- result.put(JSONConstants.PROPERTIES, properties);
- }
-
- /**
- * Creates the list of properties from the given {@link Scriptable}
- *
- * @param scriptable
- * @return the live list of properties from the given {@link Scriptable}
- */
- private List createProperties(Scriptable scriptable) {
- ArrayList properties = new ArrayList();
- Object[] ids = scriptable.getIds();
- if (scriptable instanceof DebuggableObject) {
- HashSet arrayIds = new HashSet(Arrays.asList(ids));
- arrayIds.addAll(Arrays.asList(((DebuggableObject)scriptable).getAllIds()));
- ids = arrayIds.toArray();
- }
- for (int i = 0; i < ids.length; i++) {
- Object id = ids[i];
- Object value = null;
- if (id instanceof String) {
- value = ScriptableObject.getProperty(scriptable, (String) id);
- } else if (id instanceof Number) {
- value = ScriptableObject.getProperty(scriptable, ((Number) id).intValue());
- } else
- continue;
-
- Map property = createProperty(id, value);
- properties.add(property);
- }
- return properties;
- }
-
- /**
- * Create a new property map for the given id and value
- *
- * @param id
- * @param value
- * @return a new property map
- * @see JSONConstants#NAME
- */
- private Map createProperty(Object id, Object value) {
- Map property = createRef(value);
- property.put(JSONConstants.NAME, id);
- return property;
- }
-
- /**
- * Create a new ref map for the given object
- *
- * @param object
- * @return a new ref map
- * @see JSONConstants#REF
- */
- private Map createRef(Object object) {
- Map map = new HashMap(2);
- map.put(JSONConstants.REF, createHandle(object));
- return map;
- }
-
- /**
- * Clears all cached handles from this frame
- */
- private void clearHandles() {
- handles.clear();
- handledObjects.clear();
- }
-
- /**
- * Initializes the set of handles
- */
- private void initializeHandles() {
- if (handles.size() != 1) {
- clearHandles();
- createHandle(this);
- }
- }
-
- /**
- * Creates a new handle for the given object and caches it
- *
- * @param object
- * @return the id of the new handle
- */
- private Long createHandle(Object object) {
- Long handle = (Long) handledObjects.get(object);
- if (handle == null) {
- handle = new Long(nextHandle());
- handles.put(handle, object);
- handledObjects.put(object, handle);
- }
- return handle;
- }
-
- /**
- * @return the next handle to use when creating handles
- */
- private int nextHandle() {
- return handles.size();
- }
-
- /**
- * @return the thread id for the underlying {@link ContextData}
- */
- public Object getThreadId() {
- return contextData.getThreadId();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ThreadData.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ThreadData.java
deleted file mode 100644
index e8d25b4..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/debugger/ThreadData.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.debugger;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.debug.DebugFrame;
-
-/**
- * Rhino implementation of thread data
- *
- * @since 1.0
- */
-public class ThreadData {
-
- private final LinkedList contexts = new LinkedList();
- private final Long threadId;
- private final RhinoDebuggerImpl debugger;
-
- private long currentContextId = 0L;
- private long currentFrameId = 0L;
-
- /**
- * Constructor
- *
- * @param threadId
- * @param debugger
- */
- public ThreadData(Long threadId, RhinoDebuggerImpl debugger) {
- this.threadId = threadId;
- this.debugger = debugger;
- }
-
- /**
- * @return a JSON object for this data
- */
- public synchronized Object toJSON() {
- Map result = new HashMap();
- result.put(JSONConstants.THREAD_ID, threadId);
- if (contexts.isEmpty()) {
- result.put(JSONConstants.STATE, JSONConstants.RUNNING);
- } else {
- Context top = (Context) contexts.getFirst();
- result.put(JSONConstants.STATE, ((ContextData) top.getDebuggerContextData()).getState());
- }
- ArrayList contextIds = new ArrayList(contexts.size());
- for (Iterator iterator = contexts.iterator(); iterator.hasNext();) {
- Context context = (Context) iterator.next();
- ContextData data = (ContextData) context.getDebuggerContextData();
- contextIds.add(data.getId());
- }
- result.put(JSONConstants.CONTEXTS, contextIds);
- return result;
- }
-
- /**
- * Caches that the given context has been created
- *
- * @param context
- */
- public synchronized void contextCreated(Context context) {
- context.setGeneratingDebug(true);
- context.setOptimizationLevel(-1);
- ContextData contextData = new ContextData(threadId, new Long(currentContextId++), debugger);
- context.setDebugger(debugger, contextData);
- contexts.addFirst(context);
- }
-
- /**
- * Removes the context from the top of the stack
- *
- * @param context
- */
- public synchronized void contextReleased(Context context) {
- if(hasContext()) {
- contexts.removeFirst();
- }
- }
-
- /**
- * @return true if there are any known contexts to this thread data
- */
- public synchronized boolean hasContext() {
- return !contexts.isEmpty();
- }
-
- /**
- * Returns all of the frame ids from all of the known contexts in this thread data or an empty list, never <code>null</code>
- *
- * @return the complete list of frame ids from all known contexts
- */
- public synchronized List getFrameIds() {
- ArrayList result = new ArrayList(contexts.size());
- for (Iterator iterator = contexts.iterator(); iterator.hasNext();) {
- Context context = (Context) iterator.next();
- ContextData data = (ContextData) context.getDebuggerContextData();
- result.addAll(data.getFrameIds());
- }
- return result;
- }
-
- /**
- * Suspends the first context on the stack. has no effect if there are no known contexts for this thread data
- */
- public synchronized void suspend() {
- if(hasContext()) {
- Context context = (Context) contexts.getFirst();
- if (context == null) {
- return;
- }
- ContextData data = (ContextData) context.getDebuggerContextData();
- data.suspend();
- }
- }
-
- /**
- * Resumes the top context for the given type. Has no effect if there are no known contexts
- *
- * @param stepType
- *
- * @see JSONConstants#STEP_IN
- * @see JSONConstants#STEP_NEXT
- * @see JSONConstants#STEP_OUT
- * @see JSONConstants#STEP_ANY
- */
- public synchronized void resume(String stepType) {
- if(hasContext()) {
- Context context = (Context) contexts.getFirst();
- if (context == null) {
- return;
- }
- ContextData data = (ContextData) context.getDebuggerContextData();
- data.resume(stepType);
- }
- }
-
- /**
- * Returns the {@link DebugFrame} with the given id from the first context containing such a frame. Returns <code>null</code> if no such frame exists with the given id.
- *
- * @param frameId
- * @return the {@link DebugFrame} with the given id or <code>null</code>
- */
- public synchronized StackFrame getFrame(Long frameId) {
- for (Iterator iterator = contexts.iterator(); iterator.hasNext();) {
- Context context = (Context) iterator.next();
- ContextData data = (ContextData) context.getDebuggerContextData();
- StackFrame frame = data.getFrame(frameId);
- if (frame != null)
- return frame;
- }
- return null;
- }
-
- /**
- * Creates a new {@link DebugFrame} for the given attributes.
- *
- * @param context
- * @param function
- * @param script
- * @return a new {@link DebugFrame}
- */
- public synchronized DebugFrame getFrame(Context context, FunctionSource function, ScriptSource script) {
- return new StackFrame(new Long(currentFrameId++), context, function, script);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Connection.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Connection.java
deleted file mode 100644
index 3483013..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Connection.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.IOException;
-
-
-/**
- * Describes a socket connection to a debugger
- *
- * @since 1.0
- */
-public interface Connection {
-
- /**
- * Returns if the debug connection is open.
- *
- * @return <code>true</code> if the connection is open <code>false</code> otherwise
- */
- public abstract boolean isOpen();
-
- /**
- * Closes the connection.
- *
- * @throws IOException if the connection failed to close or is already closed
- */
- public abstract void close() throws IOException;
-
- /**
- * Writes the given packet to the connection
- *
- * @param packet the packet to write, <code>null</code> is not accepted
- * @throws IOException if the write failed
- */
- public abstract void writePacket(Packet packet) throws IOException;
-
- /**
- * Reads the next packet from the connection. This is non-blocking.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the next {@link Packet} from the connection
- * @throws IOException if the connection is prematurely closed or the read failed
- */
- public abstract Packet readPacket() throws IOException;
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Constants.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Constants.java
deleted file mode 100644
index e47bae8..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Constants.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-/**
- * Common constants
- *
- * @since 1.0
- */
-public interface Constants {
-
- /**
- * Constant representing a space
- */
- public static final String SPACE = " "; //$NON-NLS-1$
- /**
- * Constant representing a colon.<br>
- * <br>
- * Value is: <code>:</code>
- */
- public static final String COLON = ":"; //$NON-NLS-1$
- /**
- * Constant representing the empty string
- */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
- /**
- * UTF-8 encoding constant <br>
- * <br>
- * Value is: <code>UTF-8</code>
- */
- public static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
- /**
- * Debug property name <br>
- * <br>
- * Value is: <code>rhino.debug</code>
- */
- public static final String RHINO_DEBUG = "rhino.debug"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/DebugSession.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/DebugSession.java
deleted file mode 100644
index ee02b70..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/DebugSession.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-
-/**
- * A {@link DebugSession} controls a {@link PacketSendManager} and {@link PacketReceiveManager}
- * that is uses to communicate to a debug target using the underlying {@link Connection}
- *
- * @since 1.0
- */
-public class DebugSession {
-
- /**
- * The default receive manager
- */
- private final PacketReceiveManager packetReceiveManager;
- /**
- * The default send manager
- */
- private final PacketSendManager packetSendManager;
-
- /**
- * Constructor
- *
- * Starts the send / receive managers on the given connection.
- *
- * @param connection
- */
- public DebugSession(Connection connection) {
- packetReceiveManager = new PacketReceiveManager(connection);
- Thread receiveThread = new Thread(packetReceiveManager, "Debug Session - Receive Manager"); //$NON-NLS-1$
- receiveThread.setDaemon(true);
-
- packetSendManager = new PacketSendManager(connection);
- Thread sendThread = new Thread(packetSendManager, "Debug Session - Send Manager"); //$NON-NLS-1$
- sendThread.setDaemon(true);
-
- packetReceiveManager.setPartnerThread(sendThread);
- packetSendManager.setPartnerThread(receiveThread);
-
- receiveThread.start();
- sendThread.start();
- }
-
- /**
- * Stops the debug sessions and disconnects the send / receive managers
- */
- public void dispose() {
- packetReceiveManager.disconnect();
- packetSendManager.disconnect();
- }
-
- /**
- * Sends the given {@link Request} using the underlying {@link PacketSendManager}.
- *
- * @param request the request to send, <code>null</code> is not accepted
- * @throws DisconnectedException if the {@link PacketSendManager} has been disconnected
- */
- public void sendRequest(Request request) throws DisconnectedException {
- if(request == null) {
- throw new IllegalArgumentException("You cannot send a null request"); //$NON-NLS-1$
- }
- packetSendManager.sendPacket(request);
- }
-
- /**
- * Sends the given {@link EventPacket} using the underlying {@link PacketSendManager}.
- *
- * @param event the event to send, <code>null</code> is not accepted
- * @throws DisconnectedException if the {@link PacketSendManager} has been disconnected
- */
- public void sendEvent(EventPacket event) throws DisconnectedException {
- if(event == null) {
- throw new IllegalArgumentException("You cannot send a null event"); //$NON-NLS-1$
- }
- packetSendManager.sendPacket(event);
- }
-
- /**
- * Sends the given {@link Response} using the underlying {@link PacketSendManager}.
- *
- * @param response the response to send, <code>null</code> is not accepted
- * @throws DisconnectedException if the {@link PacketSendManager} has been disconnected
- */
- public void sendResponse(Response response) throws DisconnectedException {
- if(response == null) {
- throw new IllegalArgumentException("You cannot send a null response"); //$NON-NLS-1$
- }
- packetSendManager.sendPacket(response);
- }
-
- /**
- * Waits for the given timeout for a {@link Response} response in the given sequence
- * from the {@link PacketReceiveManager}.<br>
- * <br>
- * This method does not return <code>null</code> - one of the listed exceptions will be thrown
- * if an {@link Response} cannot be returned.
- *
- * @param timeout the amount of time in milliseconds to wait to a {@link Response}
- * @return a new {@link Request} from the {@link PacketReceiveManager} never <code>null</code>
- * @throws TimeoutException if the timeout lapses with no {@link Response} returned
- * @throws DisconnectedException if the {@link PacketReceiveManager} has been disconnected
- */
- public Response receiveResponse(int requestSequence, int timeout) throws TimeoutException, DisconnectedException {
- return packetReceiveManager.getResponse(requestSequence, timeout);
- }
-
- /**
- * Waits for the given timeout for a {@link EventPacket} response from the {@link PacketReceiveManager}.<br>
- * <br>
- * This method does not return <code>null</code> - one of the listed exceptions will be thrown
- * if an {@link EventPacket} cannot be returned.
- *
- * @param timeout the amount of time in milliseconds to wait to a {@link EventPacket}
- * @return a new {@link Request} from the {@link PacketReceiveManager} never <code>null</code>
- * @throws TimeoutException if the timeout lapses with no {@link EventPacket} returned
- * @throws DisconnectedException if the {@link PacketReceiveManager} has been disconnected
- */
- public EventPacket receiveEvent(int timeout) throws TimeoutException, DisconnectedException {
- return (EventPacket) packetReceiveManager.getCommand(EventPacket.TYPE, timeout);
- }
-
- /**
- * Waits for the given timeout for a request response from the {@link PacketReceiveManager}.<br>
- * <br>
- * This method does not return <code>null</code> - one of the listed exceptions will be thrown
- * if a {@link Request} cannot be returned.
- *
- * @param timeout the amount of time in milliseconds to wait to a {@link Request}
- * @return a new {@link Request} from the {@link PacketReceiveManager} never <code>null</code>
- * @throws TimeoutException if the timeout lapses with no {@link Request} returned
- * @throws DisconnectedException if the {@link PacketReceiveManager} has been disconnected
- */
- public Request receiveRequest(int timeout) throws TimeoutException, DisconnectedException {
- return (Request) packetReceiveManager.getCommand(JSONConstants.REQUEST, timeout);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/DisconnectedException.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/DisconnectedException.java
deleted file mode 100644
index 049bd0a..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/DisconnectedException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-
-/**
- * A {@link DisconnectedException} is thrown by either of the {@link PacketSendManager}
- * or {@link PacketReceiveManager} when a request is made and they have been disconnected
- *
- * @since 1.0
- */
-public final class DisconnectedException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 3233213787459625769L;
-
- /**
- * Constructor
- *
- * @param message
- * @param exception
- */
- public DisconnectedException(String message, Exception exception) {
- super(message, exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/EventPacket.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/EventPacket.java
deleted file mode 100644
index 4da4752..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/EventPacket.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * An {@link EventPacket} is a specialized {@link Packet}
- * that only handles <code>event</code> data.
- *
- * @since 1.0
- */
-public class EventPacket extends Packet {
-
- public static final String TYPE = JSONConstants.EVENT;
- private final String event;
- private final Map body = Collections.synchronizedMap(new HashMap());
-
- /**
- * Constructor
- * @param event
- */
- public EventPacket(String event) {
- super(TYPE);
- this.event = event.intern();
- }
-
- /**
- * Constructor
- * @param json
- */
- public EventPacket(Map json) {
- super(json);
- String packetEvent = (String) json.get(JSONConstants.EVENT);
- event = packetEvent.intern();
- Map packetBody = (Map) json.get(JSONConstants.BODY);
- body.putAll(packetBody);
- }
-
- /**
- * Returns the underlying event data
- * @return the event data
- */
- public String getEvent() {
- return event;
- }
-
- /**
- * Returns the underlying body of the event packet
- * @return the body of the packet
- */
- public Map getBody() {
- return body;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet#toJSON()
- */
- public Map toJSON() {
- Map json = super.toJSON();
- json.put(JSONConstants.EVENT, event);
- json.put(JSONConstants.BODY, body);
- return json;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("EventPacket: ").append(JSONUtil.write(toJSON())); //$NON-NLS-1$
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/JSONConstants.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/JSONConstants.java
deleted file mode 100644
index 668d471..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/JSONConstants.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-/**
- * Collection of constants used for JSON
- *
- * @since 1.0
- */
-public interface JSONConstants {
-
- // request / response
- public static final String SEQ = "seq"; //$NON-NLS-1$
- public static final String REQUEST_SEQ = "request_seq"; //$NON-NLS-1$
- public static final String TYPE = "type"; //$NON-NLS-1$
- public static final String REQUEST = "request"; //$NON-NLS-1$
- public static final String COMMAND = "command"; //$NON-NLS-1$
- public static final String CONNECT = "connect"; //$NON-NLS-1$
- public static final String MESSAGE = "message"; //$NON-NLS-1$
- public static final String ARGUMENTS = "arguments"; //$NON-NLS-1$
- public static final String BODY = "body"; //$NON-NLS-1$
- public static final String LINE = "line"; //$NON-NLS-1$
- public static final String LINE_NUMBER = "lineNumber"; //$NON-NLS-1$
- public static final String SCRIPT = "script"; //$NON-NLS-1$
- public static final String SCRIPTS = "scripts"; //$NON-NLS-1$
- public static final String FUNCTION = "function"; //$NON-NLS-1$
- public static final String ENTER = "enter"; //$NON-NLS-1$
- public static final String EXIT = "exit"; //$NON-NLS-1$
- public static final String FUNCTIONS = "functions"; //$NON-NLS-1$
- public static final String BREAK = "break"; //$NON-NLS-1$
- public static final String RESPONSE = "response"; //$NON-NLS-1$
- public static final String FUNCTION_NAME = "functionName"; //$NON-NLS-1$
- public static final String EVENT = "event"; //$NON-NLS-1$
- public static final String NOT_FOUND = "not found"; //$NON-NLS-1$
- /**
- * The type for a VMDeathEvent
- *
- * @see EventPacket#getType()
- */
- public static final String VMDEATH = "vmdeath"; //$NON-NLS-1$
-
- // value constants
- public static final String UNDEFINED = "undefined"; //$NON-NLS-1$
- public static final String UNKNOWN = "unknown"; //$NON-NLS-1$
- public static final String NULL = "null"; //$NON-NLS-1$
- public static final String BOOLEAN = "boolean"; //$NON-NLS-1$
- public static final String NUMBER = "number"; //$NON-NLS-1$
- public static final String STRING = "string"; //$NON-NLS-1$
- public static final String OBJECT = "object"; //$NON-NLS-1$
- public static final String ARRAY = "array"; //$NON-NLS-1$
- public static final String PROPERTY = "property"; //$NON-NLS-1$
- public static final String VARIABLE = "variable"; //$NON-NLS-1$
- public static final String THIS = "this"; //$NON-NLS-1$
- public static final String PROTOTYPE_OBJECT = "prototypeObject"; //$NON-NLS-1$
- public static final String CONSTRUCTOR_FUNCTION = "constructorFunction"; //$NON-NLS-1$
-
- // id constants
- public static final String THREAD_ID = "threadId"; //$NON-NLS-1$
- public static final String FRAME_ID = "frameId"; //$NON-NLS-1$
- public static final String BREAKPOINT_ID = "breakpointId"; //$NON-NLS-1$
- public static final String CONTEXT_ID = "contextId"; //$NON-NLS-1$
- public static final String SCRIPT_ID = "scriptId"; //$NON-NLS-1$
-
- // breakpoints
- public static final String SETBREAKPOINT = "setbreakpoint"; //$NON-NLS-1$
- public static final String BREAKPOINT = "breakpoint"; //$NON-NLS-1$
- public static final String BREAKPOINTS = "breakpoints"; //$NON-NLS-1$
- public static final String CLEARBREAKPOINT = "clearbreakpoint"; //$NON-NLS-1$
- public static final String CONDITION = "condition"; //$NON-NLS-1$
- public static final String LINES = "lines"; //$NON-NLS-1$
- public static final String DEBUGGER_STATEMENT = "debuggerStatement"; //$NON-NLS-1$
-
- // threads
- public static final String CONTINUE = "continue"; //$NON-NLS-1$
- public static final String RUNNING = "running"; //$NON-NLS-1$
- public static final String BACKTRACE = "backtrace"; //$NON-NLS-1$
- public static final String SUCCESS = "success"; //$NON-NLS-1$
- public static final String TOTAL_FRAMES = "totalframes"; //$NON-NLS-1$
- public static final String STEP_ACTION = "stepaction"; //$NON-NLS-1$
- public static final String STEP = "step"; //$NON-NLS-1$
- public static final String STEP_TYPE = "stepType"; //$NON-NLS-1$
- public static final String STEP_IN = "in"; //$NON-NLS-1$
- public static final String STEP_NEXT = "next"; //$NON-NLS-1$
- public static final String STEP_OUT = "out"; //$NON-NLS-1$
- public static final String STEP_ANY = "any"; //$NON-NLS-1$
- public static final String CONTEXTS = "contexts"; //$NON-NLS-1$
- public static final String STATE = "state"; //$NON-NLS-1$
- public static final String FRAMES = "frames"; //$NON-NLS-1$
-
- // target
- public static final String THREADS = "threads"; //$NON-NLS-1$
- public static final String THREAD = "thread"; //$NON-NLS-1$
- public static final String VERSION = "version"; //$NON-NLS-1$
- public static final String DISPOSE = "dispose"; //$NON-NLS-1$
- public static final String SUSPEND = "suspend"; //$NON-NLS-1$
- public static final String SUSPENDED = "suspended"; //$NON-NLS-1$
- public static final String EXCEPTION = "exception"; //$NON-NLS-1$
- public static final String VM_VERSION = "javascript.vm.version"; //$NON-NLS-1$
- public static final String VM_NAME = "javascript.vm.name"; //$NON-NLS-1$
- public static final String VM_VENDOR = "javascript.vm.vendor"; //$NON-NLS-1$
- public static final String JAVASCRIPT_VERSION = "javascript.version"; //$NON-NLS-1$
- public static final String ECMASCRIPT_VERSION = "ecmascript.version"; //$NON-NLS-1$
-
- // stackframe
- public static final String EVALUATE = "evaluate"; //$NON-NLS-1$
- public static final String EXPRESSION = "expression"; //$NON-NLS-1$
- public static final String HANDLE = "handle"; //$NON-NLS-1$
- public static final String PROPERTIES = "properties"; //$NON-NLS-1$
- public static final String NAME = "name"; //$NON-NLS-1$
- public static final String LOOKUP = "lookup"; //$NON-NLS-1$
- public static final String REF = "ref"; //$NON-NLS-1$
- public static final String CONSTRUCTOR = "constructor"; //$NON-NLS-1$
- public static final String CLASS_NAME = "className"; //$NON-NLS-1$
- public static final String VALUE = "value"; //$NON-NLS-1$
- public static final String SCOPE_NAME = "scopeName"; //$NON-NLS-1$
- public static final String FRAME = "frame"; //$NON-NLS-1$
-
- // scripts
- public static final String GENERATED = "generated"; //$NON-NLS-1$
- public static final String SOURCE = "source"; //$NON-NLS-1$
- public static final String LOCATION = "location"; //$NON-NLS-1$
- public static final String BASE = "base"; //$NON-NLS-1$
- public static final String PATH = "path"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/JSONUtil.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/JSONUtil.java
deleted file mode 100644
index 7982dd2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/JSONUtil.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.math.BigDecimal;
-import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.mozilla.javascript.Undefined;
-
-
-/**
- * This class provides utilities for working with JSON.
- * <br><br>JSON identifiers map to Java as follows:
- * <ul>
- * <li>string <--> java.lang.String</li>
- * <li>number <--> java.math.Number (BigDecimal)</li>
- * <li>object <--> java.util.Map (HashMap)</li>
- * <li>array <--> java.util.Collection (ArrayList)</li>
- * <li>true <--> java.lang.Boolean.TRUE</li>
- * <li>false <--> java.lang.Boolean.FALSE</li>
- * <li>null <--> null</li>
- * </ul>
- *
- * @see JSONConstants
- * @since 1.0
- */
-public final class JSONUtil {
-
- /**
- * Constructor
- * no instantiation
- */
- private JSONUtil() {}
-
- /**
- * Reads an object from the given JSON string.
- * <br><br>JSON identifiers map to Java as follows:
- * <ul>
- * <li>string <--> java.lang.String</li>
- * <li>number <--> java.math.Number (BigDecimal)</li>
- * <li>object <--> java.util.Map (HashMap)</li>
- * <li>array <--> java.util.Collection (ArrayList)</li>
- * <li>true <--> java.lang.Boolean.TRUE</li>
- * <li>false <--> java.lang.Boolean.FALSE</li>
- * <li>null <--> null</li>
- * </ul>
- * @param jsonString
- * @return the object corresponding to the JSON string or <code>null</code>
- */
- public static Object read(String jsonString) {
- return parse(new StringCharacterIterator(jsonString));
- }
-
- /**
- * Writes the given object to JSON
- * <br><br>JSON identifiers map to Java as follows:
- * <ul>
- * <li>string <--> java.lang.String</li>
- * <li>number <--> java.math.Number (BigDecimal)</li>
- * <li>object <--> java.util.Map (HashMap)</li>
- * <li>array <--> java.util.Collection (ArrayList)</li>
- * <li>true <--> java.lang.Boolean.TRUE</li>
- * <li>false <--> java.lang.Boolean.FALSE</li>
- * <li>null <--> null</li>
- * </ul>
- * @param jsonObject
- * @return the composed JSON string, never <code>null</code>
- */
- public static String write(Object jsonObject) {
- StringBuffer buffer = new StringBuffer();
- writeValue(jsonObject, buffer);
- return buffer.toString();
- }
-
- /**
- * Creates an {@link IllegalStateException} for the given message and iterator
- *
- * @param message the message for the exception
- * @param it the iterator
- * @return a new {@link IllegalStateException}
- */
- private static RuntimeException error(String message, CharacterIterator it) {
- return new IllegalStateException("[" + it.getIndex() + "] " + message); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * Creates an {@link IllegalStateException} for the given message
- *
- * @param message the message for the exception
- * @return a new {@link IllegalStateException}
- */
- private static RuntimeException error(String message) {
- return new IllegalStateException(message);
- }
-
- /**
- * Parses the object value from the JSON string.
- * <br><br>JSON identifiers map to Java as follows:
- * <ul>
- * <li>string <--> java.lang.String</li>
- * <li>number <--> java.math.Number (BigDecimal)</li>
- * <li>object <--> java.util.Map (HashMap)</li>
- * <li>array <--> java.util.Collection (ArrayList)</li>
- * <li>true <--> java.lang.Boolean.TRUE</li>
- * <li>false <--> java.lang.Boolean.FALSE</li>
- * <li>null <--> null</li>
- * </ul>
- * @param it
- * @return
- */
- private static Object parse(CharacterIterator it) {
- parseWhitespace(it);
- Object result = parseValue(it);
- parseWhitespace(it);
-
- if (it.current() != CharacterIterator.DONE) {
- throw error("should be done", it); //$NON-NLS-1$
- }
- return result;
- }
-
- /**
- * Chews up whitespace from the iterator
- *
- * @param it
- */
- private static void parseWhitespace(CharacterIterator it) {
- char c = it.current();
- while (Character.isWhitespace(c)) {
- c = it.next();
- }
- }
-
- /**
- * Delegate method that calls the correct parse* method for object creation
- * <br><br>JSON identifiers map to Java as follows:
- * <ul>
- * <li>string <--> java.lang.String</li>
- * <li>number <--> java.math.Number (BigDecimal)</li>
- * <li>object <--> java.util.Map (HashMap)</li>
- * <li>array <--> java.util.Collection (ArrayList)</li>
- * <li>true <--> java.lang.Boolean.TRUE</li>
- * <li>false <--> java.lang.Boolean.FALSE</li>
- * <li>null <--> null</li>
- * </ul>
- * @param it
- * @return
- */
- private static Object parseValue(CharacterIterator it) {
- switch (it.current()) {
- case '{' :
- return parseObject(it);
- case '[' :
- return parseArray(it);
- case '"' :
- return parseString(it);
- case '-' :
- case '0' :
- case '1' :
- case '2' :
- case '3' :
- case '4' :
- case '5' :
- case '6' :
- case '7' :
- case '8' :
- case '9' :
- return parseNumber(it);
- case 't' :
- parseText(Boolean.TRUE.toString(), it);
- return Boolean.TRUE;
- case 'f' :
- parseText(Boolean.FALSE.toString(), it);
- return Boolean.FALSE;
- case 'n' :
- parseText(JSONConstants.NULL, it);
- return null;
- case 'u':
- parseText(JSONConstants.UNDEFINED, it);
- return null;
- }
- throw error("Bad JSON starting character '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$;
- }
-
- /**
- * Parses an {@link Map} object from the iterator or throws an
- * {@link IllegalStateException} if parsing fails.
- *
- * @param it
- * @return a new {@link Map} object, never <code>null</code>
- */
- private static Map parseObject(CharacterIterator it) {
- it.next();
- parseWhitespace(it);
- if (it.current() == '}') {
- it.next();
- return Collections.EMPTY_MAP;
- }
-
- Map map = new HashMap();
- while (true) {
- if (it.current() != '"')
- throw error("expected a string start '\"' but was '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$
- String key = parseString(it);
- if (map.containsKey(key))
- throw error("' already defined" + "key '" + key, it); //$NON-NLS-1$ //$NON-NLS-2$
- parseWhitespace(it);
- if (it.current() != ':')
- throw error("expected a pair separator ':' but was '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$
- it.next();
- parseWhitespace(it);
- Object value = parseValue(it);
- map.put(key, value);
- parseWhitespace(it);
- if (it.current() == ',') {
- it.next();
- parseWhitespace(it);
- continue;
- }
-
- if (it.current() != '}')
- throw error("expected an object close '}' but was '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- it.next();
- return map;
- }
-
- /**
- * Parses an {@link ArrayList} from the given iterator or throws an
- * {@link IllegalStateException} if parsing fails
- *
- * @param it
- * @return a new {@link ArrayList} object never <code>null</code>
- */
- private static List parseArray(CharacterIterator it) {
- it.next();
- parseWhitespace(it);
- if (it.current() == ']') {
- it.next();
- return Collections.EMPTY_LIST;
- }
-
- List list = new ArrayList();
- while (true) {
- Object value = parseValue(it);
- list.add(value);
- parseWhitespace(it);
- if (it.current() == ',') {
- it.next();
- parseWhitespace(it);
- continue;
- }
-
- if (it.current() != ']')
- throw error("expected an array close ']' but was '" + it.current() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- it.next();
- return list;
- }
-
- private static void parseText(String string, CharacterIterator it) {
- int length = string.length();
- char c = it.current();
- for (int i = 0; i < length; i++) {
- if (c != string.charAt(i))
- throw error("expected to parse '" + string + "' but character " + (i + 1) + " was '" + c + "'", it); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$;
- c = it.next();
- }
- }
-
- private static Object parseNumber(CharacterIterator it) {
- StringBuffer buffer = new StringBuffer();
- char c = it.current();
- while (Character.isDigit(c) || c == '-' || c == '+' || c == '.' || c == 'e' || c == 'E') {
- buffer.append(c);
- c = it.next();
- }
- try {
- return new BigDecimal(buffer.toString());
- } catch (NumberFormatException e) {
- throw error("expected a number but was '" + buffer.toString() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$;
- }
- }
-
- private static String parseString(CharacterIterator it) {
- char c = it.next();
- if (c == '"') {
- it.next();
- return ""; //$NON-NLS-1$
- }
- StringBuffer buffer = new StringBuffer();
- while (c != '"') {
- if (Character.isISOControl(c))
- throw error("illegal iso control character: '" + Integer.toHexString(c) + "'", it); //$NON-NLS-1$ //$NON-NLS-2$);
-
- if (c == '\\') {
- c = it.next();
- switch (c) {
- case '"' :
- case '\\' :
- case '/' :
- buffer.append(c);
- break;
- case 'b' :
- buffer.append('\b');
- break;
- case 'f' :
- buffer.append('\f');
- break;
- case 'n' :
- buffer.append('\n');
- break;
- case 'r' :
- buffer.append('\r');
- break;
- case 't' :
- buffer.append('\t');
- break;
- case 'u' :
- StringBuffer unicode = new StringBuffer(4);
- for (int i = 0; i < 4; i++) {
- unicode.append(it.next());
- }
- try {
- buffer.append((char) Integer.parseInt(unicode.toString(), 16));
- } catch (NumberFormatException e) {
- throw error("expected a unicode hex number but was '" + unicode.toString() + "'", it); //$NON-NLS-1$ //$NON-NLS-2$););
- }
- break;
- default :
- throw error("illegal escape character '" + c + "'", it); //$NON-NLS-1$ //$NON-NLS-2$););
- }
- } else
- buffer.append(c);
-
- c = it.next();
- }
- c = it.next();
- return buffer.toString();
- }
-
- private static void writeValue(Object value, StringBuffer buffer) {
- if (value == null)
- buffer.append(JSONConstants.NULL);
- else if (value instanceof Boolean)
- buffer.append(value.toString());
- else if (value instanceof Number)
- writeNumber((Number) value, buffer);
- else if (value instanceof String)
- writeString((String) value, buffer);
- else if (value instanceof Collection)
- writeArray((Collection) value, buffer);
- else if (value instanceof Map)
- writeObject((Map) value, buffer);
- else if(value instanceof Undefined) {
- buffer.append(JSONConstants.UNDEFINED);
- }
- else
- throw error("Unexpected object instance type was '" + value.getClass().getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$););
- }
-
- private static void writeNumber(Number value, StringBuffer buffer) {
- if (value instanceof Double) {
- if (((Double)value).isNaN() || ((Double)value).isInfinite()) {
- buffer.append(JSONConstants.NULL);
- return;
- }
- } else if (value instanceof Float) {
- if (((Float)value).isNaN() || ((Float)value).isInfinite()) {
- buffer.append(JSONConstants.NULL);
- return;
- }
- }
- buffer.append(value.toString());
- }
-
- private static void writeObject(Map map, StringBuffer buffer) {
- buffer.append('{');
- for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
- Object key = iterator.next();
- if (!(key instanceof String))
- throw error("Map keys must be an instance of String but was '" + key.getClass().getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$););
- writeString((String) key, buffer);
- buffer.append(':');
- writeValue(map.get(key), buffer);
- buffer.append(',');
- }
- if (buffer.charAt(buffer.length() - 1) == ',')
- buffer.setCharAt(buffer.length() - 1, '}');
- else
- buffer.append('}');
- }
-
- private static void writeArray(Collection collection, StringBuffer buffer) {
- buffer.append('[');
- for (Iterator iterator = collection.iterator(); iterator.hasNext();) {
- writeValue(iterator.next(), buffer);
- buffer.append(',');
- }
- if (buffer.charAt(buffer.length() - 1) == ',')
- buffer.setCharAt(buffer.length() - 1, ']');
- else
- buffer.append(']');
- }
-
- private static void writeString(String string, StringBuffer buffer) {
- buffer.append('"');
- int length = string.length();
- for (int i = 0; i < length; i++) {
- char c = string.charAt(i);
- switch (c) {
- case '"' :
- case '\\' :
- case '/' :
- buffer.append('\\');
- buffer.append(c);
- break;
- case '\b' :
- buffer.append("\\b"); //$NON-NLS-1$
- break;
- case '\f' :
- buffer.append("\\f"); //$NON-NLS-1$
- break;
- case '\n' :
- buffer.append("\\n"); //$NON-NLS-1$
- break;
- case '\r' :
- buffer.append("\\r"); //$NON-NLS-1$
- break;
- case '\t' :
- buffer.append("\\t"); //$NON-NLS-1$
- break;
- default :
- if (Character.isISOControl(c)) {
- buffer.append("\\u"); //$NON-NLS-1$
- String hexString = Integer.toHexString(c);
- for (int j = hexString.length(); j < 4; j++)
- buffer.append('0');
- buffer.append(hexString);
- } else
- buffer.append(c);
- }
- }
- buffer.append('"');
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Packet.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Packet.java
deleted file mode 100644
index 3521aa0..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Packet.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * Abstract description of a packet for sending / receiving information to the debug client
- * using JSON
- *
- * @since 1.0
- */
-abstract public class Packet {
-
- private static int currentSequence = 0;
- private final int sequence;
- private final String type;
-
- /**
- * Constructor
- *
- * @param type the type for the {@link Packet} <code>null</code> is not accepted
- */
- protected Packet(String type) {
- if(type == null) {
- throw new IllegalArgumentException("The type for a packet cannot be null"); //$NON-NLS-1$
- }
- this.sequence = nextSequence();
- this.type = type.intern();
- }
-
- /**
- * Constructor
- *
- * @param json the pre-composed map of attributes for the packet, <code>null</code> is not accepted
- */
- protected Packet(Map json) {
- if(json == null) {
- throw new IllegalArgumentException("The JSON map for a packet cannot be null"); //$NON-NLS-1$
- }
- Number packetSeq = (Number) json.get(JSONConstants.SEQ);
- this.sequence = packetSeq.intValue();
- String packetType = (String) json.get(JSONConstants.TYPE);
- this.type = packetType.intern();
- }
-
- /**
- * @return a next value for the sequence
- */
- private static synchronized int nextSequence() {
- return ++currentSequence;
- }
-
- /**
- * @return the current sequence
- */
- public int getSequence() {
- return sequence;
- }
-
- /**
- * Returns the type of this packet.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the type, never <code>null</code>
- */
- public String getType() {
- return type;
- }
-
- /**
- * Returns the type and sequence composed in a JSON map.<br>
- * <br>
- * This method cannot return <code>null</code>
- * @return the composed JSON map
- */
- public Map toJSON() {
- Map json = new HashMap();
- json.put(JSONConstants.SEQ, new Integer(sequence));
- json.put(JSONConstants.TYPE, type);
- return json;
- }
-
- /**
- * Returns the type from the given JSON map.<br>
- * <br>
- * This method can return <code>null</code> if the map is not correctly
- * formed.
- *
- * @param json the JSON map, <code>null</code> is not accepted
- * @return the type from the JSON map or <code>null</code>
- */
- public static String getType(Map json) {
- if(json == null) {
- throw new IllegalArgumentException("A null JSON map is not allowed when trying to get the packet type"); //$NON-NLS-1$
- }
- return (String) json.get(JSONConstants.TYPE);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("Packet: ").append(JSONUtil.write(toJSON())); //$NON-NLS-1$
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketManager.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketManager.java
deleted file mode 100644
index e2c4e46..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketManager.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.IOException;
-
-/**
- * Default manager for sending / receiving packets to / from the connected {@link VirtualMachine}
- *
- * @since 1.0
- */
-public abstract class PacketManager implements Runnable {
-
- /**
- * Connector that performs IO to Virtual Machine.
- */
- private final Connection connection;
- /**
- * Thread that handles the communication the other way (e.g. if we are sending, the receiving thread).
- */
- private volatile Thread partnerThread;
- /**
- * The disconnected exception, if there is one
- */
- private volatile IOException disconnectedException;
-
- /**
- * Constructor
- *
- * @param connection the connection to communicate on, <code>null</code> is not accepted
- */
- protected PacketManager(Connection connection) {
- if(connection == null) {
- throw new IllegalArgumentException("You cannot create a new PacketManager with a null Connection"); //$NON-NLS-1$
- }
- this.connection = connection;
- }
-
- /**
- * Returns the {@link Connection} this manager is communicating on.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the backing {@link Connection} to the {@link VirtualMachine}
- */
- public Connection getConnection() {
- return this.connection;
- }
-
- /**
- * Used to indicate that an IO exception occurred, closes the {@link Connection}
- * to the {@link VirtualMachine}.
- *
- * @param disconnectedException the IOException that occurred or <code>null</code>
- */
- public void disconnect(IOException exception) {
- this.disconnectedException = exception;
- disconnect();
- }
-
- /**
- * Closes the {@link Connection} to the {@link VirtualMachine}.
- */
- public void disconnect() {
- try {
- this.connection.close();
- } catch (IOException e) {
- this.disconnectedException = e;
- }
- if (this.partnerThread != null) {
- this.partnerThread.interrupt();
- }
- }
-
- /**
- * Returns if the manager is disconnected or not.
- *
- * @return <code>true</code> if the manager is disconnected false otherwise
- */
- public boolean isDisconnected() {
- return this.connection == null || !this.connection.isOpen();
- }
-
- /**
- * Returns the underlying {@link IOException} from a disconnect.<br>
- * <br>
- * This method can return <code>null</code> if the manager has not been disconnected
- *
- * @return the underlying {@link IOException} from a disconnect or <code>null</code> if none
- */
- public IOException getDisconnectedException() {
- return this.disconnectedException;
- }
-
- /**
- * Assigns thread of partner, to be notified if we have an {@link IOException}.
- *
- * @param thread the new partner thread, <code>null</code> is not accepted
- */
- public void setPartnerThread(Thread thread) {
- if(thread == null) {
- throw new IllegalArgumentException("You cannot send a null partner thread on the PacketManager"); //$NON-NLS-1$
- }
- this.partnerThread = thread;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketReceiveManager.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketReceiveManager.java
deleted file mode 100644
index 400c645..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketReceiveManager.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-
-/**
- * Default implementation of {@link PacketManager} for receiving packets from the
- * {@link VirtualMachine}
- *
- * @since 1.0
- */
-public class PacketReceiveManager extends PacketManager {
-
- /**
- * Generic timeout value for not blocking. <br>
- * Value is: <code>0</code>
- */
- public static final int TIMEOUT_NOT_BLOCKING = 0;
- /**
- * Generic timeout value for infinite timeout. <br>
- * Value is: <code>-1</code>
- */
- public static final int TIMEOUT_INFINITE = -1;
- /**
- * List of Command packets received from Virtual Machine.
- */
- private List commandPackets = new LinkedList();
- /**
- * List of Reply packets received from Virtual Machine.
- */
- private List responsePackets = new LinkedList();
- /**
- * List of Packets that have timed out already. Maintained so that responses can be discarded if/when they are received.
- */
- private List timedOutPackets = new ArrayList();
-
- /**
- * Constructor
- *
- * @param connection the underlying connection to communicate on, <code>null</code> is not accepted
- */
- public PacketReceiveManager(Connection connection) {
- super(connection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.PacketManager#disconnect()
- */
- public void disconnect() {
- super.disconnect();
- synchronized (this.commandPackets) {
- this.commandPackets.notifyAll();
- }
- synchronized (this.responsePackets) {
- this.responsePackets.notifyAll();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- try {
- while (!isDisconnected()) {
- // Read a packet from the input stream.
- readAvailablePacket();
- }
- }
- // if the remote runtime is interrupted, drop the connection and clean up, don't wait for it to happen on its own
- catch (InterruptedIOException e) {
- disconnect(e);
- } catch (IOException e) {
- disconnect(e);
- }
- }
-
- /**
- * Returns a specified command {@link Packet} from the {@link VirtualMachine}.<br>
- * <br>
- * This method cannot return <code>null</code> an exception is thrown if the desired packet cannot
- * be returned.
- *
- * @param type the type of the packet to get
- * @param timeToWait the amount of time to wait for the {@link Packet} to arrive
- *
- * @return the specified command packet never <code>null</code>
- * @throws TimeoutException if the request times out
- * @throws DisconnectedException if the manager is disconnected
- */
- public Packet getCommand(String type, long timeToWait) throws TimeoutException, DisconnectedException {
- synchronized (this.commandPackets) {
- long remainingTime = timeToWait;
- // Wait until command is available.
- //even if disconnected try to send the remaining events
- while (!isDisconnected() || !this.commandPackets.isEmpty()) {
- Packet packet = removeCommandPacket(type);
- if (packet != null)
- return packet;
-
- if (remainingTime < 0 && timeToWait != TIMEOUT_INFINITE)
- break;
-
- long timeBeforeWait = System.currentTimeMillis();
- try {
- waitForPacketAvailable(remainingTime, this.commandPackets);
- } catch (InterruptedException e) {
- break;
- }
- long waitedTime = System.currentTimeMillis() - timeBeforeWait;
- remainingTime -= waitedTime;
- }
- }
- // Check for an IO Exception.
- if (isDisconnected()) {
- throw new DisconnectedException("Runtime disconnected", getDisconnectedException()); //$NON-NLS-1$
- }
- // Check for a timeout.
- throw new TimeoutException("Timed out waiting for command packet: " + type); //$NON-NLS-1$
- }
-
- /**
- * Returns a specified response packet from the {@link VirtualMachine}.<br>
- * <br>
- * This method cannot return <code>null</code> an exception is thrown if the desired response cannot
- * be returned.
- *
- * @param requestSequence the sequence of the response to acquire
- * @param timeToWait the amount of time to wait for the {@link Response}
- *
- * @return a specified response packet from the {@link VirtualMachine} never <code>null</code>
- * @throws TimeoutException if the request times out
- * @throws DisconnectedException if the manager is disconnected
- */
- public Response getResponse(int requestSequence, long timeToWait) throws TimeoutException, DisconnectedException {
- synchronized (this.responsePackets) {
- long remainingTime = timeToWait;
- // Wait until command is available.
- while (!isDisconnected()) {
- Response response = removeResponsePacket(requestSequence);
- if (response != null)
- return response;
-
- if (remainingTime < 0 && timeToWait != TIMEOUT_INFINITE)
- break;
-
- long timeBeforeWait = System.currentTimeMillis();
- try {
- waitForPacketAvailable(remainingTime, this.responsePackets);
- } catch (InterruptedException e) {
- break;
- }
- long waitedTime = System.currentTimeMillis() - timeBeforeWait;
- remainingTime -= waitedTime;
- }
- }
- // Check for an IO Exception.
- if (isDisconnected()) {
- throw new DisconnectedException("Runtime disconnected", getDisconnectedException()); //$NON-NLS-1$
- }
-
- synchronized (this.responsePackets) {
- this.timedOutPackets.add(new Integer(requestSequence));
- }
- throw new TimeoutException("Timed out waiting for packet: " + requestSequence); //$NON-NLS-1$
- }
-
- /**
- * Wait for an available packet from the Virtual Machine.
- */
- private void waitForPacketAvailable(long timeToWait, Object lock) throws InterruptedException {
- if (timeToWait == 0)
- return;
- else if (timeToWait < 0)
- lock.wait();
- else
- lock.wait(timeToWait);
- }
-
- /**
- * Removes and returns the command packet for the given type or <code>null</code> if there is no command packet for the given type.
- *
- * @param type
- * @return The command packet for the given type that has been removed
- */
- private Packet removeCommandPacket(String type) {
- ListIterator iter = this.commandPackets.listIterator();
- while (iter.hasNext()) {
- Packet packet = (Packet) iter.next();
- if (type == null || packet.getType().equals(type)) {
- iter.remove();
- return packet;
- }
- }
- return null;
- }
-
- /**
- * Removes and returns the response packet with the given request sequence or <code>null</code> if there is no response packet with the given request sequence
- *
- * @param requestSequence
- * @return the response packet with the given request sequence that has been removed
- */
- private Response removeResponsePacket(int requestSequence) {
- ListIterator iter = this.responsePackets.listIterator();
- while (iter.hasNext()) {
- Response response = (Response) iter.next();
- if (requestSequence == response.getRequestSequence()) {
- iter.remove();
- return response;
- }
- }
- return null;
- }
-
- /**
- * Adds the given command packet to the listing of command packets. This method is a no-op if the given packet is <code>null</code>
- *
- * @param packet
- */
- private void addCommandPacket(Packet packet) {
- if (packet == null) {
- return;
- }
- synchronized (this.commandPackets) {
- this.commandPackets.add(packet);
- this.commandPackets.notifyAll();
- }
- }
-
- /**
- * Adds the given response packet to the listing of response packets. This method is a no-op if the given packet is <code>null</code>
- *
- * @param response
- */
- private void addResponsePacket(Response response) {
- if (response == null) {
- return;
- }
- synchronized (this.responsePackets) {
- if (!this.timedOutPackets.isEmpty()) {
- Integer requestSeq = new Integer(response.getRequestSequence());
- if (this.timedOutPackets.remove(requestSeq))
- return; // already timed out. No need to keep this one
- }
- this.responsePackets.add(response);
- this.responsePackets.notifyAll();
- }
- }
-
- /**
- * Reads the next packet from the underlying connection and adds it to the correct packet listing.
- *
- * @throws IOException
- */
- private void readAvailablePacket() throws IOException {
- // Read a packet from the Input Stream.
- Packet packet = getConnection().readPacket();
- if (packet instanceof Response)
- addResponsePacket((Response) packet);
- else
- addCommandPacket(packet);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketSendManager.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketSendManager.java
deleted file mode 100644
index e844281..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PacketSendManager.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * Default implementation of {@link PacketManager} for sending packets to the
- * {@link VirtualMachine}
- *
- * @since 1.0
- */
-public class PacketSendManager extends PacketManager {
-
- /**
- * List of packets to be sent to Virtual Machine
- */
- private final List outgoingPackets = new ArrayList();
-
- /**
- * Create a new thread that send packets to the {@link VirtualMachine}.
- *
- * @param connection the underlying connection to communicate on, <code>null</code> is not accepted
- */
- public PacketSendManager(Connection connection) {
- super(connection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.PacketManager#disconnect()
- */
- public void disconnect() {
- super.disconnect();
- synchronized (outgoingPackets) {
- outgoingPackets.notifyAll();
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run() {
- while (!isDisconnected()) {
- try {
- sendAvailablePackets();
- }
- // in each case if the remote runtime fails, or has been interrupted, disconnect and force a clean up, don't wait for it to happen
- catch (InterruptedException e) {
- disconnect();
- } catch (InterruptedIOException e) {
- disconnect(e);
- } catch (IOException e) {
- disconnect(e);
- }
- }
- }
-
- /**
- * Sends the given {@link Packet}.
- *
- * @param packet the packet to send, <code>null</code> is not accepted
- *
- * @throws DisconnectedException
- */
- public void sendPacket(Packet packet) throws DisconnectedException {
- if(packet == null) {
- throw new IllegalArgumentException("You cannot send a null packet"); //$NON-NLS-1$
- }
- if (isDisconnected()) {
- throw new DisconnectedException("Runtime disconnected", getDisconnectedException()); //$NON-NLS-1$
- }
- synchronized (outgoingPackets) {
- // Add packet to list of packets to send.
- outgoingPackets.add(packet);
- // Notify PacketSendThread that data is available.
- outgoingPackets.notifyAll();
- }
- }
-
- /**
- * Send available packets to the Virtual Machine.
- */
- private void sendAvailablePackets() throws InterruptedException, IOException {
- Object[] packetsToSend;
- synchronized (outgoingPackets) {
- while (outgoingPackets.size() == 0) {
- outgoingPackets.wait();
- }
- packetsToSend = outgoingPackets.toArray();
- outgoingPackets.clear();
- }
-
- // Put available packets on Output Stream.
- for (int i = 0; i < packetsToSend.length; i++) {
- getConnection().writePacket((Packet) packetsToSend[i]);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PipedConnection.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PipedConnection.java
deleted file mode 100644
index cd38971..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PipedConnection.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.Map;
-
-/**
- * A {@link Connection} implementation that uses streams for communication
- *
- * @since 1.0
- */
-public class PipedConnection implements Connection {
-
- private Writer writer;
- private Reader reader;
- private boolean open = true;
-
- /**
- * Constructor
- *
- * @param is the {@link InputStream} to read from, <code>null</code> is not accepted
- * @param os the {@link OutputStream} to write to, <code>null</code> is not accepted
- * @throws IOException
- */
- public PipedConnection(InputStream is, OutputStream os) throws IOException {
- if(is == null) {
- throw new IllegalArgumentException("You cannot create a new PipedConnection on a null InputStream"); //$NON-NLS-1$
- }
- if(os == null) {
- throw new IllegalArgumentException("You cannot create a new PipedConnection on a null OutputStream"); //$NON-NLS-1$
- }
- writer = new BufferedWriter(new OutputStreamWriter(os, Constants.UTF_8));
- reader = new BufferedReader(new InputStreamReader(is, Constants.UTF_8));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#isOpen()
- */
- public synchronized boolean isOpen() {
- return open;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#close()
- */
- public synchronized void close() throws IOException {
- open = false;
- writer.close();
- reader.close();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#writePacket(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet)
- */
- public void writePacket(Packet packet) throws IOException {
- String jsonString = JSONUtil.write(packet.toJSON());
- String count = Integer.toString(jsonString.length());
- writer.write(count);
- writer.write('\r');
- writer.write('\n');
- writer.write(jsonString);
- writer.flush();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#readPacket()
- */
- public Packet readPacket() throws IOException {
- StringBuffer buffer = new StringBuffer();
- int c;
- while ((c = reader.read()) != -1) {
- if (c == '\r')
- break;
- buffer.append((char) c);
- if (buffer.length() > 10) {
- throw new IOException("Invalid content length: " + buffer.toString()); //$NON-NLS-1$
- }
- }
-
- int length = 0;
- try {
- length = Integer.parseInt(buffer.toString());
- } catch (NumberFormatException e) {
- throw new IOException("Failed to parse content length: " + buffer.toString()); //$NON-NLS-1$
- }
-
- if ('\r' != c || '\n' != (char) reader.read())
- throw new IOException("Missing CRLF after content length"); //$NON-NLS-1$
-
- char[] message = new char[length];
- int n = 0;
- int off = 0;
- while (n < length) {
- int count = reader.read(message, off + n, length - n);
- if (count < 0)
- throw new EOFException();
- n += count;
- }
-
- Map json = (Map) JSONUtil.read(new String(message));
- String type = Packet.getType(json);
- if (EventPacket.TYPE.equals(type))
- return new EventPacket(json);
- if (JSONConstants.REQUEST.equals(type))
- return new Request(json);
- if (JSONConstants.RESPONSE.equals(type))
- return new Response(json);
-
- throw new IOException("Unknown packet type: " + type); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PipedTransportService.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PipedTransportService.java
deleted file mode 100644
index 01d9049..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/PipedTransportService.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.IOException;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * {@link TransportService} specialization for a {@link PipedConnection}
- *
- * @since 1.0
- */
-public class PipedTransportService implements TransportService {
-
- /**
- * Key specialized for a {@link PipedTransportService}
- */
- public static class PipedListenerKey implements ListenerKey {
-
- private String address;
-
- public PipedListenerKey(String address) {
- this.address = address;
- }
-
- public String address() {
- return address;
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((address == null) ? 0 : address.hashCode());
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PipedListenerKey other = (PipedListenerKey) obj;
- if (address == null) {
- if (other.address != null)
- return false;
- } else if (!address.equals(other.address))
- return false;
- return true;
- }
- }
-
- Map listeners = new HashMap();
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#startListening(java.lang.String)
- */
- public synchronized ListenerKey startListening(String address) throws IOException {
- ListenerKey key = new PipedListenerKey(address == null ? Constants.EMPTY_STRING : address);
- listeners.put(key, null);
- return key;
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#stopListening(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService.ListenerKey)
- */
- public void stopListening(ListenerKey key) throws IOException {
- synchronized (key) {
- if (listeners.containsKey(key)) {
- key.notify();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#accept(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService.ListenerKey, long, long)
- */
- public Connection accept(ListenerKey key, long attachTimeout, long handshakeTimeout) throws IOException {
- long timeout = attachTimeout;
- if (timeout > 0) {
- if (timeout > Integer.MAX_VALUE) {
- timeout = Integer.MAX_VALUE; // approximately 25 days!
- }
- }
-
- synchronized (listeners) {
- if (!listeners.containsKey(key))
- throw new IllegalStateException("not listening"); //$NON-NLS-1$
-
- if (listeners.get(key) != null)
- throw new IllegalStateException("PipedTransport only accepts one accept at a time"); //$NON-NLS-1$
-
- PipedInputStream serveris = new PipedInputStream();
- PipedOutputStream clientos = new PipedOutputStream();
- serveris.connect(clientos);
-
- PipedOutputStream serveros = new PipedOutputStream();
- PipedInputStream clientis = new PipedInputStream();
- serveros.connect(clientis);
-
- listeners.put(key, new PipedConnection(clientis, clientos));
- listeners.notifyAll();
- long startTime = System.currentTimeMillis();
- while (true) {
- try {
- listeners.wait(timeout);
- } catch (InterruptedException e) {
- throw new IOException("accept failed: interrupted"); //$NON-NLS-1$
- }
- if (!listeners.containsKey(key))
- throw new IOException("accept failed: stopped listening"); //$NON-NLS-1$
-
- if (listeners.get(key) != null) {
- if (System.currentTimeMillis() - startTime > timeout) {
- listeners.put(key, null);
- throw new IOException("accept failed: timed out"); //$NON-NLS-1$
- }
- continue;
- }
- return new PipedConnection(serveris, serveros);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#attach(java.lang.String, long, long)
- */
- public Connection attach(String address, long attachTimeout, long handshakeTimeout) throws IOException {
- ListenerKey key = new PipedListenerKey(address == null ? Constants.EMPTY_STRING : address);
- Connection connection;
- long startTime = System.currentTimeMillis();
- synchronized (listeners) {
- connection = (Connection) listeners.get(key);
- while (connection == null) {
- if (System.currentTimeMillis() - startTime > attachTimeout)
- throw new IOException("attach failed: timed out"); //$NON-NLS-1$
- try {
- listeners.wait(attachTimeout);
- } catch (InterruptedException e) {
- throw new IOException("attach failed: interrupted"); //$NON-NLS-1$
- }
- connection = (Connection) listeners.get(key);
- }
- listeners.put(key, null);
- listeners.notifyAll();
- }
- return connection;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Request.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Request.java
deleted file mode 100644
index 63dca4e..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Request.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Default request implementation using JSON
- *
- * @since 1.0
- */
-public class Request extends Packet {
-
- private final String command;
- private final Map arguments = Collections.synchronizedMap(new HashMap());
-
- /**
- * Constructor
- *
- * @param command the command, <code>null</code> is not accepted
- */
- public Request(String command) {
- super(JSONConstants.REQUEST);
- if(command == null) {
- throw new IllegalArgumentException("The request command kind cannot be null"); //$NON-NLS-1$
- }
- this.command = command.intern();
- }
-
- /**
- * Constructor
- *
- * @param json map of JSON attributes, <code>null</code> is not accepted
- */
- public Request(Map json) {
- super(json);
- if(json == null) {
- throw new IllegalArgumentException("The JSON map for a request packet cannot be null"); //$NON-NLS-1$
- }
- String packetCommand = (String) json.get(JSONConstants.COMMAND);
- this.command = packetCommand.intern();
- Map packetArguments = (Map) json.get(JSONConstants.ARGUMENTS);
- arguments.putAll(packetArguments);
- }
-
- /**
- * Returns the command that this {@link Request} will was created for.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the underlying command, never <code>null</code>
- */
- public String getCommand() {
- return command;
- }
-
- /**
- * Returns the complete collection of JSON arguments in the {@link Request}.<br>
- * <br>
- * This method cannot return <code>null</code>, an empty map will be returned
- * if there are no properties.
- *
- * @return the arguments or an empty map never <code>null</code>
- */
- public Map getArguments() {
- return arguments;
- }
-
- /**
- * Sets the given argument in the JSON map.
- *
- * @param key the key for the attribute, <code>null</code> is not accepted
- * @param argument the value for the argument, <code>null</code> is not accepted
- */
- public void setArgument(String key, Object argument) {
- if(key == null) {
- throw new IllegalArgumentException("The argument key cannot be null"); //$NON-NLS-1$
- }
- if(argument == null) {
- throw new IllegalArgumentException("A null argument is not allowed"); //$NON-NLS-1$
- }
- arguments.put(key, argument);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet#toJSON()
- */
- public Map toJSON() {
- Map json = super.toJSON();
- json.put(JSONConstants.COMMAND, command);
- json.put(JSONConstants.ARGUMENTS, arguments);
- return json;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("Request: ").append(JSONUtil.write(toJSON())); //$NON-NLS-1$
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Response.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Response.java
deleted file mode 100644
index 636e776..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/Response.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Default {@link Response} implementation using JSON
- *
- * @since 1.0
- */
-public class Response extends Packet {
-
- private final String command;
- private final int requestSequence;
- private final Map body = Collections.synchronizedMap(new HashMap());
- private volatile boolean success = true;
- private volatile boolean running = true;
- private volatile String message;
-
- /**
- * Constructor
- *
- * @param requestSequence the sequence
- * @param command the command, <code>null</code> is not accepted
- */
- public Response(int requestSequence, String command) {
- super(JSONConstants.RESPONSE);
- if(command == null) {
- throw new IllegalArgumentException("The command string for a response packet cannot be null"); //$NON-NLS-1$
- }
- this.requestSequence = requestSequence;
- this.command = command.intern();
- }
-
- /**
- * Constructor
- *
- * @param json the JSON map for a response, <code>null</code> is not accepted
- */
- public Response(Map json) {
- super(json);
- Number packetRequestSeq = (Number) json.get(JSONConstants.REQUEST_SEQ);
- requestSequence = packetRequestSeq.intValue();
-
- String packetCommand = (String) json.get(JSONConstants.COMMAND);
- command = packetCommand.intern();
-
- Map packetBody = (Map) json.get(JSONConstants.BODY);
- body.putAll(packetBody);
-
- Boolean packetSuccess = (Boolean) json.get(JSONConstants.SUCCESS);
- success = packetSuccess.booleanValue();
-
- Boolean packetRunning = (Boolean) json.get(JSONConstants.RUNNING);
- running = packetRunning.booleanValue();
-
- message = (String) json.get(JSONConstants.MESSAGE);
- }
-
- /**
- * Returns the request sequence
- *
- * @return the request sequence
- */
- public int getRequestSequence() {
- return requestSequence;
- }
-
- /**
- * Returns the underlying command.<br>
- * <br>
- * This method cannot return <code>null</code>
- *
- * @return the underlying command, never <code>null</code>
- */
- public String getCommand() {
- return command;
- }
-
- /**
- * Returns the body of the command.<br>
- * <br>
- * This method cannot return <code>null</code>, if there is no body
- * an empty {@link Map} is returned.
- *
- * @return the body of the JSON response or an empty {@link Map} never <code>null</code>
- */
- public Map getBody() {
- return body;
- }
-
- /**
- * Returns <code>true</code> if the {@link Request} was successful
- *
- * @return <code>true</code> if the {@link Request} was successful, <code>false</code> otherwise
- */
- public boolean isSuccess() {
- return success;
- }
-
- /**
- * Set the success flag for the response
- *
- * @param success the new success flag
- */
- public void setSuccess(boolean success) {
- this.success = success;
- }
-
- /**
- * Returns <code>true</code> if the underlying command is currently running.
- *
- * @return <code>true</code> if the underlying command is running, <code>false</code> otherwise
- */
- public boolean isRunning() {
- return running;
- }
-
- /**
- * Sets the running state of the underlying command
- *
- * @param running the new running state for the underlying command
- */
- public void setRunning(boolean running) {
- this.running = running;
- }
-
- /**
- * Returns the status message for this {@link Response}.<br>
- * <br>
- * This method can return <code>null</code>
- *
- * @return the status message for this {@link Response} or <code>null</code>
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Set the status message for this {@link Response}
- *
- * @param message the new message, <code>null</code> is accepted
- */
- public void setMessage(String message) {
- this.message = message;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet#toJSON()
- */
- public Map toJSON() {
- Map json = super.toJSON();
- json.put(JSONConstants.REQUEST_SEQ, new Integer(requestSequence));
- json.put(JSONConstants.COMMAND, command);
- json.put(JSONConstants.BODY, body);
- json.put(JSONConstants.SUCCESS, new Boolean(success));
- json.put(JSONConstants.RUNNING, new Boolean(running));
- if (message != null) {
- json.put(JSONConstants.MESSAGE, message);
- }
- return json;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("Response Packet: ").append(JSONUtil.write(toJSON())); //$NON-NLS-1$
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/SocketConnection.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/SocketConnection.java
deleted file mode 100644
index 425ce20..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/SocketConnection.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.net.Socket;
-import java.util.Map;
-
-/**
- * A specialized {@link Connection} that communicates using {@link Socket}s
- *
- * @since 1.0
- */
-public class SocketConnection implements Connection {
-
- private Writer writer;
- private Reader reader;
- private Socket socket;
-
- /**
- * Constructor
- *
- * @param socket the underlying {@link Socket}, <code>null</code> is not accepted
- *
- * @throws IOException
- */
- public SocketConnection(Socket socket) throws IOException {
- if(socket == null) {
- throw new IllegalArgumentException("You cannot create a new SocketConnection on a null Socket"); //$NON-NLS-1$
- }
- this.socket = socket;
- writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), Constants.UTF_8));
- reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), Constants.UTF_8));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#isOpen()
- */
- public boolean isOpen() {
- return !socket.isClosed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#close()
- */
- public void close() throws IOException {
- socket.close();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#writePacket(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Packet)
- */
- public void writePacket(Packet packet) throws IOException {
- String jsonString = JSONUtil.write(packet.toJSON());
- String count = Integer.toString(jsonString.length());
- writer.write(count);
- writer.write('\r');
- writer.write('\n');
- writer.write(jsonString);
- writer.flush();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.Connection#readPacket()
- */
- public Packet readPacket() throws IOException {
- StringBuffer buffer = new StringBuffer();
- int c;
- while ((c = reader.read()) != -1) {
- if (c == '\r')
- break;
- buffer.append((char) c);
- if (buffer.length() > 10) {
- throw new IOException("Invalid content length: " + buffer.toString()); //$NON-NLS-1$
- }
- }
-
- int length = 0;
- try {
- length = Integer.parseInt(buffer.toString());
- } catch (NumberFormatException e) {
- throw new IOException("Failed to parse content length: " + buffer.toString()); //$NON-NLS-1$
- }
-
- if ('\r' != c || '\n' != (char) reader.read())
- throw new IOException("Missing CRLF after content length"); //$NON-NLS-1$
-
- char[] message = new char[length];
- int n = 0;
- int off = 0;
- while (n < length) {
- int count = reader.read(message, off + n, length - n);
- if (count < 0)
- throw new EOFException();
- n += count;
- }
-
- Map json = (Map) JSONUtil.read(new String(message));
- String type = Packet.getType(json);
- if (EventPacket.TYPE.equals(type))
- return new EventPacket(json);
- if (JSONConstants.REQUEST.equals(type))
- return new Request(json);
- if (JSONConstants.RESPONSE.equals(type))
- return new Response(json);
-
- throw new IOException("Unknown packet type: " + type); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/SocketTransportService.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/SocketTransportService.java
deleted file mode 100644
index 085b832..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/SocketTransportService.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * Implementation of a transport service that using a {@link Socket} for communication
- *
- * @since 1.0
- */
-public class SocketTransportService implements TransportService {
-
- static final Class serverSocketClass = ServerSocket.class; // temporary used to pre-load the ServerSocket.class
-
- /**
- * Key implementation
- */
- public static class SocketListenerKey implements ListenerKey {
-
- private String address;
-
- public SocketListenerKey(String address) {
- this.address = address;
- }
-
- public String address() {
- return address;
- }
- }
-
- /**
- * Map of {@link ListenerKey} to {@link ServerSocket}s
- */
- Map listeners = new HashMap();
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#startListening(java.lang.String)
- */
- public synchronized ListenerKey startListening(String address) throws IOException {
- String host = null;
- int port = 0;
- if (address != null) {
- String[] strings = address.split(Constants.COLON);
- if (strings.length == 2) {
- host = strings[0];
- port = Integer.parseInt(strings[1]);
- } else {
- port = Integer.parseInt(strings[0]);
- }
- }
- if (host == null) {
- host = LOCALHOST;
- }
- if (!host.equals(LOCALHOST)) {
- throw new IllegalArgumentException("Only localhost is supported."); //$NON-NLS-1$
- }
- ListenerKey key = new SocketListenerKey(host + Constants.COLON + port);
- ServerSocket serverSocket = new ServerSocket(port);
- listeners.put(key, serverSocket);
- return key;
-
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#stopListening(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService.ListenerKey)
- */
- public void stopListening(ListenerKey key) throws IOException {
- ServerSocket serverSocket = (ServerSocket) listeners.remove(key);
- if (serverSocket != null) {
- serverSocket.close();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#accept(org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService.ListenerKey, long, long)
- */
- public Connection accept(ListenerKey key, long attachTimeout, long handshakeTimeout) throws IOException {
- ServerSocket serverSocket = (ServerSocket) listeners.get(key);
- if (serverSocket == null) {
- throw new IllegalStateException("Accept failed. Not listening for address: key.address()"); //$NON-NLS-1$
- }
- int timeout = (int) attachTimeout;
- if (timeout > 0) {
- if (timeout > Integer.MAX_VALUE) {
- timeout = Integer.MAX_VALUE; // approximately 25 days!
- }
- serverSocket.setSoTimeout(timeout);
- }
- Connection connection = new SocketConnection(serverSocket.accept());
- Packet packet = connection.readPacket();
- if (!(packet instanceof Request)) {
- throw new IOException("failure establishing_connection"); //$NON-NLS-1$
- }
- Request request = (Request) packet;
- if (!request.getCommand().equals(JSONConstants.CONNECT)) {
- throw new IOException("failure establishing connection"); //$NON-NLS-1$
- }
- Response response = new Response(request.getSequence(), request.getCommand());
- connection.writePacket(response);
- return connection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.core.jsdi.connect.TransportService#attach(java.lang.String, long, long)
- */
- public Connection attach(String address, long attachTimeout, long handshakeTimeout) throws IOException {
-
- String host = null;
- int port = 0;
- if (address != null) {
- String[] strings = address.split(Constants.COLON);
- if (strings.length == 2) {
- host = strings[0];
- port = Integer.parseInt(strings[1]);
- } else {
- port = Integer.parseInt(strings[0]);
- }
- }
- if (host == null) {
- host = LOCALHOST;
- }
- Connection connection = new SocketConnection(new Socket(host, port));
- Request request = new Request(JSONConstants.CONNECT);
- connection.writePacket(request);
-
- Packet packet = connection.readPacket();
- if (!(packet instanceof Response)) {
- throw new IOException("failure establishing connection"); //$NON-NLS-1$
- }
-
- Response response = (Response) packet;
- if (!response.getCommand().equals(JSONConstants.CONNECT) || response.getRequestSequence() != request.getSequence() || !response.isSuccess() || !response.isRunning()) {
- throw new IOException("failure establishing connection"); //$NON-NLS-1$
- }
- return connection;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/TimeoutException.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/TimeoutException.java
deleted file mode 100644
index 2d1aa0b..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/TimeoutException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-/**
- * This exception is thrown if the {@link PacketSendManager} or {@link PacketReceiveManager}
- * times out while waiting for a response
- *
- * @since 1.0
- */
-public final class TimeoutException extends Exception {
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor
- *
- * @param message the message for the exception
- */
- public TimeoutException(String message) {
- super(message);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/TransportService.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/TransportService.java
deleted file mode 100644
index 4850c4c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/TransportService.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.transport;
-
-import java.io.IOException;
-
-
-/**
- * A transport service is used to attach and / or listen to a
- * {@link Connection} exactly how the service communicates is an implementation detail.
- *
- * @since 1.0
- */
-public interface TransportService {
-
- public static final String LOCALHOST = "localhost"; //$NON-NLS-1$
- public static final String PORT = "port"; //$NON-NLS-1$
-
- /**
- * Describes a unique address to listen on
- */
- public interface ListenerKey {
- public String address();
- }
-
- /**
- * Registers that this service should begin listening to the given address
- *
- * @param address the address to listen on - e.g. localhost:12000
- * @return the key that uniquely identifies this service
- * @throws IOException
- */
- public ListenerKey startListening(String address) throws IOException;
-
- /**
- * Stops listening for the given key
- *
- * @param listenerKey
- * @throws IOException
- */
- public void stopListening(ListenerKey listenerKey) throws IOException;
-
- /**
- * Listens for a connection to be made to and accepts it. The method can block until a connection is made.
- *
- * @param listenerKey
- * @param attachTimeout
- * @param handshakeTimeout
- * @return the resulting {@link Connection}
- * @throws IOException
- */
- public Connection accept(ListenerKey listenerKey, long attachTimeout, long handshakeTimeout) throws IOException;
-
- /**
- * Attaches to the given address and returns the resulting connection. This method can block until a connection is made
- *
- * @param address
- * @param attachTimeout
- * @param handshakeTimeout
- * @return the resulting {@link Connection}
- * @throws IOException
- */
- public Connection attach(String address, long attachTimeout, long handshakeTimeout) throws IOException;
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/messages.properties b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/messages.properties
deleted file mode 100644
index 432ac35..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/messages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-failure_establishing_connection=failure establishing connection
-runtime_disconnected=Runtime disconnected
-time_out_waiting_for_command_packet=Time out waiting for command packet for: {0}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/rhino/debugger/RhinoDebugger.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/rhino/debugger/RhinoDebugger.java
deleted file mode 100644
index 019e95a..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/rhino/debugger/RhinoDebugger.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.rhino.debugger;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.debugger.RhinoDebuggerImpl;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.ContextFactory;
-
-/**
- * Rhino debugger
- *
- * @since 1.0
- */
-public final class RhinoDebugger implements ContextFactory.Listener {
-
- /**
- * Delegate debugger
- */
- private RhinoDebuggerImpl impl;
-
- /**
- * This constructor will only accept a <code>transport</code> argument
- * of <code>socket</code>. I.e. <code>transport=socket</code>.
- *
- * @param configString the configuration string, for example: <code>transport=socket,suspend=y,address=9000</code>
- */
- public RhinoDebugger(String configString) {
- impl = new RhinoDebuggerImpl(configString);
- }
-
- /**
- * Starts the debugger
- *
- * @throws Exception if the debugger could not start
- */
- public void start() throws Exception {
- impl.start();
- }
-
- /**
- * Stops the debugger
- */
- public void stop() throws Exception {
- impl.stop();
- }
-
- /* (non-Javadoc)
- * @see org.mozilla.javascript.ContextFactory.Listener#contextCreated(org.mozilla.javascript.Context)
- */
- public void contextCreated(Context context) {
- impl.contextCreated(context);
- }
-
- /* (non-Javadoc)
- * @see org.mozilla.javascript.ContextFactory.Listener#contextReleased(org.mozilla.javascript.Context)
- */
- public void contextReleased(Context context) {
- impl.contextReleased(context);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/rhino/debugger/shell/DebugShell.java b/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/rhino/debugger/shell/DebugShell.java
deleted file mode 100644
index 485333c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/rhino/debugger/shell/DebugShell.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.rhino.debugger.shell;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.jsdt.debug.internal.rhino.debugger.RhinoDebuggerImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.SocketTransportService;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TransportService;
-import org.mozilla.javascript.tools.shell.Main;
-
-/**
- * Entry point for launching a Rhino debugger
- *
- * @since 1.0
- */
-public final class DebugShell {
-
- public static void main(String args[]) {
-
- String port = "9888"; //$NON-NLS-1$
- boolean suspend = false;
-
- ArrayList argList = new ArrayList();
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.equals("-port")) { //$NON-NLS-1$
- port = args[++i];
- } else if (arg.equals("-suspend")) { //$NON-NLS-1$
- suspend = Boolean.valueOf(args[++i]).booleanValue();
- } else if (arg.equals("-debug")) { //$NON-NLS-1$
- // skip
- argList.add(args[i]);
- continue;
- } else if (arg.equals("-opt")) { //$NON-NLS-1$
- // skip
- argList.add(args[i]);
- i++;
- continue;
- }
- }
- String[] newArgs = (String[]) argList.toArray(new String[0]);
-
- TransportService service = new SocketTransportService();
- RhinoDebuggerImpl debugger = new RhinoDebuggerImpl(service, port, suspend);
- try {
- debugger.start();
- Main.shellContextFactory.addListener(debugger);
- Main.main(newArgs);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/.classpath b/bundles/org.eclipse.wst.jsdt.debug.rhino/.classpath
deleted file mode 100644
index 2fbb7a2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/.project b/bundles/org.eclipse.wst.jsdt.debug.rhino/.project
deleted file mode 100644
index 742a9ed..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.jsdt.debug.rhino</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.debug.rhino/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index de9eac3..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,90 +0,0 @@
-#Fri Apr 30 10:04:28 CDT 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
-org.eclipse.jdt.core.compiler.problem.deadCode=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=error
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.debug.rhino/META-INF/MANIFEST.MF
deleted file mode 100644
index 634d196..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-Vendor: %Bundle-Vendor
-Bundle-SymbolicName: org.eclipse.wst.jsdt.debug.rhino;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.jsdt.debug.internal.rhino.RhinoDebugPlugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;x-internal:=true,
- org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.connect;x-internal:=true,
- org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.event;x-internal:=true,
- org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;x-internal:=true
-Import-Package: org.eclipse.debug.core.model,
- org.eclipse.wst.jsdt.debug.core.breakpoints,
- org.eclipse.wst.jsdt.debug.core.jsdi,
- org.eclipse.wst.jsdt.debug.core.jsdi.connect,
- org.eclipse.wst.jsdt.debug.core.jsdi.event,
- org.eclipse.wst.jsdt.debug.core.jsdi.request,
- org.eclipse.wst.jsdt.debug.core.model,
- org.eclipse.wst.jsdt.debug.internal.rhino.transport
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.wst.jsdt.debug.rhino/OSGI-INF/l10n/bundle.properties
deleted file mode 100644
index f4cd190..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/OSGI-INF/l10n/bundle.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-Bundle-Vendor = Eclipse Web Tools Platform
-Bundle-Name = Rhino JavaScript Debug
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/about.html b/bundles/org.eclipse.wst.jsdt.debug.rhino/about.html
deleted file mode 100755
index b4a1c56..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>March 10, 2010</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/build.properties b/bundles/org.eclipse.wst.jsdt.debug.rhino/build.properties
deleted file mode 100644
index c1711a9..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html,\
- OSGI-INF/l10n/bundle.properties
-src.includes = about.html
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/plugin.xml b/bundles/org.eclipse.wst.jsdt.debug.rhino/plugin.xml
deleted file mode 100644
index 59d383e..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/plugin.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?><!--
- Copyright (c) 2009 IBM Corporation and others.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- IBM Corporation - initial API and implementation
- -->
-
-<plugin>
- <extension
- point="org.eclipse.wst.jsdt.debug.core.launchingConnectors">
- <connector
- class="org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.connect.RhinoAttachingConnector"
- id="rhino.attaching.connector">
- </connector>
- </extension>
- <extension
- point="org.eclipse.wst.jsdt.debug.core.breakpointParticipants">
- <participant
- class="org.eclipse.wst.jsdt.debug.internal.rhino.breakpoints.RhinoBreakpointParticipant"
- kind="*">
- </participant>
- </extension>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.jsdt.debug.internal.rhino.RhinoPreferenceInitializer">
- </initializer>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/Constants.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/Constants.java
deleted file mode 100644
index a12a140..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/Constants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino;
-
-/**
- * Collection of constants used in Rhino
- *
- * @since 1.0
- */
-public interface Constants {
-
-//############## GENERAL ####################
- public static final String SPACE = " "; //$NON-NLS-1$
- public static String URI_FILE_SCHEME = "file"; //$NON-NLS-1$
- public static String STD_IN = "stdin"; //$NON-NLS-1$
- public static String STD_IN_URI = "<stdin>"; //$NON-NLS-1$
-
-//############## PREFERENCES ################
- public static String SUSPEND_ON_STDIN_LOAD = RhinoDebugPlugin.PLUGIN_ID + ".suspend_on_stdin_load"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoDebugPlugin.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoDebugPlugin.java
deleted file mode 100644
index 64b62af..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoDebugPlugin.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- * @since 1.0
- */
-public class RhinoDebugPlugin extends Plugin {
-
- /**
- * Status code indicating an unexpected internal error.
- */
- public static final int INTERNAL_ERROR = 120;
- /**
- * The ID of the bundle<br>
- * <br>
- * value is: <code>org.eclipse.wst.jsdt.debug.core</code>
- */
- public static final String PLUGIN_ID = "org.eclipse.wst.jsdt.debug.rhino"; //$NON-NLS-1$
-
- /**
- * The singleton instance
- */
- private static RhinoDebugPlugin plugin;
-
- /**
- * The constructor
- */
- public RhinoDebugPlugin() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static RhinoDebugPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Logs the specified status with this plug-in's log.
- *
- * @param status status to log
- */
- public static void log(IStatus status) {
- if (plugin != null) {
- plugin.getLog().log(status);
- }
- }
-
- /**
- * Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to log
- */
- public static void log(Throwable t) {
- log(newErrorStatus("Error logged from Rhino Debug: ", t)); //$NON-NLS-1$
- }
-
- /**
- * Logs an internal error with the specified message.
- *
- * @param message the error message to log
- */
- public static void logErrorMessage(String message) {
- log(newErrorStatus("Internal message logged from Rhino Debug: " + message, null)); //$NON-NLS-1$
- }
-
- /**
- * Returns a new error status for this plug-in with the given message
- * @param message the message to be included in the status
- * @param exception the exception to be included in the status or <code>null</code> if none
- * @return a new error status
- */
- public static IStatus newErrorStatus(String message, Throwable exception) {
- return new Status(IStatus.ERROR, PLUGIN_ID, INTERNAL_ERROR, message, exception);
- }
-
- /**
- * Creates a new {@link URI} with the <code>file</code> scheme
- * @param path
- * @return a new {@link URI}
- * @throws URISyntaxException
- */
- public static URI fileURI(IPath path) throws URISyntaxException {
- return new URI(Constants.URI_FILE_SCHEME, null, path.makeAbsolute().toString(), null);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoPreferenceInitializer.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoPreferenceInitializer.java
deleted file mode 100644
index af9a967..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoPreferenceInitializer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * Initializes the preferences for Rhino
- *
- * @since 1.0
- */
-public class RhinoPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /**
- * Constructor
- */
- public RhinoPreferenceInitializer() {}
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IEclipsePreferences defaultscope = new DefaultScope().getNode(RhinoDebugPlugin.PLUGIN_ID);
- defaultscope.putBoolean(Constants.SUSPEND_ON_STDIN_LOAD, false);
- try {
- defaultscope.flush();
- } catch (BackingStoreException e) {
- RhinoDebugPlugin.log(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoPreferencesManager.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoPreferencesManager.java
deleted file mode 100644
index 8589683..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/RhinoPreferencesManager.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-
-/**
- * Handles all of the core Rhino preferences - allows easy access to a variety of preferences
- * and tracks changes to those preferences.
- *
- * @since 1.0
- */
-public class RhinoPreferencesManager implements IPreferenceChangeListener {
-
- /**
- * Starts the manager
- */
- public void start() {
- IEclipsePreferences node = new InstanceScope().getNode(RhinoDebugPlugin.PLUGIN_ID);
- if(node != null) {
- node.addPreferenceChangeListener(this);
- }
- else {
- //our preference node is bogus report the status
- RhinoDebugPlugin.logErrorMessage("The Rhino core preference node could not loaded"); //$NON-NLS-1$
- }
- }
-
- /**
- * Stops the manager and frees any resources held
- */
- public void stop() {
- IEclipsePreferences node = new InstanceScope().getNode(RhinoDebugPlugin.PLUGIN_ID);
- if(node != null) {
- node.removePreferenceChangeListener(this);
- }
- else {
- //our preference node is bogus report the status
- RhinoDebugPlugin.logErrorMessage("The Rhino core preference node could not loaded"); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
- */
- public void preferenceChange(PreferenceChangeEvent event) {
- }
-
- /**
- * Returns if we should be suspending on script load events from stdin - i.e. from the Rhino console.
- *
- * @return <code>true</code> if we should suspend on a script load for stdin, <code>false</code> otherwise
- */
- public static boolean suspendOnStdinLoad() {
- return Platform.getPreferencesService().getBoolean(RhinoDebugPlugin.PLUGIN_ID, Constants.SUSPEND_ON_STDIN_LOAD, false, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/breakpoints/RhinoBreakpointParticipant.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/breakpoints/RhinoBreakpointParticipant.java
deleted file mode 100644
index 5daa371..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/breakpoints/RhinoBreakpointParticipant.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.wst.jsdt.debug.core.breakpoints.IJavaScriptBreakpoint;
-import org.eclipse.wst.jsdt.debug.core.breakpoints.IJavaScriptBreakpointParticipant;
-import org.eclipse.wst.jsdt.debug.core.breakpoints.IJavaScriptLineBreakpoint;
-import org.eclipse.wst.jsdt.debug.core.jsdi.BooleanValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Value;
-import org.eclipse.wst.jsdt.debug.core.model.IJavaScriptPrimitiveValue;
-import org.eclipse.wst.jsdt.debug.core.model.IJavaScriptThread;
-import org.eclipse.wst.jsdt.debug.core.model.IJavaScriptValue;
-import org.eclipse.wst.jsdt.debug.internal.rhino.Constants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.RhinoPreferencesManager;
-
-/**
- * Participant for Rhino
- *
- * @since 1.0
- */
-public class RhinoBreakpointParticipant implements IJavaScriptBreakpointParticipant {
-
- /**
- * Constructor
- */
- public RhinoBreakpointParticipant() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.breakpoints.IJavaScriptBreakpointParticipant#breakpointHit(org.eclipse.wst.jsdt.debug.core.model.IJavaScriptThread, org.eclipse.wst.jsdt.debug.core.breakpoints.IJavaScriptBreakpoint)
- */
- public int breakpointHit(IJavaScriptThread thread, IJavaScriptBreakpoint breakpoint) {
- try {
- if(breakpoint instanceof IJavaScriptLineBreakpoint) {
- IJavaScriptLineBreakpoint lbp = (IJavaScriptLineBreakpoint) breakpoint;
- String condition = lbp.getCondition();
- if (condition != null) {
- // evaluate it
- if (thread.getFrameCount() < 1) {
- return DONT_SUSPEND;
- }
- IJavaScriptValue value = thread.evaluate(condition);
- if (lbp.isConditionSuspendOnTrue()) {
- if(suspendForValue(value)) {
- return SUSPEND;
- }
- }
- if(!suspendForValue(value)) {
- return SUSPEND;
- }
- }
- return SUSPEND;
- }
- }
- catch (CoreException ce) {
- //ignore, just don't suspend
- }
- return DONT_SUSPEND;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.breakpoints.IJavaScriptBreakpointParticipant#scriptLoaded(org.eclipse.wst.jsdt.debug.core.model.IJavaScriptThread, org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference, org.eclipse.wst.jsdt.debug.core.breakpoints.IJavaScriptBreakpoint)
- */
- public int scriptLoaded(IJavaScriptThread thread, ScriptReference script, IJavaScriptBreakpoint breakpoint) {
- if(URIUtil.lastSegment(script.sourceURI()).equals(Constants.STD_IN) &&
- !RhinoPreferencesManager.suspendOnStdinLoad()) {
- return DONT_SUSPEND;
- }
- return SUSPEND;
- }
-
- /**
- * If the thread should suspend based on the given {@link Value}. Currently only suspend when the value is non-null and a {@link BooleanValue} that has the value <code>true</code>
- *
- * @param value
- * @return if we should suspend
- */
- private boolean suspendForValue(IJavaScriptValue value) {
- if(value instanceof IJavaScriptPrimitiveValue) {
- return ((IJavaScriptPrimitiveValue)value).booleanValue();
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ArrayReferenceImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ArrayReferenceImpl.java
deleted file mode 100644
index 061e2fd..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ArrayReferenceImpl.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ArrayReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Property;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Value;
-
-/**
- * Rhino implementation of {@link ArrayReference}
- *
- * @see ArrayReference
- * @see ObjectReferenceImpl
- * @since 1.0
- */
-public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayReference {
-
- /**
- * Empty array
- */
- protected static final Value[] NO_VALUES = new Value[0];
-
- /**
- * Raw list of {@link Value}s
- */
- private ArrayList values = null;
-
- /**
- * Constructor
- *
- * @param vm
- * @param stackFrameImpl
- * @param body
- */
- public ArrayReferenceImpl(VirtualMachineImpl vm, Map body, StackFrameImpl stackFrameImpl) {
- super(vm, body, stackFrameImpl);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ArrayReference#getValue(int)
- */
- public Value getValue(int index) throws IndexOutOfBoundsException {
- Value value = (Value) getValues().get(index);
- if (value == null) {
- return vm.mirrorOfNull();
- }
- return value;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ArrayReference#getValues()
- */
- public synchronized List getValues() {
- if (values == null) {
- Map members = new HashMap();
- int length = 0;
- for (Iterator iter = properties().iterator(); iter.hasNext();) {
- Property property = (Property) iter.next();
- if (Character.isDigit(property.name().charAt(0))) {
- members.put(Integer.valueOf(property.name()), property.value());
- } else if (property.name().equals("length")) { //$NON-NLS-1$
- length = Integer.parseInt(property.value().valueString());
- }
- }
- values = new ArrayList(length);
- for (int i = 0; i < length; i++) {
- Object value = members.get(new Integer(i));
- if (value == null) {
- value = new UndefinedValueImpl(vm);
- }
- values.add(value);
- }
- }
- return values;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ArrayReference#length()
- */
- public int length() {
- return getValues().size();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ObjectReferenceImpl#
- * valueString()
- */
- public String valueString() {
- return "Array"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ObjectReferenceImpl#toString
- * ()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(NLS.bind(Messages.ArrayReferenceImpl_array_count_, new String[] {Integer.toString(length()) }));
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/BooleanValueImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/BooleanValueImpl.java
deleted file mode 100644
index 2481c59..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/BooleanValueImpl.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.BooleanValue;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-/**
- * Rhino implementation of {@link BooleanValue}
- *
- * @since 1.0
- */
-public class BooleanValueImpl extends MirrorImpl implements BooleanValue {
-
- private Boolean value;
-
- /**
- * Constructor
- *
- * @param vm
- * @param body
- */
- public BooleanValueImpl(VirtualMachineImpl vm, Map body) {
- this(vm, (Boolean) body.get(JSONConstants.VALUE));
- }
-
- /**
- * Constructor
- *
- * @param vm
- * @param bool
- */
- public BooleanValueImpl(VirtualMachineImpl vm, Boolean bool) {
- super(vm);
- this.value = bool;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return value.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#intValue()
- */
- public int intValue() {
- return (value.booleanValue() ? 1 : 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#doubleValue()
- */
- public double doubleValue() {
- return intValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#booleanValue()
- */
- public boolean booleanValue() {
- return value.booleanValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#stringValue()
- */
- public String stringValue() {
- return value.toString();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return stringValue();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/FunctionReferenceImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/FunctionReferenceImpl.java
deleted file mode 100644
index 16817ac..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/FunctionReferenceImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.FunctionReference;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-/**
- * Rhino implementation of {@link FunctionReference}
- *
- * @see FunctionReference
- * @see ObjectReferenceImpl
- * @since 1.0
- */
-public class FunctionReferenceImpl extends ObjectReferenceImpl implements FunctionReference {
-
- private String functionName;
-
- /**
- * Constructor
- *
- * @param vm
- * @param body
- * @param stackFrameImpl
- */
- public FunctionReferenceImpl(VirtualMachineImpl vm, Map body, StackFrameImpl stackFrameImpl) {
- super(vm, body, stackFrameImpl);
- this.functionName = (String) body.get(JSONConstants.NAME);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.FunctionReference#functionName()
- */
- public String functionName() {
- return functionName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ObjectReferenceImpl#valueString()
- */
- public String valueString() {
- return "Function"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.FunctionReference#functionBody()
- */
- public String functionBody() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ObjectReferenceImpl#toString()
- */
- public String toString() {
- return valueString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/LocationImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/LocationImpl.java
deleted file mode 100644
index 22be41c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/LocationImpl.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.Comparator;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.Location;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference;
-
-/**
- * Rhino implementation of {@link Location}
- *
- * @since 1.0
- */
-public class LocationImpl extends MirrorImpl implements Location {
-
- /**
- * Comparator that orders {@link Location}s by line number - useful for debugging
- */
- static class LocationComparator implements Comparator {
- /* (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- int value = -1;
- if(o1 instanceof Location && o2 instanceof Location) {
- int first = ((Location)o1).lineNumber();
- int second = ((Location)o2).lineNumber();
- if(first == second) {
- value = 0;
- }
- else if(first > second) {
- value = 1;
- }
- }
- return value;
- }
-
- }
- private static LocationComparator comparator = new LocationComparator();
- private String functionName;
- private int lineNumber;
- private ScriptReferenceImpl scriptReference;
-
- /**
- * Constructor
- *
- * @param vm
- * @param functionName
- * @param lineNumber
- * @param scriptReference
- */
- public LocationImpl(VirtualMachineImpl vm, String functionName, int lineNumber, ScriptReferenceImpl scriptReference) {
- super(vm);
- this.functionName = functionName;
- this.lineNumber = lineNumber;
- this.scriptReference = scriptReference;
- }
-
- static LocationComparator getLocationComparator() {
- return comparator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Location#functionName()
- */
- public String functionName() {
- return functionName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Location#lineNumber()
- */
- public int lineNumber() {
- return lineNumber;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Location#scriptReference()
- */
- public ScriptReference scriptReference() {
- return scriptReference;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("LocationImpl: "); //$NON-NLS-1$
- buffer.append("[script - ").append(scriptReference.sourceURI()).append("] "); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("[function - ").append(functionName).append("] "); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("[line - ").append(lineNumber).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/Messages.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/Messages.java
deleted file mode 100644
index ff82d7c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/Messages.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.messages"; //$NON-NLS-1$
- public static String ArrayReferenceImpl_array_count_;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/MirrorImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/MirrorImpl.java
deleted file mode 100644
index 1d15e66..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/MirrorImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.Mirror;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-
-/**
- * Rhino implementation of {@link Mirror}
- *
- * @since 1.0
- */
-public class MirrorImpl implements Mirror {
-
- protected final VirtualMachineImpl vm;
-
- /**
- * Constructor
- *
- * @param vm
- * @param description
- */
- public MirrorImpl(VirtualMachineImpl vm) {
- this.vm = vm;
- }
-
- /**
- * This constructor is only to be used by {@link VirtualMachineImpl}. The name
- * field is not store anywhere or used in any way.
- *
- * @param name
- * @noreference This constructor is not intended to be referenced by clients.
- */
- public MirrorImpl(String name) {
- vm = (VirtualMachineImpl)this;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Mirror#virtualMachine()
- */
- public VirtualMachine virtualMachine() {
- return this.vm;
- }
-
- /**
- * Re-throws the given exception as a {@link RuntimeException} with the given message
- * @param message
- * @param t
- * @since 1.1
- */
- protected void handleException(String message, Throwable t) {
- throw new RuntimeException(message, t);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/NullValueImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/NullValueImpl.java
deleted file mode 100644
index be4da9c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/NullValueImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.NullValue;
-
-/**
- * Rhino implementation of {@link NullValue}
- *
- * @since 1.0
- */
-public final class NullValueImpl extends MirrorImpl implements NullValue {
-
- static final String NULL_VALUE = "Null"; //$NON-NLS-1$
-
- /**
- * Constructor
- *
- * @param vm
- * @param description
- */
- public NullValueImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return NULL_VALUE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return valueString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/NumberValueImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/NumberValueImpl.java
deleted file mode 100644
index 6bb6842..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/NumberValueImpl.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.NumberValue;
-import org.eclipse.wst.jsdt.debug.core.model.JavaScriptDebugModel;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-/**
- * Rhino implementation of {@link NumberValue}
- *
- * @since 1.0
- */
-public class NumberValueImpl extends MirrorImpl implements NumberValue {
-
- /**
- * The underlying value
- */
- private Number value;
-
- /**
- * Constructor
- *
- * @param vm
- * @param body
- */
- public NumberValueImpl(VirtualMachineImpl vm, Map body) {
- this(vm, (Number) body.get(JSONConstants.VALUE));
- }
-
- /**
- * Constructor
- *
- * @param vm
- * @param number
- */
- public NumberValueImpl(VirtualMachineImpl vm, Number number) {
- super(vm);
- this.value = number;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.NumberValue#value()
- */
- public Number value() {
- return value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.NumberValue#isNaN()
- */
- public boolean isNaN() {
- return value == null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return JavaScriptDebugModel.numberToString(value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#intValue()
- */
- public int intValue() {
- return value.intValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#doubleValue()
- */
- public double doubleValue() {
- return value.doubleValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#booleanValue()
- */
- public boolean booleanValue() {
- return (value.intValue() > 0 ? true : false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.PrimitiveValue#stringValue()
- */
- public String stringValue() {
- return JavaScriptDebugModel.numberToString(value);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return stringValue();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ObjectReferenceImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ObjectReferenceImpl.java
deleted file mode 100644
index 6deb115..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ObjectReferenceImpl.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ObjectReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Property;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Value;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-/**
- * Rhino implementation of {@link ObjectReference}
- *
- * @see MirrorImpl
- * @see ObjectReference
- * @see Property
- * @since 1.0
- */
-public class ObjectReferenceImpl extends MirrorImpl implements ObjectReference {
-
- protected static final ArrayList NO_PROPERTIES = new ArrayList(0);
-
- /**
- * The name of the class backing this object
- */
- private final String className;
- /**
- * The reference id to the constructor for this object
- */
- private final Number constructorRef;
- /**
- * The reference id to the prototype for this object
- */
- private final Number prototypeRef;
- /**
- * The reference id for this object
- */
- private final Number id;
- /**
- * The stackframe context for this object
- */
- protected StackFrameImpl frame;
- /**
- * The JSDI handle to the constructor for this object - lazily computed in {@link #constructor()}
- */
- private Value constructor = null;
- /**
- * The JSDI handle to the prototype for this object - lazily computed in {@link #prototype()}
- */
- private Value prototype = null;
- /**
- * The backing list of {@link PropertyReference}s for this object
- */
- private List properties = null;
-
- /**
- * Constructor
- *
- * @param vm
- * @param body
- * @param frame
- */
- public ObjectReferenceImpl(VirtualMachineImpl vm, Map body, StackFrameImpl frame) {
- super(vm);
- this.frame = frame;
- this.className = (String) body.get(JSONConstants.CLASS_NAME);
- this.id = (Number) body.get(JSONConstants.HANDLE);
- this.constructorRef = (Number) ((Map) body.get(JSONConstants.CONSTRUCTOR_FUNCTION)).get(JSONConstants.REF);
- this.prototypeRef = (Number) ((Map) body.get(JSONConstants.PROTOTYPE_OBJECT)).get(JSONConstants.REF);
- List proplist = (List) body.get(JSONConstants.PROPERTIES);
- if (proplist != null) {
- this.properties = new ArrayList(proplist.size());
- Map props = null;
- for (Iterator iter = proplist.iterator(); iter.hasNext();) {
- props = (Map) iter.next();
- this.properties.add(new PropertyImpl(vm, frame, props.get(JSONConstants.NAME).toString(), (Number) props.get(JSONConstants.REF)));
- }
- } else {
- this.properties = NO_PROPERTIES;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ObjectReference#className()
- */
- public String className() {
- return this.className;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ObjectReference#constructor()
- */
- public Value constructor() {
- synchronized (this.frame) {
- if (this.constructor == null) {
- this.constructor = this.frame.lookupValue(constructorRef);
- if (this.constructor == null) {
- this.constructor = this.vm.mirrorOfNull();
- }
- }
- }
- return this.constructor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ObjectReference#prototype()
- */
- public Value prototype() {
- synchronized (this.frame) {
- if (this.prototype == null) {
- this.prototype = this.frame.lookupValue(prototypeRef);
- if (this.prototype == null) {
- this.prototype = this.vm.mirrorOfNull();
- }
- }
- }
- return this.prototype;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ObjectReference#properties()
- */
- public List properties() {
- return this.properties;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("Object Reference\n"); //$NON-NLS-1$
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return "Object"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ObjectReference#id()
- */
- public Number id() {
- return this.id;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/PropertyImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/PropertyImpl.java
deleted file mode 100644
index 3b63bbc..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/PropertyImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.Property;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Value;
-
-/**
- * Rhino implementation of {@link Property}
- *
- * @see MirrorImpl
- * @see Property
- * @see Value
- * @since 1.0
- */
-public class PropertyImpl extends MirrorImpl implements Property {
-
- /**
- * The name of the property
- */
- private String name;
- /**
- * The reference used to look up the property value in the stackframe
- * context
- */
- private Number ref;
- private StackFrameImpl frame;
- private Value value;
-
- /**
- * Constructor
- *
- * @param vm
- * @param name
- * @param ref
- */
- public PropertyImpl(VirtualMachineImpl vm, StackFrameImpl frame,
- String name, Number ref) {
- super(vm);
- this.frame = frame;
- this.name = name;
- this.ref = ref;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Property#name()
- */
- public String name() {
- return name;
- }
-
- /**
- * The reference id of this property
- *
- * @return the reference id of this property
- */
- public Number getRef() {
- return ref;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StringValue#value()
- */
- public Value value() {
- synchronized (this.frame) {
- if (this.value == null) {
- this.value = frame.lookupValue(ref);
- }
- }
- return this.value;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ScriptReferenceImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ScriptReferenceImpl.java
deleted file mode 100644
index 315e945..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ScriptReferenceImpl.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Location;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference;
-import org.eclipse.wst.jsdt.debug.internal.rhino.RhinoDebugPlugin;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.osgi.framework.Constants;
-
-/**
- * Rhino implementation of {@link ScriptReference}
- *
- * @see MirrorImpl
- * @see ScriptReference
- * @since 1.0
- */
-public class ScriptReferenceImpl extends MirrorImpl implements ScriptReference {
-
- /**
- * The id of the script - this can be used to look it up in the {@link VirtualMachineImpl}
- */
- private final Long scriptId;
- private String sourcePath = null;
- private URI sourceuri = null;
- private final String source;
- private final Boolean generated;
- private final List lineLocations = new ArrayList();
- private final List functionLocations = new ArrayList();
- private Map sourceProperties = null;
-
- /**
- * Constructor
- *
- * @param vm
- * @param jsonScript
- */
- public ScriptReferenceImpl(VirtualMachineImpl vm, Map jsonScript) {
- super(vm);
- this.scriptId = new Long(((Number) jsonScript.get(JSONConstants.SCRIPT_ID)).longValue());
- this.sourcePath = (String) jsonScript.get(JSONConstants.LOCATION);
- this.sourceProperties = (Map) jsonScript.get(JSONConstants.PROPERTIES);
- this.source = (String) jsonScript.get(JSONConstants.SOURCE);
- this.generated = (Boolean) jsonScript.get(JSONConstants.GENERATED);
- List lines = (List) jsonScript.get(JSONConstants.LINES);
- for (Iterator iterator = lines.iterator(); iterator.hasNext();) {
- Number lineNumber = (Number) iterator.next();
- Location location = new LocationImpl(vm, null, lineNumber.intValue(), this);
- lineLocations.add(location);
- }
- List functions = (List) jsonScript.get(JSONConstants.FUNCTIONS);
- for (Iterator iterator = functions.iterator(); iterator.hasNext();) {
- String functionName = (String) iterator.next();
- Location location = new LocationImpl(vm, functionName, 0, this);
- functionLocations.add(location);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#allFunctionLocations()
- */
- public List allFunctionLocations() {
- return Collections.unmodifiableList(functionLocations);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#allLineLocations()
- */
- public List allLineLocations() {
- return Collections.unmodifiableList(lineLocations);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#functionLocation(java.lang.String)
- */
- public Location functionLocation(String functionName) {
- for (Iterator iterator = functionLocations.iterator(); iterator.hasNext();) {
- Location location = (Location) iterator.next();
- if (location.functionName().equals(functionName))
- return location;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#lineLocation(int)
- */
- public Location lineLocation(int lineNumber) {
- for (Iterator iterator = lineLocations.iterator(); iterator.hasNext();) {
- Location location = (Location) iterator.next();
- if (location.lineNumber() == lineNumber)
- return location;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#source()
- */
- public String source() {
- return source;
- }
-
- /**
- * @return the id of the {@link ScriptReference}
- */
- public Long getScriptId() {
- return scriptId;
- }
-
-
- /**
- * Return if the script is generated or not
- * @return <code>true</code> if the script was generated <code>false</code> otherwise
- */
- public boolean isGenerated() {
- return generated.booleanValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference#sourceURI()
- */
- public synchronized URI sourceURI() {
- if (this.sourceuri == null) {
- try {
- if (this.sourceProperties != null) {
- IPath path = new Path((String) this.sourceProperties.get(Constants.BUNDLE_SYMBOLICNAME));
- path = path.append((String) this.sourceProperties.get(JSONConstants.PATH));
- path = path.append((String) this.sourceProperties.get(JSONConstants.NAME));
- this.sourceuri = URI.create(path.toString());
- } else if (this.sourcePath != null) {
- this.sourceuri = URI.create(sourcePath);
- } else {
- this.sourceuri = RhinoDebugPlugin.fileURI(new Path("script")); //$NON-NLS-1$
- }
- } catch (URISyntaxException urise) {
- RhinoDebugPlugin.log(urise);
- }
- }
- return this.sourceuri;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("ScriptReferenceImpl: "); //$NON-NLS-1$
- buffer.append("[sourceuri - ").append(sourceURI()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("Line locations: \n"); //$NON-NLS-1$
- List list = new ArrayList(allLineLocations());
- Collections.sort(list, LocationImpl.getLocationComparator());
- for (Iterator iter = list.iterator(); iter.hasNext();) {
- Location loc = (Location) iter.next();
- buffer.append("\t").append(loc.toString()).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- buffer.append("Function locations: \n"); //$NON-NLS-1$
- list = new ArrayList(allFunctionLocations());
- Collections.sort(list, LocationImpl.getLocationComparator());
- for (Iterator iter = list.iterator(); iter.hasNext();) {
- Location loc = (Location) iter.next();
- buffer.append("\t").append(loc.toString()).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- buffer.append("\n"); //$NON-NLS-1$
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/StackFrameImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/StackFrameImpl.java
deleted file mode 100644
index 4044e8c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/StackFrameImpl.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.Location;
-import org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Value;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Variable;
-import org.eclipse.wst.jsdt.debug.internal.rhino.RhinoDebugPlugin;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.DisconnectedException;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Response;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TimeoutException;
-
-/**
- * Rhino implementation of {@link StackFrame}
- *
- * @see MirrorImpl
- * @see StackFrame
- * @since 1.0
- */
-public class StackFrameImpl extends MirrorImpl implements StackFrame {
-
- private final Number frameId;
- private final Number threadId;
- private final Number contextId;
- private final Number ref;
- private final Location location;
- private List variables;
- private VariableImpl thisVariable;
- private HashMap cache = new HashMap();
-
- /**
- * Constructor
- *
- * @param vm
- * @param jsonFrame
- */
- public StackFrameImpl(VirtualMachineImpl vm, Map jsonFrame) {
- super(vm);
- this.threadId = (Number) jsonFrame.get(JSONConstants.THREAD_ID);
- this.frameId = (Number) jsonFrame.get(JSONConstants.FRAME_ID);
- this.contextId = (Number) jsonFrame.get(JSONConstants.CONTEXT_ID);
- this.ref = (Number) jsonFrame.get(JSONConstants.REF);
-
- Long scriptId = new Long(((Number) jsonFrame.get(JSONConstants.SCRIPT_ID)).longValue());
- ScriptReferenceImpl script = vm.getScript(scriptId);
-
- String function = (String) jsonFrame.get(JSONConstants.FUNCTION);
- if (function != null) {
- this.location = script.functionLocation(function);
- } else {
- Number line = (Number) jsonFrame.get(JSONConstants.LINE);
- Location lineLocation = script.lineLocation(line.intValue());
- this.location = lineLocation != null ? lineLocation : new LocationImpl(vm, function, line.intValue(), script);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame#evaluate(java.lang.String)
- */
- public Value evaluate(String expression) {
- Request request = new Request(JSONConstants.EVALUATE);
- request.getArguments().put(JSONConstants.THREAD_ID, threadId);
- request.getArguments().put(JSONConstants.FRAME_ID, frameId);
- request.getArguments().put(JSONConstants.EXPRESSION, expression);
- try {
- Response response = vm.sendRequest(request, 30000);
- return createValue(response.getBody(), true);
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- return null;
- }
-
- /**
- * Utility method to look up the {@link Value} with the given reference id <br>
- * or <code>null</code> if there is no {@link Value} with the given id
- *
- * @param ref
- * @return the {@link Value} or <code>null</code>
- */
- public Value lookupValue(Number ref) {
- Value value = (Value) this.cache.get(ref);
- if (value == null) {
- Request request = new Request(JSONConstants.LOOKUP);
- request.getArguments().put(JSONConstants.THREAD_ID, threadId);
- request.getArguments().put(JSONConstants.FRAME_ID, frameId);
- request.getArguments().put(JSONConstants.HANDLE, ref);
- try {
- Response response = vm.sendRequest(request, 30000);
- value = createValue(response.getBody(), false);
- this.cache.put(ref, value);
- return value;
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- }
- return value;
- }
-
- /**
- * Creates a new type value for the given type description in the map
- *
- * @param body
- * @param iseval
- * @return the new type
- * @throws IllegalStateException
- * if the type description in the map is unknown
- */
- private Value createValue(Map body, boolean iseval) throws IllegalStateException {
- Map value = (Map) body.get((iseval ? JSONConstants.EVALUATE : JSONConstants.LOOKUP));
- if(value == null) {
- return vm.nullValue;
- }
- String type = (String) value.get(JSONConstants.TYPE);
- if(type == null) {
- return vm.nullValue;
- }
- // "undefined", "null", "boolean", "number", "string", "object",
- // "function"
-
- if (type.equals(JSONConstants.UNDEFINED)) {
- return vm.undefinedValue;
- } else if (type.equals(JSONConstants.NULL)) {
- return vm.nullValue;
- } else if (type.equals(JSONConstants.BOOLEAN)) {
- return new BooleanValueImpl(vm, value);
- } else if (type.equals(JSONConstants.NUMBER)) {
- return new NumberValueImpl(vm, value);
- } else if (type.equals(JSONConstants.STRING)) {
- return new StringValueImpl(vm, value);
- } else if (type.equals(JSONConstants.OBJECT)) {
- return new ObjectReferenceImpl(vm, value, this);
- } else if (type.equals(JSONConstants.FUNCTION)) {
- return new FunctionReferenceImpl(vm, value, this);
- } else if (type.equals(JSONConstants.ARRAY)) {
- return new ArrayReferenceImpl(vm, value, this);
- }
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame#location()
- */
- public Location location() {
- return location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame#thisObject()
- */
- public synchronized Variable thisObject() {
- initializeVariables();
- return thisVariable;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame#variables()
- */
- public synchronized List variables() {
- initializeVariables();
- return variables;
- }
-
- /**
- * Initializes and caches the live set of variables
- */
- private void initializeVariables() {
- if (variables != null) {
- return;
- }
- Request request = new Request(JSONConstants.LOOKUP);
- request.getArguments().put(JSONConstants.THREAD_ID, threadId);
- request.getArguments().put(JSONConstants.FRAME_ID, frameId);
- request.getArguments().put(JSONConstants.HANDLE, ref);
- try {
- Response response = vm.sendRequest(request, 30000);
- Map lookup = (Map) response.getBody().get(JSONConstants.LOOKUP);
- List properties = (List) lookup.get(JSONConstants.PROPERTIES);
- variables = new ArrayList();
- for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
- Map property = (Map) iterator.next();
- String name = (String) property.get(JSONConstants.NAME);
- Number ref = (Number) property.get(JSONConstants.REF);
- VariableImpl variable = new VariableImpl(vm, this, name, ref);
- if (name.equals(JSONConstants.THIS))
- thisVariable = variable;
- else
- variables.add(variable);
- }
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- }
-
- /**
- * Returns if this stack frame is visible
- *
- * @param variable
- * @return true if this frame is visible, false otherwise
- */
- public synchronized boolean isVisible(VariableImpl variable) {
- return variables != null && (thisVariable == variable || variables.contains(variable));
- }
-
- /**
- * @return the context id for this frame
- */
- public Number getContextId() {
- return contextId;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/StringValueImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/StringValueImpl.java
deleted file mode 100644
index 3bf19c2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/StringValueImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.StringValue;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-/**
- * Rhino implementation of {@link StringValue}
- *
- * @since 1.0
- */
-public class StringValueImpl extends MirrorImpl implements StringValue {
-
- private String value;
-
- /**
- * Constructor
- *
- * @param vm
- * @param value
- */
- public StringValueImpl(VirtualMachineImpl vm, String value) {
- super(vm);
- this.value = value;
- }
-
- /**
- * Constructor
- *
- * @param vm
- * @param body
- */
- public StringValueImpl(VirtualMachineImpl vm, Map body) {
- this(vm, (String) body.get(JSONConstants.VALUE));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StringValue#value()
- */
- public String value() {
- return value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return value;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ThreadReferenceImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ThreadReferenceImpl.java
deleted file mode 100644
index c2d92f1..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ThreadReferenceImpl.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.internal.rhino.RhinoDebugPlugin;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.DisconnectedException;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Response;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TimeoutException;
-
-/**
- * Rhino implementation of {@link ThreadReference}
- *
- * @since 1.0
- */
-public class ThreadReferenceImpl extends MirrorImpl implements ThreadReference {
-
- private Number threadId;
- private List frames;
- private int status = THREAD_STATUS_RUNNING;
- private boolean suspended;
- private boolean atBreakpoint = false;
- private String name;
- private String step;
-
- /**
- * Constructor
- *
- * @param vm
- * @param jsonThread
- */
- public ThreadReferenceImpl(VirtualMachineImpl vm, Map jsonThread) {
- super(vm);
- this.threadId = (Number) jsonThread.get(JSONConstants.THREAD_ID);
- this.name = (String) jsonThread.get(JSONConstants.NAME);
- if (this.name == null) {
- // TODO NLS this
- this.name = "Rhino - " + threadId; //$NON-NLS-1$
- }
- this.suspended = JSONConstants.SUSPENDED.equals(jsonThread.get(JSONConstants.STATE));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#frameCount()
- */
- public synchronized int frameCount() {
- frames();
- return (frames == null ? 0 : frames.size());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#frame(int)
- */
- public synchronized StackFrame frame(int index) {
- frames();
- return (StackFrame) frames.get(index);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#frames()
- */
- public synchronized List frames() {
- if (!suspended || status == THREAD_STATUS_ZOMBIE) {
- return Collections.EMPTY_LIST;
- }
- if (frames != null) {
- return frames;
- }
- Request request = new Request(JSONConstants.FRAMES);
- request.getArguments().put(JSONConstants.THREAD_ID, threadId);
- try {
- Response response = vm.sendRequest(request, 30000);
- List frameIds = (List) response.getBody().get(JSONConstants.FRAMES);
- if (frameIds.isEmpty()) {
- return Collections.EMPTY_LIST;
- }
- frames = new ArrayList();
- for (Iterator iterator = frameIds.iterator(); iterator.hasNext();) {
- Long frameId = new Long(((Number) iterator.next()).longValue());
- StackFrameImpl frame = createStackFrame(frameId);
- frames.add(frame);
- }
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- if(frames != null) {
- return frames;
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Sends a request to make a new {@link StackFrameReference} in the current debugger.
- * Returns a new {@link StackFrameReference} on success, <code>null</code> on failure
- *
- * @param frameId
- * @return a new {@link StackFrameReference} or <code>null</code>
- */
- private StackFrameImpl createStackFrame(Long frameId) {
- Request request = new Request(JSONConstants.FRAME);
- request.getArguments().put(JSONConstants.THREAD_ID, threadId);
- request.getArguments().put(JSONConstants.FRAME_ID, frameId);
- try {
- Response response = vm.sendRequest(request);
- Map jsonFrame = (Map) response.getBody().get(JSONConstants.FRAME);
- return new StackFrameImpl(vm, jsonFrame);
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#isAtBreakpoint()
- */
- public synchronized boolean isAtBreakpoint() {
- return suspended && atBreakpoint;
- }
-
- /**
- * Marks the current thread reference as suspended
- *
- * @param atBreakpoint
- */
- public synchronized void markSuspended(boolean atBreakpoint) {
- this.suspended = true;
- this.atBreakpoint = atBreakpoint;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#isSuspended()
- */
- public synchronized boolean isSuspended() {
- return suspended;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#name()
- */
- public String name() {
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#resume()
- */
- public synchronized void resume() {
- if (status == THREAD_STATUS_ZOMBIE) {
- return;
- }
- Request request = new Request(JSONConstants.CONTINUE);
- request.getArguments().put(JSONConstants.THREAD_ID, threadId);
- if (step != null) {
- request.getArguments().put(JSONConstants.STEP, step);
- }
- try {
- Response response = vm.sendRequest(request);
- if (response.isSuccess()) {
- step = null;
- frames = null;
- suspended = false;
- atBreakpoint = false;
- }
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#suspend()
- */
- public synchronized void suspend() {
- if (status == THREAD_STATUS_ZOMBIE) {
- return;
- }
- Request request = new Request(JSONConstants.SUSPEND);
- request.getArguments().put(JSONConstants.THREAD_ID, threadId);
- try {
- Response response = vm.sendRequest(request);
- if(response.isSuccess()) {
- markSuspended(false);
- }
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#interrupt()
- */
- public void interrupt() {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#status()
- */
- public synchronized int status() {
- return status;
- }
-
- /**
- * Returns the step type
- *
- * @return the step type
- * @see JSONConstants#STEP_IN
- * @see JSONConstants#STEP_NEXT
- * @see JSONConstants#STEP_OUT
- */
- public synchronized String getStep() {
- return step;
- }
-
- /**
- * Sets the current step type
- *
- * @param step
- * @see JSONConstants#STEP_IN
- * @see JSONConstants#STEP_NEXT
- * @see JSONConstants#STEP_OUT
- */
- public synchronized void setStep(String step) {
- this.step = step;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/UndefinedValueImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/UndefinedValueImpl.java
deleted file mode 100644
index 191ef70..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/UndefinedValueImpl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.UndefinedValue;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-/**
- * Rhino implementation of {@link UndefinedValue}
- *
- * @see MirrorImpl
- * @see UndefinedValue
- * @since 1.0
- */
-public class UndefinedValueImpl extends MirrorImpl implements UndefinedValue {
-
- static final String UNDEFINED_VALUE = "Undefined"; //$NON-NLS-1$
-
- /**
- * Constructor
- *
- * @param vm
- */
- public UndefinedValueImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.StringValue#value()
- */
- public String value() {
- return JSONConstants.UNDEFINED;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Value#valueString()
- */
- public String valueString() {
- return UNDEFINED_VALUE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return valueString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/VariableImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/VariableImpl.java
deleted file mode 100644
index 08fee0f..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/VariableImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame;
-import org.eclipse.wst.jsdt.debug.core.jsdi.Variable;
-
-/**
- * Rhino implementation of a {@link Variable}
- *
- * @since 1.0
- */
-public class VariableImpl extends PropertyImpl implements Variable {
-
- /**
- * Constructor
- * @param vm
- * @param frame
- * @param name
- * @param ref
- */
- public VariableImpl(VirtualMachineImpl vm, StackFrameImpl frame, String name, Number ref) {
- super(vm, frame, name, ref);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Variable#isArgument()
- */
- public boolean isArgument() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Variable#isVisible(org.eclipse.wst.jsdt.debug.core.jsdi.StackFrame)
- */
- public boolean isVisible(StackFrame frame) {
- StackFrameImpl frameImpl = (StackFrameImpl) frame;
- return frameImpl.isVisible(this);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/VirtualMachineImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/VirtualMachineImpl.java
deleted file mode 100644
index c25dfb7..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/VirtualMachineImpl.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.BooleanValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.NullValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.NumberValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.StringValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.UndefinedValue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.core.jsdi.event.EventQueue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager;
-import org.eclipse.wst.jsdt.debug.internal.rhino.Constants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.RhinoDebugPlugin;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.event.EventQueueImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.EventRequestManagerImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.DebugSession;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.DisconnectedException;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.EventPacket;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Response;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TimeoutException;
-
-/**
- * Rhino implementation of {@link VirtualMachine}
- *
- * @since 1.0
- */
-public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine {
-
- public final UndefinedValueImpl undefinedValue = new UndefinedValueImpl(this);
- public final NullValueImpl nullValue = new NullValueImpl(this);
-
- private final Map scripts = new HashMap();
- private final DebugSession session;
- private EventRequestManagerImpl eventRequestManager = new EventRequestManagerImpl(this);
- private final EventQueue eventQueue = new EventQueueImpl(this, eventRequestManager);
- private Map threads = new HashMap();
- private boolean disconnected = false;
-
- /**
- * Constructor
- *
- * @param debugSession
- */
- public VirtualMachineImpl(DebugSession debugSession) {
- super(Constants.SPACE);
- this.session = debugSession;
- initalizeScripts();
- }
-
- /**
- * loads the scripts
- */
- private void initalizeScripts() {
- Request request = new Request(JSONConstants.SCRIPTS);
- try {
- Response response = sendRequest(request);
- List scriptIds = (List) response.getBody().get(JSONConstants.SCRIPTS);
- for (Iterator iterator = scriptIds.iterator(); iterator.hasNext();) {
- Long scriptId = new Long(((Number) iterator.next()).longValue());
- ScriptReferenceImpl script = createScriptReference(scriptId);
- if(script != null) {
- scripts.put(scriptId, script);
- }
- }
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- }
-
- /**
- * Creates a new {@link ScriptReferenceImpl} for the given ID
- * @param scriptId
- * @return the new {@link ScriptReferenceImpl} or <code>null</code>
- */
- private ScriptReferenceImpl createScriptReference(Long scriptId) {
- Request request = new Request(JSONConstants.SCRIPT);
- request.getArguments().put(JSONConstants.SCRIPT_ID, scriptId);
- try {
- Response response = sendRequest(request, DEFAULT_TIMEOUT);
- Map jsonScript = (Map) response.getBody().get(JSONConstants.SCRIPT);
- return new ScriptReferenceImpl(this, jsonScript);
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#allScripts()
- */
- public synchronized List allScripts() {
- return new ArrayList(scripts.values());
- }
-
- /**
- * Adds a new script to the {@link VirtualMachine} with the given ID and returns
- * it.
- * @param scriptId
- * @param script
- */
- public synchronized ScriptReferenceImpl addScript(Long scriptId) {
- ScriptReferenceImpl script = (ScriptReferenceImpl) scripts.get(scriptId);
- if (script != null) {
- return script;
- }
- script = createScriptReference(scriptId);
- if (script != null) {
- scripts.put(scriptId, script);
- }
- return script;
- }
-
- /**
- * Returns the {@link ScriptReferenceImpl} for the given ID or <code>null</code>
- * if no such {@link ScriptReferenceImpl} exists.
- * @param scriptId
- * @return the {@link ScriptReferenceImpl} for the given ID or <code>null</code>
- */
- public synchronized ScriptReferenceImpl getScript(Long scriptId) {
- return (ScriptReferenceImpl) scripts.get(scriptId);
- }
-
- /**
- * @param timeout
- * @return
- * @throws TimeoutException
- * @throws DisconnectedException
- */
- public EventPacket receiveEvent(int timeout) throws TimeoutException, DisconnectedException {
- return session.receiveEvent(timeout);
- }
-
- /**
- * Sends a request to the backing {@link DebugSession}
- *
- * @param request
- * @param timeout
- * @return the {@link Response} for the request
- * @throws TimeoutException
- * @throws DisconnectedException
- */
- public Response sendRequest(Request request, int timeout) throws TimeoutException, DisconnectedException {
- session.sendRequest(request);
- return session.receiveResponse(request.getSequence(), timeout);
- }
-
- /**
- * Sends the given {@link Request} using the default timeout
- * @param request
- * @return the {@link Response} from the request
- * @throws TimeoutException
- * @throws DisconnectedException
- */
- public Response sendRequest(Request request) throws TimeoutException, DisconnectedException {
- return sendRequest(request, DEFAULT_TIMEOUT);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#allThreads()
- */
- public synchronized List allThreads() {
- Request request = new Request(JSONConstants.THREADS);
- try {
- Response response = sendRequest(request);
- List threadIds = (List) response.getBody().get(JSONConstants.THREADS);
- HashMap allThreads = new HashMap(threadIds.size());
- for (Iterator iterator = threadIds.iterator(); iterator.hasNext();) {
- Long threadId = new Long(((Number) iterator.next()).longValue());
- ThreadReferenceImpl thread = (ThreadReferenceImpl) threads.get(threadId);
- if (thread == null) {
- thread = createThreadReference(threadId);
- }
- if(thread != null) {
- allThreads.put(threadId, thread);
- }
- }
- threads = allThreads;
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- return new ArrayList(threads.values());
- }
-
- /**
- * Removes the thread with the given ID
- * @param threadId
- * @return the {@link ThreadReferenceImpl} that has been removed
- */
- public synchronized ThreadReferenceImpl removeThread(Long threadId) {
- return (ThreadReferenceImpl) threads.remove(threadId);
- }
-
- /**
- * Creates a new {@link ThreadReferenceImpl} with the given ID
- * @param threadId
- * @return the new {@link ThreadReferenceImpl} or <code>null</code>
- */
- private ThreadReferenceImpl createThreadReference(Long threadId) {
- Request request = new Request(JSONConstants.THREAD);
- request.getArguments().put(JSONConstants.THREAD_ID, threadId);
- try {
- Response response = sendRequest(request, DEFAULT_TIMEOUT);
- Map jsonThread = (Map) response.getBody().get(JSONConstants.THREAD);
- if (jsonThread == null) {
- return null;
- }
- return new ThreadReferenceImpl(this, jsonThread);
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- return null;
- }
-
- /**
- * Returns the {@link ThreadReferenceImpl} with the given ID or
- * create and return a new one if it does not exist
- * @param threadId
- * @return the {@link ThreadReferenceImpl} for the given ID or <code>null</code>
- * if the request to create a new one fails
- */
- public synchronized ThreadReferenceImpl getThread(Long threadId) {
- ThreadReferenceImpl thread = (ThreadReferenceImpl) threads.get(threadId);
- if (thread == null) {
- thread = createThreadReference(threadId);
- if (thread != null) {
- threads.put(threadId, thread);
- }
- }
- return thread;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#description()
- */
- public String description() {
- Request request = new Request(JSONConstants.VERSION);
- try {
- Response response = sendRequest(request);
- StringBuffer buffer = new StringBuffer();
- buffer.append((String) response.getBody().get(JSONConstants.VM_VENDOR)).append(Constants.SPACE);
- buffer.append(response.getBody().get(JSONConstants.VM_NAME)).append(Constants.SPACE);
- buffer.append(response.getBody().get(JSONConstants.VM_VERSION));
- return buffer.toString();
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#dispose()
- */
- public void dispose() {
- Request request = new Request(JSONConstants.DISPOSE);
- try {
- sendRequest(request);
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- } finally {
- disconnectVM();
- this.eventRequestManager.createVMDeathRequest();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#name()
- */
- public String name() {
- Request request = new Request(JSONConstants.VERSION);
- try {
- Response response = sendRequest(request);
- return (String) response.getBody().get(JSONConstants.VM_NAME);
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#resume()
- */
- public void resume() {
- Request request = new Request(JSONConstants.CONTINUE);
- try {
- sendRequest(request);
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#suspend()
- */
- public void suspend() {
- Request request = new Request(JSONConstants.SUSPEND);
- try {
- sendRequest(request);
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#terminate()
- */
- public void terminate() {
- dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#version()
- */
- public String version() {
- Request request = new Request(JSONConstants.VERSION);
- try {
- Response response = sendRequest(request);
- return (String) response.getBody().get(JSONConstants.VM_VERSION);
- } catch (DisconnectedException e) {
- disconnectVM();
- handleException(e.getMessage(), e);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- }
- return null;
- }
-
- /**
- * disconnects the VM and creates the correct requests
- */
- public void disconnectVM() {
- if (this.disconnected) {
- // no-op it is already disconnected
- return;
- }
- try {
- this.session.dispose();
- } finally {
- this.disconnected = true;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOf(boolean)
- */
- public BooleanValue mirrorOf(boolean bool) {
- return new BooleanValueImpl(this, Boolean.valueOf(bool));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOf(java.lang.Number)
- */
- public NumberValue mirrorOf(Number number) {
- return new NumberValueImpl(this, number);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOf(java.lang.String)
- */
- public StringValue mirrorOf(String string) {
- return new StringValueImpl(this, string);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOfNull()
- */
- public NullValue mirrorOfNull() {
- return nullValue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#mirrorOfUndefined()
- */
- public UndefinedValue mirrorOfUndefined() {
- return undefinedValue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#eventRequestManager()
- */
- public EventRequestManager eventRequestManager() {
- return eventRequestManager;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine#eventQueue()
- */
- public EventQueue eventQueue() {
- return eventQueue;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/HostArgument.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/HostArgument.java
deleted file mode 100644
index 6d7f26a..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/HostArgument.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.connect;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.StringArgument;
-
-/**
- * Implementation of a string argument that describes the host argument
- *
- * @since 1.0
- */
-public class HostArgument implements StringArgument {
-
- private static final long serialVersionUID = 3057403815318177030L;
- private String host;
-
- /**
- * Host attribute name
- */
- public static final String HOST = "host"; //$NON-NLS-1$
-
- /**
- * Constructor
- *
- * @param host
- */
- public HostArgument(String host) {
- setValue(host);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#description()
- */
- public String description() {
- return Messages.HostArgument_description;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.StringArgument#isValid(java.lang.String)
- */
- public boolean isValid(String value) {
- return value != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#label()
- */
- public String label() {
- return Messages.HostArgument_label;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#mustSpecify()
- */
- public boolean mustSpecify() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#name()
- */
- public String name() {
- return HOST;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#setValue(java.lang.String)
- */
- public void setValue(String host) {
- if (!isValid(host)) {
- throw new IllegalArgumentException();
- }
- this.host = host;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#value()
- */
- public String value() {
- return host;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/Messages.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/Messages.java
deleted file mode 100644
index 2c57f65..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/Messages.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.connect;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Rhino messages
- *
- * @since 1.0
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.connect.messages"; //$NON-NLS-1$
- public static String HostArgument_description;
- public static String HostArgument_label;
- public static String PortArgument_description;
- public static String PortArgument_label;
- public static String RhinoAttachingConnector_description;
- public static String RhinoAttachingConnector_name;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/PortArgument.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/PortArgument.java
deleted file mode 100644
index c51a547..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/PortArgument.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.connect;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument;
-
-/**
- * Implementation of an {@link IntegerArgument} that describes the port to try connecting to
- *
- * @since 1.0
- */
-public class PortArgument implements IntegerArgument {
-
- private static final long serialVersionUID = -1954469572907116388L;
- private int port;
-
- /**
- * The port attribute name
- */
- public static final String PORT = "port"; //$NON-NLS-1$
-
- /**
- * Constructor
- *
- * @param port
- */
- public PortArgument(int port) {
- setValue(port);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#intValue()
- */
- public int intValue() {
- return port;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#isValid(int)
- */
- public boolean isValid(int intValue) {
- return intValue > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#max()
- */
- public int max() {
- return Integer.MAX_VALUE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#min()
- */
- public int min() {
- return 1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#setValue(int)
- */
- public void setValue(int port) {
- this.port = port;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#description()
- */
- public String description() {
- return Messages.PortArgument_description;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.IntegerArgument#isValid(java.lang.String)
- */
- public boolean isValid(String value) {
- try {
- int intValue = Integer.parseInt(value);
- return isValid(intValue);
- } catch (NumberFormatException e) {
- return false;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#label()
- */
- public String label() {
- return Messages.PortArgument_label;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#mustSpecify()
- */
- public boolean mustSpecify() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#name()
- */
- public String name() {
- return PORT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#setValue(java.lang.String)
- */
- public void setValue(String value) {
- try {
- int intValue = Integer.parseInt(value);
- setValue(intValue);
- } catch (NumberFormatException nfe) {
- // re-throw IllegalArgumentException
- throw new IllegalArgumentException(nfe.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector.Argument#value()
- */
- public String value() {
- return Integer.toString(port);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/RhinoAttachingConnector.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/RhinoAttachingConnector.java
deleted file mode 100644
index cda758b..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/RhinoAttachingConnector.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.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.AttachingConnector;
-import org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.*;
-
-/**
- * Rhino {@link Connector} implementation that attaches to a running debug process
- *
- * @since 1.0
- * @see Connector
- * @see AttachingConnector
- */
-public class RhinoAttachingConnector implements AttachingConnector {
-
- /**
- * Describes the <code>localhost</code> hostname i.e. the <code>127.0.0.1</code> IP address
- */
- public static final String LOCALHOST = "localhost"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.AttachingConnector#attach(java.util.Map)
- */
- public VirtualMachine attach(Map arguments) throws IOException {
- TransportService service = new SocketTransportService();
- String host = (String) arguments.get(HostArgument.HOST);
- String port = (String) arguments.get(PortArgument.PORT);
- Connection c = service.attach(host + ":" + Integer.parseInt(port), 10000, 10000); //$NON-NLS-1$
- DebugSession session = new DebugSession(c);
- return new VirtualMachineImpl(session);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#defaultArguments()
- */
- public Map defaultArguments() {
- Map result = new HashMap();
- result.put(HostArgument.HOST, new HostArgument(LOCALHOST));
- result.put(PortArgument.PORT, new PortArgument(9000));
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#description()
- */
- public String description() {
- return Messages.RhinoAttachingConnector_description;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#name()
- */
- public String name() {
- return Messages.RhinoAttachingConnector_name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.connect.Connector#id()
- */
- public String id() {
- return "rhino.attaching.connector"; //$NON-NLS-1$
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/messages.properties b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/messages.properties
deleted file mode 100644
index 9a85cd8..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/connect/messages.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-HostArgument_description=The name of the host address to try attaching to.
-HostArgument_label=&Host:
-PortArgument_description=The port on the host machine to try attaching to.
-PortArgument_label=&Port:
-RhinoAttachingConnector_description=This connector is used to attach to a running Mozilla Rhino debug process.
-RhinoAttachingConnector_name=Mozilla Rhino - Attaching Connector
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/BreakpointEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/BreakpointEventImpl.java
deleted file mode 100644
index 2b86a87..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/BreakpointEventImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.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.event.BreakpointEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.BreakpointRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link BreakpointEvent}
- *
- * @since 1.0
- */
-public final class BreakpointEventImpl extends LocatableEventImpl implements BreakpointEvent {
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param location
- * @param request
- */
- public BreakpointEventImpl(VirtualMachineImpl vm, ThreadReference thread, Location location, BreakpointRequest request) {
- super(vm, thread, location, request);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/DebuggerStatementEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/DebuggerStatementEventImpl.java
deleted file mode 100644
index 8e197c4..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/DebuggerStatementEventImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.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.event.DebuggerStatementEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.DebuggerStatementRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link DebuggerStatementEvent}
- *
- * @since 1.0
- */
-public final class DebuggerStatementEventImpl extends LocatableEventImpl implements DebuggerStatementEvent {
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param location
- * @param request
- */
- public DebuggerStatementEventImpl(VirtualMachineImpl vm, ThreadReference thread, Location location, DebuggerStatementRequest request) {
- super(vm, thread, location, request);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventImpl.java
deleted file mode 100644
index f559328..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.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;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link Event}
- *
- * @since 1.0
- */
-public class EventImpl implements Event {
-
- private final VirtualMachineImpl vm;
- private final EventRequest request;
-
- /**
- * Constructor
- * @param vm
- * @param request
- */
- public EventImpl(VirtualMachineImpl vm, EventRequest request) {
- this.vm = vm;
- this.request = request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.Event#request()
- */
- public EventRequest request() {
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Mirror#virtualMachine()
- */
- public VirtualMachine virtualMachine() {
- return vm;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventQueueImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventQueueImpl.java
deleted file mode 100644
index d09acc2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventQueueImpl.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.event;
-
-import java.util.Iterator;
-import java.util.List;
-
-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.event.EventQueue;
-import org.eclipse.wst.jsdt.debug.core.jsdi.event.EventSet;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ExceptionRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ScriptLoadRequest;
-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.rhino.RhinoDebugPlugin;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.MirrorImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ScriptReferenceImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ThreadReferenceImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.BreakpointRequestImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.DebuggerStatementRequestImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.EventRequestManagerImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.StepRequestImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.SuspendRequestImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.DisconnectedException;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.EventPacket;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TimeoutException;
-
-/**
- * Default implementation of {@link EventQueue}
- *
- * @since 1.0
- */
-public final class EventQueueImpl extends MirrorImpl implements EventQueue {
-
- private VirtualMachineImpl vm;
- private EventRequestManagerImpl eventRequestManager;
-
- /**
- * Constructor
- *
- * @param vm
- * @param eventRequestManager
- */
- public EventQueueImpl(VirtualMachineImpl vm, EventRequestManagerImpl eventRequestManager) {
- super(vm);
- this.vm = vm;
- this.eventRequestManager = eventRequestManager;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.EventQueue#remove()
- */
- public EventSet remove() {
- return remove(-1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.EventQueue#remove(int)
- */
- public EventSet remove(int timeout) {
- try {
- while (true) {
- EventPacket event = vm.receiveEvent(timeout);
- String eventName = event.getEvent();
- EventSetImpl eventSet = new EventSetImpl(vm);
- if (eventName.equals(JSONConstants.SCRIPT)) {
- Long threadId = new Long(((Number) event.getBody().get(JSONConstants.THREAD_ID)).longValue());
- ThreadReferenceImpl thread = vm.getThread(threadId);
- if(thread == null) {
- continue;
- }
- eventSet.setThread(thread);
- Long scriptId = new Long(((Number) event.getBody().get(JSONConstants.SCRIPT_ID)).longValue());
- ScriptReferenceImpl script = vm.addScript(scriptId);
- if(script != null) {
- List scriptLoadRequests = eventRequestManager.scriptLoadRequests();
- for (Iterator iterator = scriptLoadRequests.iterator(); iterator.hasNext();) {
- ScriptLoadRequest request = (ScriptLoadRequest) iterator.next();
- if (request.isEnabled()) {
- eventSet.add(new ScriptLoadEventImpl(vm, thread, script, request));
- }
- }
- }
- if (!eventSet.isEmpty()) {
- thread.markSuspended(false);
- }
- } else if (eventName.equals(JSONConstants.BREAK)) {
- Long threadId = new Long(((Number) event.getBody().get(JSONConstants.THREAD_ID)).longValue());
- ThreadReferenceImpl thread = vm.getThread(threadId);
- if(thread == null) {
- continue;
- }
- eventSet.setThread(thread);
- Long scriptId = new Long(((Number) event.getBody().get(JSONConstants.SCRIPT_ID)).longValue());
- ScriptReferenceImpl script = vm.getScript(scriptId);
- if(script != null) {
- int lineNumber = ((Number) event.getBody().get(JSONConstants.LINE_NUMBER)).intValue();
- Location location = script.lineLocation(lineNumber);
- boolean atBreakpoint = false;
- Number breakpointId = (Number) event.getBody().get(JSONConstants.BREAKPOINT);
- if (breakpointId != null) {
- List breakpointRequests = eventRequestManager.breakpointRequests();
- for (Iterator iterator = breakpointRequests.iterator(); iterator.hasNext();) {
- BreakpointRequestImpl request = (BreakpointRequestImpl) iterator.next();
- ThreadReference requestThread = request.thread();
- if (request.isEnabled() && (requestThread == null || thread == requestThread) && breakpointId.longValue() == request.breakpointId().longValue()) {
- eventSet.add(new BreakpointEventImpl(vm, thread, location, request));
- atBreakpoint = true;
- }
- }
- }
- String stepType = (String) event.getBody().get(JSONConstants.STEP);
- if (JSONConstants.SUSPENDED.equals(stepType)) {
- List suspendRequests = eventRequestManager.suspendRequests();
- for (Iterator iterator = suspendRequests.iterator(); iterator.hasNext();) {
- SuspendRequestImpl request = (SuspendRequestImpl) iterator.next();
- ThreadReference requestThread = request.thread();
- if (request.isEnabled() && (requestThread == null || thread == requestThread)) {
- eventSet.add(new SuspendEventImpl(vm, thread, location, request));
- }
- }
- } else if (stepType != null) {
- List stepRequests = eventRequestManager.stepRequests();
- for (Iterator iterator = stepRequests.iterator(); iterator.hasNext();) {
- StepRequestImpl request = (StepRequestImpl) iterator.next();
- ThreadReference requestThread = request.thread();
- if (request.isEnabled() && (requestThread == null || thread == requestThread)) {
- eventSet.add(new StepEventImpl(vm, thread, location, request));
- }
- }
- }
- Boolean debuggerStatement = (Boolean) event.getBody().get(JSONConstants.DEBUGGER_STATEMENT);
- if (debuggerStatement.booleanValue()) {
- List debuggerStatementRequests = eventRequestManager.debuggerStatementRequests();
- for (Iterator iterator = debuggerStatementRequests.iterator(); iterator.hasNext();) {
- DebuggerStatementRequestImpl request = (DebuggerStatementRequestImpl) iterator.next();
- ThreadReference requestThread = request.thread();
- if (request.isEnabled() && (requestThread == null || thread == requestThread)) {
- eventSet.add(new DebuggerStatementEventImpl(vm, thread, location, request));
- }
- }
- }
- if (!eventSet.isEmpty()) {
- thread.markSuspended(atBreakpoint);
- }
- }
- } else if (eventName.equals(JSONConstants.EXCEPTION)) {
- Long threadId = new Long(((Number) event.getBody().get(JSONConstants.THREAD_ID)).longValue());
- ThreadReferenceImpl thread = vm.getThread(threadId);
- if(thread != null) {
- eventSet.setThread(thread);
- Long scriptId = new Long(((Number) event.getBody().get(JSONConstants.SCRIPT_ID)).longValue());
- ScriptReferenceImpl script = vm.getScript(scriptId);
- int lineNumber = ((Number) event.getBody().get(JSONConstants.LINE_NUMBER)).intValue();
- Location location = script.lineLocation(lineNumber);
- String message = (String) event.getBody().get(JSONConstants.MESSAGE);
- List exceptionRequests = eventRequestManager.exceptionRequests();
- for (Iterator iterator = exceptionRequests.iterator(); iterator.hasNext();) {
- ExceptionRequest request = (ExceptionRequest) iterator.next();
- if (request.isEnabled()) {
- eventSet.add(new ExceptionEventImpl(vm, thread, location, message, request));
- }
- }
- if (!eventSet.isEmpty()) {
- thread.markSuspended(false);
- }
- }
- } else if (eventName.equals(JSONConstants.THREAD)) {
- Long threadId = new Long(((Number) event.getBody().get(JSONConstants.THREAD_ID)).longValue());
- String type = (String) event.getBody().get(JSONConstants.TYPE);
- if (JSONConstants.ENTER.equals(type)) {
- ThreadReferenceImpl thread = vm.getThread(threadId);
- if(thread != null) {
- eventSet.setThread(thread);
- List threadEnterRequests = eventRequestManager.threadEnterRequests();
- for (Iterator iterator = threadEnterRequests.iterator(); iterator.hasNext();) {
- ThreadEnterRequest request = (ThreadEnterRequest) iterator.next();
- if (request.isEnabled()) {
- eventSet.add(new ThreadEnterEventImpl(vm, thread, request));
- }
- }
- }
- } else if (JSONConstants.EXIT.equals(type)) {
- ThreadReferenceImpl thread = vm.removeThread(threadId);
- List threadExitRequests = eventRequestManager.threadExitRequests();
- for (Iterator iterator = threadExitRequests.iterator(); iterator.hasNext();) {
- ThreadExitRequest request = (ThreadExitRequest) iterator.next();
- if (request.isEnabled()) {
- eventSet.add(new ThreadExitEventImpl(vm, thread, request));
- }
- }
- }
- else if(JSONConstants.VMDEATH.equals(type)) {
- List requests = eventRequestManager.vmDeathRequests();
- for (Iterator iter = requests.iterator(); iter.hasNext();) {
- VMDeathRequest request = (VMDeathRequest) iter.next();
- if(request.isEnabled()) {
- eventSet.add(new VMDeathEventImpl(vm, request));
- }
- }
- }
- }
- if (eventSet.isEmpty()) {
- eventSet.resume();
- continue;
- }
- return eventSet;
- }
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- } catch (DisconnectedException e) {
- vm.disconnectVM();
- handleException(e.getMessage(), e);
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventSetImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventSetImpl.java
deleted file mode 100644
index 5d57522..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventSetImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.event;
-
-import java.util.HashSet;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.core.jsdi.event.EventSet;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ThreadReferenceImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link EventSet}
- *
- * @since 1.0
- */
-public final class EventSetImpl extends HashSet implements EventSet {
-
- private static final long serialVersionUID = 1L;
- private VirtualMachineImpl vm;
- private ThreadReferenceImpl thread;
-
- /**
- * Constructor
- * @param vm
- */
- public EventSetImpl(VirtualMachineImpl vm) {
- this.vm = vm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.EventSet#resume()
- */
- public void resume() {
- if (thread == null) {
- vm.resume();
- }
- else {
- thread.resume();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.EventSet#suspended()
- */
- public boolean suspended() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Mirror#virtualMachine()
- */
- public VirtualMachine virtualMachine() {
- return this.vm;
- }
-
- /**
- * @param thread
- */
- public void setThread(ThreadReferenceImpl thread) {
- this.thread = thread;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ExceptionEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ExceptionEventImpl.java
deleted file mode 100644
index 1abd72e..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ExceptionEventImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.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.event.ExceptionEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ExceptionRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link ExceptionEvent}
- *
- * @since 1.0
- */
-public final class ExceptionEventImpl extends LocatableEventImpl implements ExceptionEvent {
-
- private final String message;
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param location
- * @param message
- * @param request
- */
- public ExceptionEventImpl(VirtualMachineImpl vm, ThreadReference thread, Location location, String message, ExceptionRequest request) {
- super(vm, thread, location, request);
- this.message = message;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.ExceptionEvent#message()
- */
- public String message() {
- return message;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/LocatableEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/LocatableEventImpl.java
deleted file mode 100644
index 7da853c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/LocatableEventImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.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.event.LocatableEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link LocatableEvent}
- *
- * @since 1.0
- */
-public class LocatableEventImpl extends EventImpl implements LocatableEvent {
-
- protected ThreadReference thread = null;
- protected Location location = null;
-
- /**
- * Constructor
- * @param vm
- * @param request
- */
- public LocatableEventImpl(VirtualMachineImpl vm, ThreadReference thread, Location location, EventRequest request) {
- super(vm, request);
- this.thread = thread;
- this.location = location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Locatable#location()
- */
- public Location location() {
- return this.location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.LocatableEvent#thread()
- */
- public ThreadReference thread() {
- return this.thread;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ScriptLoadEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ScriptLoadEventImpl.java
deleted file mode 100644
index 7c36b04..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ScriptLoadEventImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.event;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ScriptReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.event.ScriptLoadEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ScriptLoadRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ScriptReferenceImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link ScriptLoadEvent}
- *
- * @since 1.0
- */
-public final class ScriptLoadEventImpl extends LocatableEventImpl implements ScriptLoadEvent {
-
- private final ScriptReferenceImpl script;
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param script
- * @param request
- */
- public ScriptLoadEventImpl(VirtualMachineImpl vm, ThreadReference thread, ScriptReferenceImpl script, ScriptLoadRequest request) {
- super(vm, thread, null, request);
- this.script = script;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.event.ScriptLoadEvent#script()
- */
- public ScriptReference script() {
- return script;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/StepEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/StepEventImpl.java
deleted file mode 100644
index 7f0999c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/StepEventImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.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.event.StepEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.StepRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link StepEvent}
- *
- * @since 1.0
- */
-public final class StepEventImpl extends LocatableEventImpl implements StepEvent {
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param location
- * @param request
- */
- public StepEventImpl(VirtualMachineImpl vm, ThreadReference thread, Location location, StepRequest request) {
- super(vm, thread, location, request);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/SuspendEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/SuspendEventImpl.java
deleted file mode 100644
index 937f685..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/SuspendEventImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.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.event.BreakpointEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.SuspendRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link BreakpointEvent}
- *
- * @since 1.0
- */
-public final class SuspendEventImpl extends LocatableEventImpl implements BreakpointEvent {
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param location
- * @param request
- */
- public SuspendEventImpl(VirtualMachineImpl vm, ThreadReference thread, Location location, SuspendRequest request) {
- super(vm, thread, location, request);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ThreadEnterEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ThreadEnterEventImpl.java
deleted file mode 100644
index 1f83fe2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ThreadEnterEventImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.event;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.event.ThreadEnterEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadEnterRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link ThreadEnterEvent}
- *
- * @since 1.0
- */
-public final class ThreadEnterEventImpl extends LocatableEventImpl implements ThreadEnterEvent {
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param request
- */
- public ThreadEnterEventImpl(VirtualMachineImpl vm, ThreadReference thread, ThreadEnterRequest request) {
- super(vm, thread, null, request);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ThreadExitEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ThreadExitEventImpl.java
deleted file mode 100644
index 4edbc4c..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/ThreadExitEventImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.event;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.event.ThreadExitEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadExitRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link ThreadExitEvent}
- *
- * @since 1.0
- */
-public final class ThreadExitEventImpl extends LocatableEventImpl implements ThreadExitEvent {
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param request
- */
- public ThreadExitEventImpl(VirtualMachineImpl vm, ThreadReference thread, ThreadExitRequest request) {
- super(vm, thread, null, request);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/VMDeathEventImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/VMDeathEventImpl.java
deleted file mode 100644
index 2363f44..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/VMDeathEventImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.event;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.event.VMDeathEvent;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of a {@link VMDeathEvent}
- *
- * @since 1.0
- */
-public class VMDeathEventImpl extends EventImpl implements VMDeathEvent {
-
- /**
- * Constructor
- * @param vm
- * @param request
- */
- public VMDeathEventImpl(VirtualMachineImpl vm, EventRequest request) {
- super(vm, request);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/messages.properties b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/messages.properties
deleted file mode 100644
index ec56f59..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/messages.properties
+++ /dev/null
@@ -1 +0,0 @@
-ArrayReferenceImpl_array_count_=Array [{0}]
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/BreakpointRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/BreakpointRequestImpl.java
deleted file mode 100644
index 6704d8b..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/BreakpointRequestImpl.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import java.util.Map;
-
-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.request.BreakpointRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.RhinoDebugPlugin;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ScriptReferenceImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.DisconnectedException;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Request;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.Response;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.TimeoutException;
-
-/**
- * Rhino implementation of {@link BreakpointRequest}
- *
- * @since 1.0
- */
-public class BreakpointRequestImpl extends EventRequestImpl implements BreakpointRequest {
-
- private final Location location;
- private ThreadReference thread;
- private String condition;
- private Long breakpointId;
- private int hitcount = 0;
-
- /**
- * Constructor
- *
- * @param vm
- * @param location
- */
- public BreakpointRequestImpl(VirtualMachineImpl vm, Location location) {
- super(vm);
- this.location = location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.BreakpointRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public synchronized void addThreadFilter(ThreadReference thread) {
- checkDeleted();
- this.thread = thread;
- }
-
- /**
- * Returns the underlying {@link ThreadReference} this request applies to
- *
- * @return the underlying {@link ThreadReference}
- */
- public synchronized ThreadReference thread() {
- return this.thread;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.BreakpointRequest#addConditionFilter(java.lang.String)
- */
- public synchronized void addConditionFilter(String condition) {
- checkDeleted();
- this.condition = condition;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.BreakpointRequest#addHitCountFilter(int)
- */
- public void addHitCountFilter(int hitcount) {
- checkDeleted();
- this.hitcount = hitcount;
- }
-
- /**
- * Returns the condition for this breakpoint
- *
- * @return the condition
- */
- public synchronized String condition() {
- return condition;
- }
-
- /**
- * Returns the hit count for the breakpoint
- *
- * @return the hit count for the breakpoint
- */
- public synchronized int hitcount() {
- return this.hitcount;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Locatable#location()
- */
- public Location location() {
- return this.location;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.EventRequestImpl#setEnabled(boolean)
- */
- public synchronized void setEnabled(boolean enabled) {
- checkDeleted();
- if (this.enabled == enabled) {
- return;
- }
- if (enabled) {
- ScriptReferenceImpl scriptReferenceImpl = (ScriptReferenceImpl) this.location.scriptReference();
- Long scriptId = scriptReferenceImpl.getScriptId();
- Request request = new Request(JSONConstants.SETBREAKPOINT);
- request.getArguments().put(JSONConstants.SCRIPT_ID, scriptId);
- request.getArguments().put(JSONConstants.CONDITION, this.condition);
- if (this.location.functionName() != null) {
- request.getArguments().put(JSONConstants.FUNCTION, this.location.functionName());
- }
- else{
- request.getArguments().put(JSONConstants.LINE, new Integer(this.location.lineNumber()));
- }
- try {
- Response response = this.vm.sendRequest(request);
- Map body = (Map) response.getBody().get(JSONConstants.BREAKPOINT);
- Number id = (Number) body.get(JSONConstants.BREAKPOINT_ID);
- this.breakpointId = new Long(id.longValue());
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- }
- } else {
- Request request = new Request(JSONConstants.CLEARBREAKPOINT);
- request.getArguments().put(JSONConstants.BREAKPOINT_ID, breakpointId);
- try {
- vm.sendRequest(request);
- } catch (TimeoutException e) {
- RhinoDebugPlugin.log(e);
- } catch (DisconnectedException e) {
- handleException(e.getMessage(), e);
- }
- breakpointId = null;
- }
- this.enabled = enabled;
- }
-
- /**
- * Returns the id reported back from the underlying {@link VirtualMachine} for this breakpoint
- *
- * @return the id of the breakpoint
- */
- public Long breakpointId() {
- return this.breakpointId;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/DebuggerStatementRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/DebuggerStatementRequestImpl.java
deleted file mode 100644
index 55c13ec..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/DebuggerStatementRequestImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.DebuggerStatementRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link DebuggerStatementRequest}
- *
- * @since 1.0
- */
-public class DebuggerStatementRequestImpl extends EventRequestImpl implements DebuggerStatementRequest {
-
- private ThreadReference thread;
-
- /**
- * Constructor
- * @param vm
- */
- public DebuggerStatementRequestImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.DebuggerStatementRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public synchronized void addThreadFilter(ThreadReference thread) {
- checkDeleted();
- this.thread = thread;
- }
-
- /**
- * The underlying {@link ThreadReference}
- * @return the underlying {@link ThreadReference}
- */
- public synchronized ThreadReference thread() {
- return thread;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.EventRequestImpl#setEnabled(boolean)
- */
- public synchronized void setEnabled(boolean enabled) {
- checkDeleted();
- this.enabled = enabled;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/EventRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/EventRequestImpl.java
deleted file mode 100644
index c230638..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/EventRequestImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.MirrorImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link EventRequest}
- *
- * @since 1.0
- */
-public class EventRequestImpl extends MirrorImpl implements EventRequest {
-
- private boolean deleted = false;
- protected boolean enabled = false;
-
- /**
- * Constructor
- * @param vm
- */
- public EventRequestImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest#isEnabled()
- */
- public synchronized boolean isEnabled() {
- return enabled;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest#setEnabled(boolean)
- */
- public synchronized void setEnabled(boolean enabled) {
- checkDeleted();
- this.enabled = enabled;
- }
-
- /**
- * If the delete flag is set throw an {@link IllegalStateException}
- * @throws IllegalStateException
- */
- protected void checkDeleted() throws IllegalStateException {
- if (deleted) {
- throw new IllegalStateException("deleted"); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.Mirror#virtualMachine()
- */
- public VirtualMachine virtualMachine() {
- return vm;
- }
-
- /**
- * delete the request by setting it disabled and setting the delet flag
- */
- public synchronized void delete() {
- setEnabled(false);
- deleted = true;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/EventRequestManagerImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/EventRequestManagerImpl.java
deleted file mode 100644
index 050e6b5..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/EventRequestManagerImpl.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-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.request.BreakpointRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.DebuggerStatementRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ExceptionRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ScriptLoadRequest;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.StepRequest;
-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.core.jsdi.request.VMDisconnectRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link EventRequestManager}
- *
- * @since 1.0
- */
-public final class EventRequestManagerImpl implements EventRequestManager {
-
- private final Map eventsMap = new HashMap();
- private final List breakpointRequests = new ArrayList();
- private final List exceptionRequests = new ArrayList();
- private final List debuggerStatementRequests = new ArrayList();
- private final List scriptLoadRequests = new ArrayList();
- private final List stepRequests = new ArrayList();
- private final List suspendRequests = new ArrayList();
- private final List threadEnterRequests = new ArrayList();
- private final List threadExitRequests = new ArrayList();
- private final List vmDeathRequests = new ArrayList();
- private final List vmDisconnectRequests = new ArrayList();
- private final VirtualMachineImpl vm;
-
- /**
- * Constructor
- *
- * @param vm
- */
- public EventRequestManagerImpl(VirtualMachineImpl vm) {
- this.vm = vm;
- eventsMap.put(BreakpointRequestImpl.class, breakpointRequests);
- eventsMap.put(DebuggerStatementRequestImpl.class, debuggerStatementRequests);
- eventsMap.put(ExceptionRequestImpl.class, exceptionRequests);
- eventsMap.put(ScriptLoadRequestImpl.class, scriptLoadRequests);
- eventsMap.put(StepRequestImpl.class, stepRequests);
- eventsMap.put(SuspendRequestImpl.class, suspendRequests);
- eventsMap.put(ThreadEnterRequestImpl.class, threadEnterRequests);
- eventsMap.put(ThreadExitRequestImpl.class, threadExitRequests);
- eventsMap.put(VMDeathRequestImpl.class, vmDeathRequests);
- eventsMap.put(VMDisconnectRequestImpl.class, vmDisconnectRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createBreakpointRequest(org.eclipse.wst.jsdt.debug.core.jsdi.Location)
- */
- public synchronized BreakpointRequest createBreakpointRequest(Location location) {
- BreakpointRequestImpl request = new BreakpointRequestImpl(vm, location);
- breakpointRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#debuggerStatementRequests()
- */
- public synchronized List debuggerStatementRequests() {
- return Collections.unmodifiableList(debuggerStatementRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createDebuggerStatementRequest()
- */
- public synchronized DebuggerStatementRequest createDebuggerStatementRequest() {
- DebuggerStatementRequestImpl request = new DebuggerStatementRequestImpl(vm);
- debuggerStatementRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#breakpointRequests()
- */
- public synchronized List breakpointRequests() {
- return Collections.unmodifiableList(breakpointRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createExceptionRequest()
- */
- public synchronized ExceptionRequest createExceptionRequest() {
- ExceptionRequest request = new ExceptionRequestImpl(vm);
- exceptionRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#exceptionRequests()
- */
- public synchronized List exceptionRequests() {
- return Collections.unmodifiableList(exceptionRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createScriptLoadRequest()
- */
- public synchronized ScriptLoadRequest createScriptLoadRequest() {
- ScriptLoadRequest request = new ScriptLoadRequestImpl(vm);
- scriptLoadRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#scriptLoadRequests()
- */
- public synchronized List scriptLoadRequests() {
- return Collections.unmodifiableList(scriptLoadRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createStepRequest(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference, int)
- */
- public synchronized StepRequest createStepRequest(ThreadReference thread, int step) {
- StepRequest request = new StepRequestImpl(vm, thread, step);
- stepRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#stepRequests()
- */
- public synchronized List stepRequests() {
- return Collections.unmodifiableList(stepRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createSuspendRequest(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public synchronized SuspendRequest createSuspendRequest(ThreadReference thread) {
- SuspendRequest request = new SuspendRequestImpl(vm, thread);
- suspendRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#suspendRequests()
- */
- public synchronized List suspendRequests() {
- return Collections.unmodifiableList(suspendRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createThreadEnterRequest()
- */
- public synchronized ThreadEnterRequest createThreadEnterRequest() {
- ThreadEnterRequest request = new ThreadEnterRequestImpl(vm);
- threadEnterRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#threadEnterRequests()
- */
- public List threadEnterRequests() {
- return Collections.unmodifiableList(threadEnterRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createThreadExitRequest()
- */
- public synchronized ThreadExitRequest createThreadExitRequest() {
- ThreadExitRequest request = new ThreadExitRequestImpl(vm);
- threadExitRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#threadExitRequests()
- */
- public List threadExitRequests() {
- return Collections.unmodifiableList(threadExitRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#deleteEventRequest(org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequest)
- */
- public synchronized void deleteEventRequest(EventRequest eventRequest) {
- Class clazz = eventRequest.getClass();
- List eventList = (List) eventsMap.get(clazz);
- if (eventList == null) {
- throw new IllegalArgumentException(
- "bad event request class - " + clazz.getName()); //$NON-NLS-1$
- }
- eventList.remove(eventRequest);
- EventRequestImpl eventRequestImpl = (EventRequestImpl) eventRequest;
- eventRequestImpl.delete();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#deleteEventRequest(java.util.List)
- */
- public synchronized void deleteEventRequest(List eventRequests) {
- for (Iterator iterator = eventRequests.iterator(); iterator.hasNext();) {
- EventRequest eventRequest = (EventRequest) iterator.next();
- deleteEventRequest(eventRequest);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createVMDeathRequest()
- */
- public VMDeathRequest createVMDeathRequest() {
- VMDeathRequest request = new VMDeathRequestImpl(this.vm);
- this.vmDeathRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#vmDeathRequests()
- */
- public List vmDeathRequests() {
- return Collections.unmodifiableList(vmDeathRequests);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#createVMDisconnectRequest()
- */
- public VMDisconnectRequest createVMDisconnectRequest() {
- VMDisconnectRequest request = new VMDisconnectRequestImpl(this.vm);
- this.vmDisconnectRequests.add(request);
- return request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.EventRequestManager#vmDisconnectRequests()
- */
- public List vmDisconnectRequests() {
- return Collections.unmodifiableList(vmDisconnectRequests);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ExceptionRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ExceptionRequestImpl.java
deleted file mode 100644
index 11ab789..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ExceptionRequestImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ExceptionRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link ExceptionRequest}
- *
- * @since 1.0
- */
-public class ExceptionRequestImpl extends EventRequestImpl implements ExceptionRequest {
-
- private ThreadReference thread;
-
- /**
- * Constructor
- * @param vm
- */
- public ExceptionRequestImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.ExceptionRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public synchronized void addThreadFilter(ThreadReference thread) {
- checkDeleted();
- this.thread = thread;
- }
-
- /**
- * The underlying {@link ThreadReference}
- * @return the underlying {@link ThreadReference}
- */
- public synchronized ThreadReference thread() {
- return thread;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ScriptLoadRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ScriptLoadRequestImpl.java
deleted file mode 100644
index 3b8857d..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ScriptLoadRequestImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ScriptLoadRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link ScriptLoadRequest}
- *
- * @since 1.0
- */
-public class ScriptLoadRequestImpl extends EventRequestImpl implements ScriptLoadRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public ScriptLoadRequestImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/StepRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/StepRequestImpl.java
deleted file mode 100644
index f72490a..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/StepRequestImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.StepRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.ThreadReferenceImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-import org.eclipse.wst.jsdt.debug.internal.rhino.transport.JSONConstants;
-
-/**
- * Rhino implementation of {@link StepRequest}
- *
- * @since 1.0
- */
-public class StepRequestImpl extends EventRequestImpl implements StepRequest {
-
- private final ThreadReferenceImpl thread;
- private final int step;
-
- /**
- * Constructor
- * @param vm
- * @param thread
- * @param step
- */
- public StepRequestImpl(VirtualMachineImpl vm, ThreadReference thread, int step) {
- super(vm);
- this.thread = (ThreadReferenceImpl) thread;
- this.step = step;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.StepRequest#step()
- */
- public int step() {
- return step;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.StepRequest#thread()
- */
- public ThreadReference thread() {
- return thread;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request.EventRequestImpl#setEnabled(boolean)
- */
- public synchronized void setEnabled(boolean enabled) {
- checkDeleted();
- if (this.enabled == enabled) {
- return;
- }
- if (enabled) {
- String stepType = null;
- if (step == STEP_INTO) {
- stepType = JSONConstants.STEP_IN;
- }
- else if (step == STEP_OVER) {
- stepType = JSONConstants.STEP_NEXT;
- }
- else if (step == STEP_OUT) {
- stepType = JSONConstants.STEP_OUT;
- }
- if (thread.getStep() != null) {
- throw new IllegalStateException("duplicate step"); //$NON-NLS-1$
- }
- thread.setStep(stepType);
- } else {
- thread.setStep(null);
- }
- this.enabled = enabled;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/SuspendRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/SuspendRequestImpl.java
deleted file mode 100644
index 3a499d2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/SuspendRequestImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.SuspendRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link SuspendRequest}
- *
- * @since 1.0
- */
-public class SuspendRequestImpl extends EventRequestImpl implements SuspendRequest {
-
- private final ThreadReference thread;
-
- /**
- * Constructor
- * @param vm
- * @param thread
- */
- public SuspendRequestImpl(VirtualMachineImpl vm, ThreadReference thread) {
- super(vm);
- this.thread = thread;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.SuspendRequest#thread()
- */
- public ThreadReference thread() {
- return thread;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ThreadEnterRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ThreadEnterRequestImpl.java
deleted file mode 100644
index 4240d4d..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ThreadEnterRequestImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadEnterRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link ThreadEnterRequest}
- *
- * @since 1.0
- */
-public class ThreadEnterRequestImpl extends EventRequestImpl implements ThreadEnterRequest {
-
- private ThreadReference thread;
-
- /**
- * Constructor
- * @param vm
- */
- public ThreadEnterRequestImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadEnterRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public synchronized void addThreadFilter(ThreadReference thread) {
- checkDeleted();
- this.thread = thread;
- }
-
- /**
- * Return the underlying {@link ThreadReference}
- * @return the underlying {@link ThreadReference}
- */
- public synchronized ThreadReference thread() {
- return thread;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ThreadExitRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ThreadExitRequestImpl.java
deleted file mode 100644
index 16f45ef..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/ThreadExitRequestImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference;
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadExitRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link ThreadExitRequest}
- *
- * @since 1.0
- */
-public class ThreadExitRequestImpl extends EventRequestImpl implements ThreadExitRequest {
-
- private ThreadReference thread;
-
- /**
- * Constructor
- * @param vm
- */
- public ThreadExitRequestImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.debug.core.jsdi.request.ThreadExitRequest#addThreadFilter(org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference)
- */
- public synchronized void addThreadFilter(ThreadReference thread) {
- checkDeleted();
- this.thread = thread;
- }
-
- /**
- * Returns the underlying {@link ThreadReference}
- * @return the underlying {@link ThreadReference}
- */
- public synchronized ThreadReference thread() {
- return thread;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/VMDeathRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/VMDeathRequestImpl.java
deleted file mode 100644
index 153cde2..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/VMDeathRequestImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.VMDeathRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation for a {@link VMDeathRequest}
- *
- * @since 1.0
- */
-public class VMDeathRequestImpl extends EventRequestImpl implements VMDeathRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public VMDeathRequestImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/VMDisconnectRequestImpl.java b/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/VMDisconnectRequestImpl.java
deleted file mode 100644
index 7beb14f..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/request/VMDisconnectRequestImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.request;
-
-import org.eclipse.wst.jsdt.debug.core.jsdi.request.VMDisconnectRequest;
-import org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.VirtualMachineImpl;
-
-/**
- * Rhino implementation of {@link VMDisconnectRequest}
- *
- * @since 1.0
- */
-public class VMDisconnectRequestImpl extends EventRequestImpl implements VMDisconnectRequest {
-
- /**
- * Constructor
- * @param vm
- */
- public VMDisconnectRequestImpl(VirtualMachineImpl vm) {
- super(vm);
- }
-}
\ No newline at end of file