summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-04-07 00:06:55 (EDT)
committerCaspar De Groot2011-04-07 00:06:55 (EDT)
commitd41475ec4a284047a3d3f160a8084b5c0934f8bc (patch)
tree3363420a4bbda4bf80e29322dec00c8ae9cdf69e
parent1d968cce2f0b3d23e61449b244b7e1af36abf8f6 (diff)
downloadcdo-d41475ec4a284047a3d3f160a8084b5c0934f8bc.zip
cdo-d41475ec4a284047a3d3f160a8084b5c0934f8bc.tar.gz
cdo-d41475ec4a284047a3d3f160a8084b5c0934f8bc.tar.bz2
[Bug 340108] SSL transport implementation for Net4J
https://bugs.eclipse.org/bugs/show_bug.cgi?id=340108
-rw-r--r--features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples/StandaloneContainerExampleSSL.launch12
-rw-r--r--plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java91
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.server/CDOServer_SSL.launch368
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, SSL).launch22
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, TCP).launch2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/build.properties3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMBranchesSSL.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java67
-rw-r--r--plugins/org.eclipse.net4j.examples/UploadSSLClient (Net4j Examples).launch32
-rw-r--r--plugins/org.eclipse.net4j.examples/UploadSSLServer (Net4j Examples).launch12
-rw-r--r--plugins/org.eclipse.net4j.examples/build.properties3
-rw-r--r--plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoSSLClient.java67
-rw-r--r--plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoSSLServer.java63
-rw-r--r--plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadSSLClientAction.java178
-rw-r--r--plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadSSLServer.java170
-rw-r--r--plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.net4j.tcp/SSLSelector.java31
-rw-r--r--plugins/org.eclipse.net4j.tcp/SSLSelectorFactory.java44
-rw-r--r--plugins/org.eclipse.net4j.tcp/SSLSelectorInjector.java61
-rw-r--r--plugins/org.eclipse.net4j.tcp/plugin.xml8
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/Net4j SSL AllTests.launch20
-rw-r--r--plugins/org.eclipse.net4j.tests/build.properties3
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java59
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java37
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java17
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java31
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java37
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java37
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java37
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java173
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java102
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java115
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java9
38 files changed, 1907 insertions, 77 deletions
diff --git a/features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml b/features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml
index 86c37d9..f830184 100644
--- a/features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml
+++ b/features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml
@@ -3,10 +3,10 @@
<!-- See http://wiki.eclipse.org/CDO/Server_Configuration_Reference -->
- <acceptor type="tcp" listenAddr="0.0.0.0" port="2036">
- </acceptor>
+ <acceptor type="tcp" listenAddr="0.0.0.0" port="2036"/>
<!--
+ <acceptor type="ssl" listenAddr="0.0.0.0" port="2036"/>
<acceptor type="http"/>
-->
diff --git a/plugins/org.eclipse.emf.cdo.examples/StandaloneContainerExampleSSL.launch b/plugins/org.eclipse.emf.cdo.examples/StandaloneContainerExampleSSL.launch
new file mode 100644
index 0000000..36bf332
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples/StandaloneContainerExampleSSL.launch
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.examples.StandaloneContainerExampleSSL"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.examples"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Ddebug=true -Dorg.eclipse.net4j.tcp.ssl.passphrase=ab987c -Dorg.eclipse.net4j.tcp.ssl.trust=sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=sslKey/testKeys"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java
new file mode 100644
index 0000000..f85e3ee
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java
@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.examples;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.examples.company.CompanyFactory;
+import org.eclipse.emf.cdo.examples.company.CompanyPackage;
+import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
+import org.eclipse.emf.cdo.net4j.CDOSessionConfiguration;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.util.CommitException;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.tcp.ssl.SSLUtil;
+import org.eclipse.net4j.util.container.ContainerUtil;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.PrintLogHandler;
+import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * @author Eike Stepper
+ * @since 4.0
+ */
+public class StandaloneContainerExampleSSL
+{
+ public static void main(String[] args) throws CommitException
+ {
+ // Enable logging and tracing
+ OMPlatform.INSTANCE.setDebugging(true);
+ OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
+ OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
+
+ // Prepare container
+ IManagedContainer container = ContainerUtil.createContainer();
+ Net4jUtil.prepareContainer(container); // Register Net4j factories
+ SSLUtil.prepareContainer(container);
+ CDONet4jUtil.prepareContainer(container); // Register CDO factories
+ container.activate();
+
+ // Create connector
+ IConnector connector = SSLUtil.getConnector(container, "localhost:2036");
+
+ // Create configuration
+ CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration();
+ configuration.setConnector(connector);
+ configuration.setRepositoryName("repo1"); //$NON-NLS-1$
+
+ // Open session
+ CDOSession session = configuration.openSession();
+ session.options().setGeneratedPackageEmulationEnabled(true);
+
+ session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE);
+
+ // Open transaction
+ CDOTransaction transaction = session.openTransaction();
+
+ // Read whatetever is there
+ TreeIterator<EObject> iter = transaction.getRootResource().getAllContents();
+ while (iter.hasNext())
+ {
+ System.out.println("---> It's a " + iter.next().eClass().getName());
+ }
+
+ // Get or create resource
+ CDOResource resource = transaction.getOrCreateResource("/path/to/my/resource"); //$NON-NLS-1$
+
+ // Work with the resource and commit the transaction
+ EObject object = CompanyFactory.eINSTANCE.createCompany();
+ resource.getContents().add(object);
+ transaction.commit();
+
+ // Cleanup
+ session.close();
+ connector.close();
+ container.deactivate();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
index 09329c1..281f353 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
@@ -46,6 +46,11 @@ public final class CDONet4jUtil
/**
* @since 4.0
*/
+ public static final String PROTOCOL_SSL = "cdo.net4j.ssl";
+
+ /**
+ * @since 4.0
+ */
public static final String PROTOCOL_JVM = "cdo.net4j.jvm";
static
@@ -60,6 +65,11 @@ public final class CDONet4jUtil
map.put(PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
}
+ if (!map.containsKey(PROTOCOL_SSL))
+ {
+ map.put(PROTOCOL_SSL, CDOResourceFactory.INSTANCE);
+ }
+
if (!map.containsKey(PROTOCOL_JVM))
{
map.put(PROTOCOL_JVM, CDOResourceFactory.INSTANCE);
@@ -67,6 +77,7 @@ public final class CDONet4jUtil
int priority = CDOViewProvider.DEFAULT_PRIORITY - 100;
CDOViewProviderRegistry.INSTANCE.addViewProvider(new CDONet4jViewProvider.TCP(priority));
+ CDOViewProviderRegistry.INSTANCE.addViewProvider(new CDONet4jViewProvider.SSL(priority));
CDOViewProviderRegistry.INSTANCE.addViewProvider(new CDONet4jViewProvider.JVM(priority));
}
}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
index bd3ad53..7bf0fdd 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
@@ -220,6 +220,23 @@ public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
}
/**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static class SSL extends CDONet4jViewProvider
+ {
+ public SSL(int priority)
+ {
+ super("ssl", priority);
+ }
+
+ public SSL()
+ {
+ this(DEFAULT_PRIORITY);
+ }
+
+ }
+
+ /**
* @author Eike Stepper
*/
public static class JVM extends CDONet4jViewProvider
diff --git a/plugins/org.eclipse.emf.cdo.server/CDOServer_SSL.launch b/plugins/org.eclipse.emf.cdo.server/CDOServer_SSL.launch
new file mode 100644
index 0000000..22e5b01
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/CDOServer_SSL.launch
@@ -0,0 +1,368 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application" value="org.eclipse.emf.cdo.server.app"/>
+<booleanAttribute key="askclear" value="true"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.server.db,org.eclipse.net4j,org.eclipse.net4j.db,org.eclipse.net4j.db.derby,org.eclipse.net4j.http.common,org.eclipse.net4j.http.server,org.eclipse.net4j.tcp,org.eclipse.net4j.util"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="false"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/CDOServer_SSL"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../cdo.server"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+<mapEntry key="[run]" value="org.eclipse.pde.ui.RuntimeWorkbench"/>
+</mapAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}&#13;&#10;-debug&#13;&#10;-console"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1024m&#13;&#10;-Ddebug=true&#13;&#10;-Dnet4j.config=&quot;${resource_loc:/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration-ssl}&quot;&#13;&#10;-Dorg.eclipse.net4j.tcp.ssl.trust=/home/caspar/tmp/testTrust&#10;-Dorg.eclipse.net4j.tcp.ssl.key=/home/caspar/tmp/testKeys&#10;-Dorg.eclipse.emf.cdo.server.browser.port=7777&#13;&#10;-Dorg.osgi.service.http.port=8080"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<stringAttribute key="selectedPlugin" value="org.eclipse.emf.cdo"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.osgi*3.7.0.v20101207@-1:true,org.eclipse.ant.core@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.common@default:default,org.eclipse.osgi*3.7.0.v20101022@-1:true,org.eclipse.core.runtime@default:true,org.eclipse.core.jobs@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.expressions@default:default,org.postgresql.jdbc3@default:default,com.mysql.jdbc@default:default,javax.servlet@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.filesystem@default:default,org.h2@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.apache.derby@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.variables@default:default,org.eclipse.emf.ecore.xmi@default:default,org.hsqldb@default:default,org.eclipse.equinox.common@2:true,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.contenttype@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.server.net4j@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.emf.cdo.common@default:default,org.eclipse.net4j.db.h2@default:default,org.eclipse.emf.cdo.server@default:default,org.eclipse.net4j.db.hsqldb@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j.db@default:default,org.eclipse.net4j@default:default,org.eclipse.net4j.db.mysql@default:default,org.eclipse.emf.cdo.server.db@default:default,org.eclipse.net4j.db.derby@default:default,org.eclipse.net4j.db.postgresql@default:default"/>
+<booleanAttribute key="show_selected_only" value="true"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<booleanAttribute key="tracing" value="true"/>
+<mapAttribute key="tracingOptions">
+<mapEntry key="org.eclipse.core.contenttype/debug" value="false"/>
+<mapEntry key="org.eclipse.core.expressions/tracePropertyResolving" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/beginend" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/errorondeadlock" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/locks" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/shutdown" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/timing" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/delta" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/failure" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/interrupt" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/invoking" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/needbuildstack" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/stacktrace" value="false"/>
+<mapEntry key="org.eclipse.core.resources/contenttype" value="false"/>
+<mapEntry key="org.eclipse.core.resources/contenttype/cache" value="false"/>
+<mapEntry key="org.eclipse.core.resources/debug" value="false"/>
+<mapEntry key="org.eclipse.core.resources/history" value="false"/>
+<mapEntry key="org.eclipse.core.resources/natures" value="false"/>
+<mapEntry key="org.eclipse.core.resources/perf/builders" value="10000"/>
+<mapEntry key="org.eclipse.core.resources/perf/listeners" value="500"/>
+<mapEntry key="org.eclipse.core.resources/perf/save.participants" value="500"/>
+<mapEntry key="org.eclipse.core.resources/perf/snapshot" value="1000"/>
+<mapEntry key="org.eclipse.core.resources/preferences" value="false"/>
+<mapEntry key="org.eclipse.core.resources/refresh" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/markers" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/syncinfo" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/tree" value="false"/>
+<mapEntry key="org.eclipse.core.resources/strings" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/compatibility/debug" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/debug" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/debug/context" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/perf" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/perf/success" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/preferences/plugin" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/>
+<mapEntry key="org.eclipse.debug.core/debug" value="false"/>
+<mapEntry key="org.eclipse.debug.core/debug/commands" value="false"/>
+<mapEntry key="org.eclipse.debug.core/debug/events" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/contextlaunching" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/launchhistory" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/contentProvider" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/deltas" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/model" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/updateSequence" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/viewer" value="false"/>
+<mapEntry key="org.eclipse.emf.cdo.common/debug" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.common/debug.model" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.common/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.common/debug.revision" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.common/perf" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.common/perf.revision" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.common/perf.revision.reading" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.common/perf.revision.writing" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.examples/debug" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server.db/debug" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server/debug" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server/debug.repository" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server/debug.resource" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server/debug.revision" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server/debug.session" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server/debug.store" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.server/debug.types" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.adapter" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.model" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.object" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.repository" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.resource" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.revision" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.session" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.transaction" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.util" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.view" value="true"/>
+<mapEntry key="org.eclipse.emf.cdo/perf" value="false"/>
+<mapEntry key="org.eclipse.emf.cdo/perf.revision" value="false"/>
+<mapEntry key="org.eclipse.emf.cdo/perf.revision.loading" value="false"/>
+<mapEntry key="org.eclipse.equinox.preferences/general" value="false"/>
+<mapEntry key="org.eclipse.equinox.preferences/get" value="false"/>
+<mapEntry key="org.eclipse.equinox.preferences/set" value="false"/>
+<mapEntry key="org.eclipse.equinox.registry/debug" value="false"/>
+<mapEntry key="org.eclipse.equinox.registry/debug/events" value="false"/>
+<mapEntry key="org.eclipse.help.base/debug" value="true"/>
+<mapEntry key="org.eclipse.help.base/debug/search" value="false"/>
+<mapEntry key="org.eclipse.help.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser" value="false"/>
+<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser/inprocess" value="false"/>
+<mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/>
+<mapEntry key="org.eclipse.help.webapp/debug" value="true"/>
+<mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/>
+<mapEntry key="org.eclipse.help/debug" value="true"/>
+<mapEntry key="org.eclipse.help/debug/context" value="false"/>
+<mapEntry key="org.eclipse.help/debug/search" value="false"/>
+<mapEntry key="org.eclipse.jdt.core.manipulation/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.core/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/builder" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/completion" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/cpresolution/advanced" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/indexmanager" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javadelta/verbose" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javamodel" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javamodel/cache" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/resolution" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/sourcemapper" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/perf/completion" value="300"/>
+<mapEntry key="org.eclipse.jdt.core/perf/containerinitializer" value="5000"/>
+<mapEntry key="org.eclipse.jdt.core/perf/javadeltalistener" value="500"/>
+<mapEntry key="org.eclipse.jdt.core/perf/reconcile" value="1000"/>
+<mapEntry key="org.eclipse.jdt.core/perf/selection" value="300"/>
+<mapEntry key="org.eclipse.jdt.core/perf/variableinitializer" value="5000"/>
+<mapEntry key="org.eclipse.jdt.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.ui/debug/ASTProvider" value="false"/>
+<mapEntry key="org.eclipse.jdt.ui/debug/ResultCollector" value="false"/>
+<mapEntry key="org.eclipse.jdt.ui/debug/TypeConstraints" value="false"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/content_assist/extensions" value="1000"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/content_assist_sorters/extensions" value=""/>
+<mapEntry key="org.eclipse.jdt.ui/perf/explorer/RefactorActionGroup" value="150"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/explorer/createPartControl" value="1300"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/explorer/makeActions" value="1000"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/search/participants" value="300"/>
+<mapEntry key="org.eclipse.jface.text.source/debug/RevisionRulerColumn" value="false"/>
+<mapEntry key="org.eclipse.jface.text/debug/AnnotationPainter" value="false"/>
+<mapEntry key="org.eclipse.jface.text/debug/ContentAssistSubjectAdapters" value="false"/>
+<mapEntry key="org.eclipse.jface.text/debug/FastPartitioner/PositionCache" value="false"/>
+<mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/checkConditions" value="300"/>
+<mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/createChanges" value="300"/>
+<mapEntry key="org.eclipse.net4j.buddies.chat.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.buddies.chat/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.buddies.common/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.buddies.server/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.buddies.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.buddies/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.db.derby/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.db.derby/debug.sql" value="true"/>
+<mapEntry key="org.eclipse.net4j.db.hsqldb/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.db.hsqldb/debug.sql" value="true"/>
+<mapEntry key="org.eclipse.net4j.db.mysql/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.db.mysql/debug.sql" value="true"/>
+<mapEntry key="org.eclipse.net4j.db/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.db/debug.sql" value="true"/>
+<mapEntry key="org.eclipse.net4j.debug/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.examples/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.fileshare.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.fileshare/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.jms.admin/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.jms.admin/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.net4j.jms.server.jdbc/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.jms.server/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.jms.server/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.net4j.jms.server/debug.store" value="true"/>
+<mapEntry key="org.eclipse.net4j.jms/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.jms/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.net4j.jvm/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.tcp/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.util.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.util/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j.util/debug.concurrency" value="true"/>
+<mapEntry key="org.eclipse.net4j.util/debug.lifecycle" value="true"/>
+<mapEntry key="org.eclipse.net4j.util/debug.lifecycle.dump" value="true"/>
+<mapEntry key="org.eclipse.net4j.util/debug.om" value="true"/>
+<mapEntry key="org.eclipse.net4j.util/debug.registry" value="true"/>
+<mapEntry key="org.eclipse.net4j/debug" value="true"/>
+<mapEntry key="org.eclipse.net4j/debug.acceptor" value="true"/>
+<mapEntry key="org.eclipse.net4j/debug.buffer" value="true"/>
+<mapEntry key="org.eclipse.net4j/debug.buffer.stream" value="false"/>
+<mapEntry key="org.eclipse.net4j/debug.channel" value="true"/>
+<mapEntry key="org.eclipse.net4j/debug.connector" value="true"/>
+<mapEntry key="org.eclipse.net4j/debug.selector" value="true"/>
+<mapEntry key="org.eclipse.net4j/debug.signal" value="true"/>
+<mapEntry key="org.eclipse.net4j/perf" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/bundleTime" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/events" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/filter" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/loader" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/manifest" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/messageBundles" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/packageadmin" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/security" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/services" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/startlevel" value="false"/>
+<mapEntry key="org.eclipse.osgi/defaultprofile/buffersize" value="256"/>
+<mapEntry key="org.eclipse.osgi/defaultprofile/logfilename" value=""/>
+<mapEntry key="org.eclipse.osgi/defaultprofile/logsynchronously" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/converter/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/location" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin/resolver" value="false"/>
+<mapEntry key="org.eclipse.osgi/monitor/activation" value="false"/>
+<mapEntry key="org.eclipse.osgi/monitor/classes" value="false"/>
+<mapEntry key="org.eclipse.osgi/monitor/resources" value="false"/>
+<mapEntry key="org.eclipse.osgi/profile/benchmark" value="false"/>
+<mapEntry key="org.eclipse.osgi/profile/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/profile/impl" value="org.eclipse.osgi.internal.profile.DefaultProfileLogger"/>
+<mapEntry key="org.eclipse.osgi/profile/startup" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/cycles" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/generics" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/grouping" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/imports" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/requires" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/wiring" value="false"/>
+<mapEntry key="org.eclipse.osgi/trace/activation" value="false"/>
+<mapEntry key="org.eclipse.osgi/trace/classLoading" value="false"/>
+<mapEntry key="org.eclipse.osgi/trace/filename" value="runtime.traces"/>
+<mapEntry key="org.eclipse.osgi/trace/filters" value="trace.properties"/>
+<mapEntry key="org.eclipse.pde.build/debug" value="false"/>
+<mapEntry key="org.eclipse.pde.core/cache" value="false"/>
+<mapEntry key="org.eclipse.pde.core/classpath" value="false"/>
+<mapEntry key="org.eclipse.pde.core/debug" value="true"/>
+<mapEntry key="org.eclipse.pde.core/validation" value="false"/>
+<mapEntry key="org.eclipse.team.core/backgroundevents" value="false"/>
+<mapEntry key="org.eclipse.team.core/debug" value="false"/>
+<mapEntry key="org.eclipse.team.core/refreshjob" value="false"/>
+<mapEntry key="org.eclipse.team.core/streams" value="false"/>
+<mapEntry key="org.eclipse.team.core/threading" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/>
+<mapEntry key="org.eclipse.team.cvs.core/debug" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/>
+<mapEntry key="org.eclipse.ui.browser/debug" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug/gc" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug/internalerror/openDialog" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug/undomonitor" value="false"/>
+<mapEntry key="org.eclipse.ui.intro.universal/debug" value="true"/>
+<mapEntry key="org.eclipse.ui.intro.universal/trace/logInfo" value="true"/>
+<mapEntry key="org.eclipse.ui.intro.universal/trace/logPerformance" value="false"/>
+<mapEntry key="org.eclipse.ui.intro/debug" value="true"/>
+<mapEntry key="org.eclipse.ui.intro/flags/noBrowser" value="false"/>
+<mapEntry key="org.eclipse.ui.intro/trace/logInfo" value="true"/>
+<mapEntry key="org.eclipse.ui.intro/trace/logPerformance" value="false"/>
+<mapEntry key="org.eclipse.ui.intro/trace/printHTML" value="false"/>
+<mapEntry key="org.eclipse.ui.workbench/debug" value="false"/>
+<mapEntry key="org.eclipse.ui/debug" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/contributions" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/declaredImages" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/job.stale" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/showAllJobs" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/swtdebug" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/workingSets" value="false"/>
+<mapEntry key="org.eclipse.ui/experimental/menus" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener2" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPropertyChangeListener" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPartReference" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPageListener" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener2" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPerspectiveListener" value="false"/>
+<mapEntry key="org.eclipse.ui/perf/contentTypes" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/page.listeners" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/part.activate" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/part.control" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/part.create" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/part.init" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/part.input" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/part.listeners" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/perspective.create" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/perspective.listeners" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/perspective.switch" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/showHeapStatus" value="true"/>
+<mapEntry key="org.eclipse.ui/perf/uijob" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/workbench.restore" value="30000"/>
+<mapEntry key="org.eclipse.ui/perf/workbench.start" value="45000"/>
+<mapEntry key="org.eclipse.ui/trace/commands" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/contexts" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/contexts.performance" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/contexts.verbose" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers.performance" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers.verbose" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers.verbose.commandId" value=""/>
+<mapEntry key="org.eclipse.ui/trace/keyBindings" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/keyBindings.verbose" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/multipageeditor" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/operations" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/operations.verbose" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/sources" value="false"/>
+<mapEntry key="org.eclipse.update.configurator/debug" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug" value="true"/>
+<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/install" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/type" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/web" value="false"/>
+</mapAttribute>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useNamedJRE" value="true"/>
+<booleanAttribute key="useProduct" value="false"/>
+<booleanAttribute key="usefeatures" value="false"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, SSL).launch b/plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, SSL).launch
new file mode 100644
index 0000000..436e42a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, SSL).launch
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMBranchesSSL.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.hyades.trace.ui.ATTR_DATA_COLLECTOR" value="org.eclipse.tptp.trace.jvmti.jvmtiMechanism:org.eclipse.tptp.analysisType.jvmti.thread"/>
+<stringAttribute key="org.eclipse.hyades.trace.ui.ATTR_DESTINATION_FILE" value=""/>
+<stringAttribute key="org.eclipse.hyades.trace.ui.ATTR_DESTINATION_MONITOR" value="DefaultMonitor"/>
+<stringAttribute key="org.eclipse.hyades.trace.ui.ATTR_DESTINATION_PROJECT" value="ProfileProject"/>
+<booleanAttribute key="org.eclipse.hyades.trace.ui.ATTR_PROFILE_TO_FILE" value="false"/>
+<stringAttribute key="org.eclipse.hyades.trace.ui.ATTR_PROFILING_SET" value="tptp-dummy-profiling-set-CDO AllTests (MEM branching, TCP)"/>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.AllTestsMEMBranchesSSL"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.eclipse.net4j.tcp.ssl.passphrase=ab987c -Dorg.eclipse.net4j.tcp.ssl.trust=sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=sslKey/testKeys -Xmx1024m"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, TCP).launch b/plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, TCP).launch
index f7483b3..b186695 100644
--- a/plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, TCP).launch
+++ b/plugins/org.eclipse.emf.cdo.tests/CDO AllTests (MEM branching, TCP).launch
@@ -18,5 +18,5 @@
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.AllTestsMEMBranchesTCP"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dnet4j.ssl.trust=sslKey/testTrust -Dnet4j.ssl.key=sslKey/testKeys"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.eclipse.net4j.tcp.ssl.trust=sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=sslKey/testKeys"/>
</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests/build.properties b/plugins/org.eclipse.emf.cdo.tests/build.properties
index d06856e..e33219e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/build.properties
+++ b/plugins/org.eclipse.emf.cdo.tests/build.properties
@@ -25,7 +25,8 @@ bin.includes = .,\
test.xml,\
uml2/,\
My.ecore,\
- .options
+ .options,\
+ sslKey/
jars.compile.order = .
source.. = src/,\
model/
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMBranchesSSL.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMBranchesSSL.java
new file mode 100644
index 0000000..39380f1
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMBranchesSSL.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.tests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Eike Stepper
+ */
+public class AllTestsMEMBranchesSSL extends AllConfigs
+{
+ public static Test suite()
+ {
+ return new AllTestsMEMBranchesSSL().getTestSuite(AllConfigs.class.getName());
+ }
+
+ @Override
+ protected void initConfigSuites(TestSuite parent)
+ {
+ // addScenario(parent, COMBINED, MEM, JVM, NATIVE);
+ // addScenario(parent, COMBINED, MEM_AUDITS, JVM, NATIVE);
+ addScenario(parent, SEPARATED, MEM_BRANCHES, SSL, NATIVE);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java
index 76e3ebf..53ff238 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java
@@ -39,6 +39,8 @@ public interface IConstants
public static final SessionConfig TCP = Net4j.TCP.INSTANCE;
+ public static final SessionConfig SSL = Net4j.SSL.INSTANCE;
+
public static final ModelConfig NATIVE = ModelConfig.Native.INSTANCE;
public static final ModelConfig LEGACY = ModelConfig.Legacy.INSTANCE;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
index b80be74..47491b2 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
@@ -29,6 +29,7 @@ import org.eclipse.net4j.acceptor.IAcceptor;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.jvm.JVMUtil;
import org.eclipse.net4j.tcp.TCPUtil;
+import org.eclipse.net4j.tcp.ssl.SSLUtil;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.io.IOUtil;
@@ -358,7 +359,7 @@ public abstract class SessionConfig extends Config implements ISessionConfig
{
super.setUp();
- final IManagedContainer clientContainer = getCurrentTest().getClientContainer();
+ IManagedContainer clientContainer = getCurrentTest().getClientContainer();
TCPUtil.prepareContainer(clientContainer);
IManagedContainer serverContainer = getCurrentTest().getServerContainer();
@@ -383,6 +384,70 @@ public abstract class SessionConfig extends Config implements ISessionConfig
}
/**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class SSL extends SessionConfig.Net4j
+ {
+ public static final String NAME = "SSL";
+
+ public static final SSL INSTANCE = new SSL();
+
+ public static final String CONNECTOR_HOST = "localhost";
+
+ private static final long serialVersionUID = 1L;
+
+ public SSL()
+ {
+ super(NAME);
+ }
+
+ public String getURIPrefix()
+ {
+ return "cdo.net4j.ssl://" + CONNECTOR_HOST;
+ }
+
+ @Override
+ public IAcceptor getAcceptor()
+ {
+ return SSLUtil.getAcceptor(getCurrentTest().getServerContainer(), null);
+ }
+
+ @Override
+ public IConnector getConnector()
+ {
+ return SSLUtil.getConnector(getCurrentTest().getClientContainer(), CONNECTOR_HOST);
+ }
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ IManagedContainer clientContainer = getCurrentTest().getClientContainer();
+ SSLUtil.prepareContainer(clientContainer);
+
+ IManagedContainer serverContainer = getCurrentTest().getServerContainer();
+ if (serverContainer != clientContainer)
+ {
+ SSLUtil.prepareContainer(serverContainer);
+ }
+ }
+
+ @Override
+ protected CDOViewProvider createViewProvider(final IManagedContainer container)
+ {
+ return new CDONet4jViewProvider.SSL()
+ {
+ @Override
+ protected IManagedContainer getContainer()
+ {
+ return container;
+ }
+ };
+ }
+ }
+
+ /**
* @author Eike Stepper
*/
public static final class JVM extends SessionConfig.Net4j
diff --git a/plugins/org.eclipse.net4j.examples/UploadSSLClient (Net4j Examples).launch b/plugins/org.eclipse.net4j.examples/UploadSSLClient (Net4j Examples).launch
new file mode 100644
index 0000000..536de59
--- /dev/null
+++ b/plugins/org.eclipse.net4j.examples/UploadSSLClient (Net4j Examples).launch
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="true"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="org.eclipse.net4j,org.eclipse.net4j.jvm,org.eclipse.net4j.tcp,org.eclipse.net4j.util,org.eclipse.net4j.util.ui"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/UploadSSLClient (Net4j Examples)"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../ide.rt"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.eclipse.net4j.tcp.ssl.passphrase=ab987c -Dorg.eclipse.net4j.tcp.ssl.trust=sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=sslKey/testKeys"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<stringAttribute key="selectedPlugin" value="org.eclipse.net4j"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.core.variables@default:default,org.eclipse.platform*3.7.0.v201012081300@default:default,org.eclipse.ui.presentations.r21@default:default,org.eclipse.debug.core@default:default,org.eclipse.core.net@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.jdt*3.7.0.v201010281441@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.emf.importer.ecore@default:default,org.apache.commons.logging*1.1.1.v201005080502@default:default,org.eclipse.emf.teneo.hibernate@default:default,org.eclipse.emf.databinding@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.security.win32.x86@default:false,org.eclipse.ui.workbench*3.7.0.I20101028@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.jface*3.7.0.I20101206-1300@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.ui.navigator.resources@default:default,org.eclipse.jface*3.7.0.I20101025-1300@default:default,com.ibm.icu@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.ui.console@default:default,org.eclipse.emf.teneo@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.equinox.app@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.update.scheduler@default:default,org.eclipse.core.expressions@default:default,org.eclipse.emf.teneo.hibernate.eclipse@default:default,org.eclipse.ui.workbench.texteditor*3.7.0.v20101024-2000@default:default,org.eclipse.emf.mapping.ecore@default:default,org.eclipse.ui.workbench.texteditor*3.7.0.v20101102-0800@default:default,org.eclipse.ui*3.7.0.I20101027-0800@default:default,org.eclipse.emf.databinding.edit@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.help.appserver@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.emf.exporter@default:default,org.eclipse.core.jobs@default:default,org.eclipse.emf.codegen.ecore.ui@default:default,org.eclipse.jsch.core@default:default,org.eclipse.team.core@default:default,org.eclipse.team.ui@default:default,org.eclipse.emf.mapping.ui@default:default,org.eclipse.rcp*3.7.0.v201012081300@default:default,org.eclipse.ui.editors*3.7.0.v20101123-0800@default:default,org.eclipse.core.runtime@default:true,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change.edit@default:default,org.eclipse.core.filesystem.win32.x86@default:false,org.mortbay.jetty.server@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.ui.editors*3.7.0.v20101024-2000@default:default,org.eclipse.emf.ecore.change@default:default,org.apache.lucene.queries@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.swt*3.7.0.v3712b@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.emf.mapping.ecore2ecore@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.jdt.core*3.7.0.v_B22@default:default,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.equinox.security@default:default,org.apache.lucene.highlighter@default:default,org.eclipse.text@default:default,org.eclipse.ltk.core.refactoring@default:default,org.apache.commons.codec@default:default,org.eclipse.core.commands@default:default,org.eclipse.ant.core@default:default,org.eclipse.osgi.util@default:default,javax.servlet@default:default,org.eclipse.debug.ui*3.7.0.v20101207@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.compare.core@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.help@default:default,org.eclipse.jface.text*3.7.0.v20101025-1300@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.resources@default:default,org.sat4j.pb@default:default,org.apache.lucene.misc@default:default,org.eclipse.core.resources.win32.x86@default:false,org.eclipse.equinox.launcher@default:default,org.eclipse.update.configurator@3:true,org.apache.jasper@default:default,org.eclipse.update.core.win32@default:false,org.eclipse.ecf@default:default,org.eclipse.help.ui@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.osgi*3.7.0.v20101207@-1:true,javax.persistence@default:default,org.eclipse.update.ui@default:default,org.eclipse.update.core@default:default,org.eclipse.emf@default:default,org.eclipse.ui.intro@default:default,org.apache.derby@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.ui.browser@default:default,org.eclipse.emf.ant@default:default,org.eclipse.emf.importer@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.jface.text*3.7.0.v20101130-0800@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.debug.ui*3.7.0.v20101025-0900@default:default,org.eclipse.osgi*3.7.0.v20101022@-1:true,org.eclipse.jdt.core*3.7.0.v_B28@default:default,org.eclipse.emf.mapping.ecore.editor@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.equinox.p2.publisher@default:default,org.apache.lucene.snowball@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.ui.workbench*3.7.0.I20101208-0800@default:default,org.apache.lucene.memory@default:default,org.eclipse.ui*3.7.0.I20101208-0800@default:default,org.eclipse.core.databinding@default:default,org.eclipse.ui.workbench.compatibility@default:false,org.eclipse.equinox.p2.core@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.boot@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.equinox.http.jetty@default:default,com.jcraft.jsch@default:default,org.apache.lucene.analysis@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.emf.converter@default:default,javax.xml@default:default,org.eclipse.equinox.launcher.win32.win32.x86@default:false,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.jdt.launching@default:default,org.eclipse.equinox.p2.ui@default:default,org.junit@default:default,org.eclipse.jdt*3.7.0.v201012081300@default:default,org.apache.commons.httpclient@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.emf.codegen.ui@default:default,org.eclipse.ui.navigator@default:default,org.apache.ant@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.emf.codegen.ecore@default:default,org.eclipse.emf.ecore.editor@default:default,org.eclipse.platform*3.7.0.v201010281441@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.emf.teneo.annotations@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.emf.mapping.ecore2xml.ui@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.hibernate@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.ui.views@default:default,org.eclipse.emf.ecore.xmi@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.rcp*3.7.0.v201010281441@default:default,org.eclipse.emf.teneo.eclipse@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.emf.mapping.ecore2ecore.editor@default:default,javax.servlet.jsp@default:default,org.eclipse.emf.importer.rose@default:default,org.eclipse.help.webapp@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.ui.win32@default:false,org.mortbay.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.apache.lucene.spellchecker@default:default,org.apache.commons.el@default:default,org.eclipse.emf.importer.java@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.emf.mapping@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.swt.win32.win32.x86*3.7.0.v3716@default:false,org.eclipse.help.base@default:default,org.hamcrest.core@default:default,org.dom4j@default:default,org.apache.lucene.core@default:default,org.eclipse.emf.teneo.hibernate.mapper@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.forms@default:default,org.eclipse.emf.mapping.ecore2xml@default:default,org.eclipse.equinox.common@2:true,org.eclipse.ui.net@default:default,org.eclipse.swt*3.7.0.v3716@default:default,org.eclipse.compare@default:default,org.eclipse.compare.win32@default:default,org.sat4j.core@default:default,org.eclipse.search@default:default,org.eclipse.swt.win32.win32.x86*3.7.0.v3712b@default:false,org.apache.lucene@default:default,org.eclipse.equinox.p2.jarprocessor@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j@default:default,org.eclipse.net4j.jvm@default:default,org.eclipse.net4j.examples@default:default,org.eclipse.net4j.jms.api@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<booleanAttribute key="tracing" value="true"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useProduct" value="true"/>
+<booleanAttribute key="usefeatures" value="false"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.net4j.examples/UploadSSLServer (Net4j Examples).launch b/plugins/org.eclipse.net4j.examples/UploadSSLServer (Net4j Examples).launch
new file mode 100644
index 0000000..e77dffc
--- /dev/null
+++ b/plugins/org.eclipse.net4j.examples/UploadSSLServer (Net4j Examples).launch
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadServer.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.net4j.examples.transfer.UploadServer"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.net4j.examples"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.eclipse.net4j.tcp.ssl.passphrase=ab987c -Dorg.eclipse.net4j.tcp.ssl.trust=sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=sslKey/testKeys"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.net4j.examples/build.properties b/plugins/org.eclipse.net4j.examples/build.properties
index 466e2bc..b1bf11f 100644
--- a/plugins/org.eclipse.net4j.examples/build.properties
+++ b/plugins/org.eclipse.net4j.examples/build.properties
@@ -22,6 +22,7 @@ bin.includes = META-INF/,\
about.properties,\
modeling32.png,\
plugin.xml,\
- icons/
+ icons/,\
+ sslKey/
src.includes = about.html,\
copyright.txt
diff --git a/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoSSLClient.java b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoSSLClient.java
new file mode 100644
index 0000000..ca5fb8c
--- /dev/null
+++ b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoSSLClient.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
+ */
+package org.eclipse.net4j.examples.echo.client;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.tcp.ssl.SSLUtil;
+import org.eclipse.net4j.util.container.ContainerUtil;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.PrintLogHandler;
+import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
+
+/**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ * @since 4.0
+ */
+public class EchoSSLClient
+{
+ public static void main(String[] args) throws Exception
+ {
+ // Send all traces and logs to the console
+ OMPlatform.INSTANCE.setDebugging(true);
+ OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
+ OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
+
+ // Use this container to create and wire the components
+ IManagedContainer container = ContainerUtil.createContainer();
+ Net4jUtil.prepareContainer(container);
+ SSLUtil.setDefaultSSLConfiguration("./sslKey/testKeys", "./sslKey/testTrust", "ab987c");
+ SSLUtil.prepareContainer(container);
+ container.activate();
+
+ try
+ {
+ // Start a connector that represents the client side of a physical connection
+ IConnector connector = Net4jUtil.getConnector(container, "ssl", "localhost:2036"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Open a virtual channel with the ECHO protocol, send an ECHO request and close the channel
+ EchoClientProtocol protocol = new EchoClientProtocol(connector);
+ EchoRequest request = new EchoRequest(protocol, "My cool message"); //$NON-NLS-1$
+ String echo = request.send();
+ protocol.close();
+
+ System.out.println();
+ System.out.println("ECHO: " + echo); //$NON-NLS-1$
+ System.out.println();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ finally
+ {
+ LifecycleUtil.deactivate(container);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoSSLServer.java b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoSSLServer.java
new file mode 100644
index 0000000..9aa90b7
--- /dev/null
+++ b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoSSLServer.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
+ */
+package org.eclipse.net4j.examples.echo.server;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.acceptor.IAcceptor;
+import org.eclipse.net4j.internal.examples.bundle.OM;
+import org.eclipse.net4j.tcp.ssl.SSLUtil;
+import org.eclipse.net4j.util.container.ContainerUtil;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.PrintLogHandler;
+import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
+
+/**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ * @since 4.0
+ */
+public class EchoSSLServer
+{
+ public static void main(String[] args) throws Exception
+ {
+ // Send all traces and logs to the console
+ OMPlatform.INSTANCE.setDebugging(true);
+ OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
+ OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
+
+ // Use this container to create and wire the components
+ IManagedContainer container = ContainerUtil.createContainer();
+ Net4jUtil.prepareContainer(container);
+ SSLUtil.setDefaultSSLConfiguration("./sslKey/testKeys", "./sslKey/testTrust", "ab987c");
+ SSLUtil.prepareContainer(container);
+ container.registerFactory(new EchoServerProtocol.Factory());
+ container.activate();
+
+ try
+ {
+ // Start an acceptor
+ IAcceptor acceptor = (IAcceptor)container.getElement("org.eclipse.net4j.acceptors", "ssl", "0.0.0.0:2036"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ OM.LOG.info("Accepting connections: " + acceptor); //$NON-NLS-1$
+
+ System.out.println("Press any key to shutdown"); //$NON-NLS-1$
+ while (IOUtil.IN().read() == -1)
+ {
+ Thread.sleep(200);
+ }
+ }
+ finally
+ {
+ LifecycleUtil.deactivate(container);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadSSLClientAction.java b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadSSLClientAction.java
new file mode 100644
index 0000000..1986381
--- /dev/null
+++ b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadSSLClientAction.java
@@ -0,0 +1,178 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
+ */
+package org.eclipse.net4j.examples.transfer;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.internal.examples.bundle.OM;
+import org.eclipse.net4j.signal.RequestWithMonitoring;
+import org.eclipse.net4j.signal.SignalProtocol;
+import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+import org.eclipse.net4j.util.om.monitor.EclipseMonitor;
+import org.eclipse.net4j.util.om.monitor.MonitorCanceledException;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+
+/**
+ * Need to change to this class in plugin.xml
+ *
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ * @since 4.0
+ */
+public class UploadSSLClientAction implements IWorkbenchWindowActionDelegate, UploadProtocol
+{
+ private IWorkbenchWindow window;
+
+ public UploadSSLClientAction()
+ {
+ }
+
+ public void init(IWorkbenchWindow window)
+ {
+ this.window = window;
+ }
+
+ public void run(IAction action)
+ {
+ FileDialog fileDialog = new FileDialog(window.getShell());
+ final String path = fileDialog.open();
+ if (path != null)
+ {
+ final File file = new File(path);
+ new Job("Uploading file") //$NON-NLS-1$
+ {
+ @Override
+ protected IStatus run(IProgressMonitor monitor)
+ {
+ try
+ {
+ boolean replaced = transferFile(file, monitor);
+ OM.LOG.info("File " + path + (replaced ? " replaced" : " stored") + " on the Net4j server."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return Status.OK_STATUS;
+ }
+ catch (MonitorCanceledException ex)
+ {
+ return Status.CANCEL_STATUS;
+ }
+ catch (Exception ex)
+ {
+ return new Status(IStatus.ERROR, OM.BUNDLE_ID, "Problem with upload of " + path, ex); //$NON-NLS-1$
+ }
+ finally
+ {
+ monitor.done();
+ }
+ }
+ }.schedule();
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection)
+ {
+ }
+
+ public void dispose()
+ {
+ }
+
+ private boolean transferFile(final File file, IProgressMonitor monitor) throws Exception
+ {
+ SignalProtocol<Object> protocol = null;
+
+ try
+ {
+ // Start a connector that represents the client side of a physical connection
+ IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, "ssl", "localhost:2036");
+
+ // Open a virtual channel with the ECHO protocol, send an ECHO request and close the channel
+ protocol = new SignalProtocol<Object>(PROTOCOL_NAME);
+ protocol.open(connector);
+
+ UploadRequest request = new UploadRequest(protocol, file);
+ return request.send(new EclipseMonitor(monitor));
+ }
+ finally
+ {
+ protocol.close();
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class UploadRequest extends RequestWithMonitoring<Boolean>
+ {
+ private File file;
+
+ public UploadRequest(SignalProtocol<?> protocol, File file)
+ {
+ super(protocol, UPLOAD_SIGNAL_ID);
+ this.file = file;
+ }
+
+ @Override
+ protected void requesting(ExtendedDataOutputStream out, OMMonitor monitor) throws Exception
+ {
+ long size = file.length();
+ out.writeLong(size);
+ out.writeString(file.getName());
+
+ monitor.begin((int)size);
+ BufferedInputStream in = null;
+
+ try
+ {
+ in = new BufferedInputStream(new FileInputStream(file));
+ while (size != 0L)
+ {
+ int chunk = BUFFER_SIZE;
+ if (size < BUFFER_SIZE)
+ {
+ chunk = (int)size;
+ }
+
+ byte[] buffer = new byte[chunk];
+ in.read(buffer);
+ out.writeByteArray(buffer);
+
+ monitor.worked(chunk);
+ size -= chunk;
+ }
+ }
+ finally
+ {
+ monitor.done();
+ in.close();
+ }
+ }
+
+ @Override
+ protected Boolean confirming(ExtendedDataInputStream in, OMMonitor monitor) throws Exception
+ {
+ return in.readBoolean();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadSSLServer.java b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadSSLServer.java
new file mode 100644
index 0000000..334c7b4
--- /dev/null
+++ b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/transfer/UploadSSLServer.java
@@ -0,0 +1,170 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
+ */
+package org.eclipse.net4j.examples.transfer;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.acceptor.IAcceptor;
+import org.eclipse.net4j.internal.examples.bundle.OM;
+import org.eclipse.net4j.signal.IndicationWithMonitoring;
+import org.eclipse.net4j.signal.SignalProtocol;
+import org.eclipse.net4j.signal.SignalReactor;
+import org.eclipse.net4j.tcp.ssl.SSLUtil;
+import org.eclipse.net4j.util.container.ContainerUtil;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.factory.ProductCreationException;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.PrintLogHandler;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
+import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
+
+import org.eclipse.spi.net4j.ServerProtocolFactory;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+
+/**
+ * Need to change to this class in plugin.xml
+ *
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ * @since 4.0
+ */
+public class UploadSSLServer implements UploadProtocol
+{
+ public static final String FOLDER_NAME = "/temp"; //$NON-NLS-1$
+
+ public static void main(String[] args) throws Exception
+ {
+ // Send all traces and logs to the console
+ OMPlatform.INSTANCE.setDebugging(true);
+ OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
+ OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
+
+ // Use this container to create and wire the components
+ IManagedContainer container = ContainerUtil.createContainer();
+ Net4jUtil.prepareContainer(container);
+ SSLUtil.prepareContainer(container);
+ container.registerFactory(new ProtocolFactory());
+ container.activate();
+
+ try
+ {
+ // Start an acceptor
+ IAcceptor acceptor = (IAcceptor)container.getElement("org.eclipse.net4j.acceptors", "ssl", "0.0.0.0:2036"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ OM.LOG.info("Accepting connections: " + acceptor); //$NON-NLS-1$
+
+ new File(FOLDER_NAME).mkdirs();
+ OM.LOG.info("Upload folder: " + FOLDER_NAME); //$NON-NLS-1$
+
+ System.out.println("Press any key to shutdown"); //$NON-NLS-1$
+ while (System.in.read() == -1)
+ {
+ Thread.sleep(200);
+ }
+ }
+ finally
+ {
+ LifecycleUtil.deactivate(container);
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class ProtocolFactory extends ServerProtocolFactory
+ {
+ public ProtocolFactory()
+ {
+ super(PROTOCOL_NAME);
+ }
+
+ public Object create(String description) throws ProductCreationException
+ {
+ return new SignalProtocol<Object>(PROTOCOL_NAME)
+ {
+ @Override
+ protected SignalReactor createSignalReactor(short signalID)
+ {
+ switch (signalID)
+ {
+ case UPLOAD_SIGNAL_ID:
+ return new UploadIndication(this);
+
+ default:
+ return super.createSignalReactor(signalID);
+ }
+ }
+ };
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class UploadIndication extends IndicationWithMonitoring
+ {
+ private boolean replaced;
+
+ public UploadIndication(SignalProtocol<Object> protocol)
+ {
+ super(protocol, UPLOAD_SIGNAL_ID);
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in, OMMonitor monitor) throws Exception
+ {
+ long size = in.readLong();
+ String fileName = in.readString();
+ File file = new File(FOLDER_NAME, fileName);
+ replaced = file.exists();
+ System.out.println((replaced ? "Replacing " : "Storing ") + file.getAbsolutePath()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ monitor.begin((int)size);
+ BufferedOutputStream out = null;
+
+ try
+ {
+ out = new BufferedOutputStream(new FileOutputStream(file));
+ while (size != 0L)
+ {
+ int chunk = BUFFER_SIZE;
+ if (size < BUFFER_SIZE)
+ {
+ chunk = (int)size;
+ }
+
+ byte[] buffer = in.readByteArray();
+ out.write(buffer);
+
+ monitor.worked(chunk);
+ size -= chunk;
+ }
+ }
+ finally
+ {
+ monitor.done();
+ if (out != null)
+ {
+ out.close();
+ }
+ }
+ }
+
+ @Override
+ protected void responding(ExtendedDataOutputStream out, OMMonitor monitor) throws Exception
+ {
+ out.writeBoolean(replaced);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
index 7c7f343..5ed6512 100644
--- a/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
@@ -15,4 +15,6 @@ Import-Package: org.osgi.framework;version="[1.3.0,2.0.0)";resolution:=optional
Export-Package: org.eclipse.net4j.internal.tcp;version="4.0.0";x-friends:="org.eclipse.net4j.tests,org.eclipse.net4j.defs,org.eclipse.emf.cdo.examples",
org.eclipse.net4j.internal.tcp.bundle;version="4.0.0";x-internal:=true,
org.eclipse.net4j.internal.tcp.messages;version="4.0.0";x-internal:=true,
- org.eclipse.net4j.tcp;version="4.0.0"
+ org.eclipse.net4j.internal.tcp.ssl;version="4.0.0";x-friends:="org.eclipse.net4j.tests,org.eclipse.net4j.defs,org.eclipse.emf.cdo.examples",
+ org.eclipse.net4j.tcp;version="4.0.0",
+ org.eclipse.net4j.tcp.ssl;version="4.0.0"
diff --git a/plugins/org.eclipse.net4j.tcp/SSLSelector.java b/plugins/org.eclipse.net4j.tcp/SSLSelector.java
new file mode 100644
index 0000000..66ab261
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tcp/SSLSelector.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
+ * Caspar De Groot (No Magic Asia Ltd.) - initial API and implementation
+ */
+package org.eclipse.net4j.internal.tcp.ssl;
+
+import org.eclipse.net4j.internal.tcp.TCPSelector;
+
+/**
+ * SSLSelector's functionality same as TCPSelector. Just override toString method in order to return the name of
+ * SSLSelector.
+ *
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ * @author Caspar De Groot (No Magic Asia Ltd.)
+ * @since 4.0
+ */
+public class SSLSelector extends TCPSelector
+{
+ @Override
+ public String toString()
+ {
+ return "SSLSelector"; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tcp/SSLSelectorFactory.java b/plugins/org.eclipse.net4j.tcp/SSLSelectorFactory.java
new file mode 100644
index 0000000..27f63d2
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tcp/SSLSelectorFactory.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
+ * Caspar De Groot (No Magic Asia Ltd.) - initial API and implementation
+ */
+package org.eclipse.net4j.internal.tcp.ssl;
+
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.factory.Factory;
+
+/**
+ * SSLSelectorFactory responses to create SSLSelector.
+ *
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ * @author Caspar De Groot (No Magic Asia Ltd.)
+ * @since 4.0
+ */
+public class SSLSelectorFactory extends Factory
+{
+ public static final String PRODUCT_GROUP = "org.eclipse.net4j.selectors"; //$NON-NLS-1$
+
+ public static final String TYPE = "ssl"; //$NON-NLS-1$
+
+ public SSLSelectorFactory()
+ {
+ super(PRODUCT_GROUP, TYPE);
+ }
+
+ public SSLSelector create(String description)
+ {
+ return new SSLSelector();
+ }
+
+ public static SSLSelector get(IManagedContainer container, String description)
+ {
+ return (SSLSelector)container.getElement(PRODUCT_GROUP, TYPE, description);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tcp/SSLSelectorInjector.java b/plugins/org.eclipse.net4j.tcp/SSLSelectorInjector.java
new file mode 100644
index 0000000..0bad0bb
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tcp/SSLSelectorInjector.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
+ * Caspar De Groot (No Magic Asia Ltd.) - initial API and implementation
+ */
+package org.eclipse.net4j.internal.tcp.ssl;
+
+import org.eclipse.net4j.internal.tcp.TCPConnector;
+import org.eclipse.net4j.util.container.IElementProcessor;
+import org.eclipse.net4j.util.container.IManagedContainer;
+
+/**
+ * SSLSelectorInjector responses to set the SSLSelector into SSLAcceptor for server side and SSLSelector into
+ * SSLClientConnector for client side.
+ *
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ * @author Caspar De Groot (No Magic Asia Ltd.)
+ * @since 4.0
+ */
+public class SSLSelectorInjector implements IElementProcessor
+{
+ public static final String TYPE = null;
+
+ public SSLSelectorInjector()
+ {
+ }
+
+ public Object process(IManagedContainer container, String productGroup, String factoryType, String description,
+ Object element)
+ {
+ if (element instanceof SSLAcceptor)
+ {
+ SSLAcceptor acceptor = (SSLAcceptor)element;
+ if (acceptor.getSelector() == null)
+ {
+ acceptor.setSelector(getSelector(container));
+ }
+ }
+ else if (element instanceof TCPConnector)
+ {
+ TCPConnector connector = (TCPConnector)element;
+ if (connector.getSelector() == null)
+ {
+ connector.setSelector(getSelector(container));
+ }
+ }
+
+ return element;
+ }
+
+ protected SSLSelector getSelector(IManagedContainer container)
+ {
+ return SSLSelectorFactory.get(container, null);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tcp/plugin.xml b/plugins/org.eclipse.net4j.tcp/plugin.xml
index d353a9a..0299476 100644
--- a/plugins/org.eclipse.net4j.tcp/plugin.xml
+++ b/plugins/org.eclipse.net4j.tcp/plugin.xml
@@ -16,6 +16,14 @@
<extension
point="org.eclipse.net4j.util.factories">
<factory
+ class="org.eclipse.net4j.internal.tcp.ssl.SSLAcceptorFactory"
+ productGroup="org.eclipse.net4j.acceptors"
+ type="ssl"/>
+ <factory
+ class="org.eclipse.net4j.internal.tcp.ssl.SSLConnectorFactory"
+ productGroup="org.eclipse.net4j.connectors"
+ type="ssl"/>
+ <factory
class="org.eclipse.net4j.internal.tcp.TCPAcceptorFactory"
productGroup="org.eclipse.net4j.acceptors"
type="tcp"/>
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java
index 904873a..42a687a 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java
@@ -29,6 +29,8 @@ public abstract class OM
public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
+ public static final OMTracer DEBUG_SSLBUFFER = DEBUG.tracer("sslbuffer"); //$NON-NLS-1$
+
public static final OMLogger LOG = BUNDLE.logger();
/**
diff --git a/plugins/org.eclipse.net4j.tests/Net4j SSL AllTests.launch b/plugins/org.eclipse.net4j.tests/Net4j SSL AllTests.launch
new file mode 100644
index 0000000..98d9e17
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/Net4j SSL AllTests.launch
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<stringAttribute key="bad_container_name" value="\org.eclipse.net4.tests"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
+<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;org.eclipse.emf.cdo&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.net4j.tests.AllSSLTests"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.net4j.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx700m -Ddebug=true -Dorg.eclipse.net4j.tcp.ssl.passphrase=ab987c -Dorg.eclipse.net4j.tcp.ssl.trust=sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=sslKey/testKeys"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.net4j.tests/build.properties b/plugins/org.eclipse.net4j.tests/build.properties
index 34060d1..e6c1dfd 100644
--- a/plugins/org.eclipse.net4j.tests/build.properties
+++ b/plugins/org.eclipse.net4j.tests/build.properties
@@ -23,6 +23,7 @@ bin.includes = META-INF/,\
modeling32.png,\
plugin.xml,\
.options,\
- model/
+ model/,\
+ sslKey/
src.includes = about.html,\
copyright.txt
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
index c8e4ced..ee6e272 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
*/
package org.eclipse.net4j.tests;
@@ -15,6 +16,7 @@ import org.eclipse.net4j.acceptor.IAcceptor;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.jvm.JVMUtil;
import org.eclipse.net4j.tcp.TCPUtil;
+import org.eclipse.net4j.tcp.ssl.SSLUtil;
import org.eclipse.net4j.util.container.ContainerUtil;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
@@ -22,6 +24,7 @@ import org.eclipse.net4j.util.tests.AbstractOMTest;
/**
* @author Eike Stepper
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
*/
public abstract class AbstractTransportTest extends AbstractOMTest
{
@@ -29,6 +32,9 @@ public abstract class AbstractTransportTest extends AbstractOMTest
protected IManagedContainer container;
+ // SSL, the server and client need separate container in order to operate handshake.
+ protected IManagedContainer separateContainer;
+
private IAcceptor acceptor;
private IConnector connector;
@@ -41,8 +47,16 @@ public abstract class AbstractTransportTest extends AbstractOMTest
protected void doSetUp() throws Exception
{
super.doSetUp();
+ // create container for JVM or TCP only.
container = createContainer();
LifecycleUtil.activate(container);
+
+ if (!useJVMTransport() && useSSLTransport())
+ {
+ // the SSL need separate container between client and server
+ separateContainer = createContainer();
+ LifecycleUtil.activate(separateContainer);
+ }
}
@Override
@@ -58,6 +72,10 @@ public abstract class AbstractTransportTest extends AbstractOMTest
connector = null;
acceptor = null;
container = null;
+ if (!useJVMTransport() && useSSLTransport())
+ {
+ separateContainer = null;
+ }
super.doTearDown();
}
}
@@ -67,6 +85,11 @@ public abstract class AbstractTransportTest extends AbstractOMTest
return false;
}
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
+
protected IManagedContainer createContainer()
{
IManagedContainer container = ContainerUtil.createContainer();
@@ -77,7 +100,14 @@ public abstract class AbstractTransportTest extends AbstractOMTest
}
else
{
- TCPUtil.prepareContainer(container);
+ if (useSSLTransport())
+ {
+ SSLUtil.prepareContainer(container);
+ }
+ else
+ {
+ TCPUtil.prepareContainer(container);
+ }
}
return container;
@@ -93,7 +123,14 @@ public abstract class AbstractTransportTest extends AbstractOMTest
}
else
{
- acceptor = TCPUtil.getAcceptor(container, null);
+ if (useSSLTransport())
+ {
+ acceptor = SSLUtil.getAcceptor(container, null);
+ }
+ else
+ {
+ acceptor = TCPUtil.getAcceptor(container, null);
+ }
}
}
@@ -110,7 +147,15 @@ public abstract class AbstractTransportTest extends AbstractOMTest
}
else
{
- connector = TCPUtil.getConnector(container, HOST);
+ if (useSSLTransport())
+ {
+ // cannot use same container with the acceptor.
+ connector = SSLUtil.getConnector(separateContainer, HOST);
+ }
+ else
+ {
+ connector = TCPUtil.getConnector(container, HOST);
+ }
}
}
@@ -142,9 +187,17 @@ public abstract class AbstractTransportTest extends AbstractOMTest
{
msg("RESTARTING CONTAINER"); //$NON-NLS-1$
stopTransport();
+
LifecycleUtil.deactivate(container);
container = createContainer();
LifecycleUtil.activate(container);
+
+ if (!useJVMTransport() && useSSLTransport())
+ {
+ LifecycleUtil.deactivate(separateContainer);
+ separateContainer = createContainer();
+ LifecycleUtil.activate(separateContainer);
+ }
startTransport();
msg("RESTARTING CONTAINER - FINISHED"); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java
new file mode 100644
index 0000000..0f2af87
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) 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:
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
+ */
+package org.eclipse.net4j.tests;
+
+import org.eclipse.net4j.tests.bugzilla.Bugzilla_241463_Test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+public class AllSSLTests
+{
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Tests for SSL Net4j"); //$NON-NLS-1$
+ suite.addTestSuite(ChannelTest.SSL.class);
+ suite.addTestSuite(TCPConnectorTest.SSL.class);
+ suite.addTestSuite(TransportTest.SSL.class);
+ suite.addTestSuite(SignalTest.SSL.class);
+ suite.addTestSuite(SignalMonitorTest.SSL.class);
+ suite.addTestSuite(ExceptionTest.SSL.class);
+ // Bugzillas
+ suite.addTestSuite(Bugzilla_241463_Test.SSL.class);
+
+ return suite;
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java
index e11b124..8cf91ee 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java
@@ -42,18 +42,25 @@ public class AllTests
suite.addTestSuite(StringCompressorTest.class);
suite.addTestSuite(ChannelTest.JVM.class);
suite.addTestSuite(ChannelTest.TCP.class);
- suite.addTestSuite(TCPConnectorTest.class);
+ // suite.addTestSuite(ChannelTest.SSL.class);
+ suite.addTestSuite(TCPConnectorTest.TCP.class);
+ // suite.addTestSuite(TCPConnectorTest.SSL.class);
suite.addTestSuite(TransportTest.JVM.class);
suite.addTestSuite(TransportTest.TCP.class);
- suite.addTestSuite(SignalTest.class);
- suite.addTestSuite(SignalMonitorTest.class);
- suite.addTestSuite(ExceptionTest.class);
+ // suite.addTestSuite(TransportTest.SSL.class);
+ suite.addTestSuite(SignalTest.TCP.class);
+ // suite.addTestSuite(SignalTest.SSL.class);
+ suite.addTestSuite(SignalMonitorTest.TCP.class);
+ // suite.addTestSuite(SignalMonitorTest.SSL.class);
+ suite.addTestSuite(ExceptionTest.TCP.class);
+ // suite.addTestSuite(ExceptionTest.SSL.class);
suite.addTestSuite(SecurityTest.class);
suite.addTestSuite(QueueWorkerWorkSerializerTest.class);
suite.addTestSuite(ExpectedIOTest.class);
// Bugzillas
- suite.addTestSuite(Bugzilla_241463_Test.class);
+ suite.addTestSuite(Bugzilla_241463_Test.TCP.class);
+ // suite.addTestSuite(Bugzilla_241463_Test.SSL.class);
suite.addTestSuite(Bugzilla_262875_Test.class);
// Defs
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java
index b363b7b..1f8f77c 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
*/
package org.eclipse.net4j.tests;
@@ -324,6 +325,12 @@ public abstract class ChannelTest extends AbstractProtocolTest
{
return false;
}
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
}
/**
@@ -336,5 +343,29 @@ public abstract class ChannelTest extends AbstractProtocolTest
{
return true;
}
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class SSL extends ChannelTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return true;
+ }
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java
index e59e83e..86c8d6c 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
*/
package org.eclipse.net4j.tests;
@@ -127,4 +128,40 @@ public class ExceptionTest extends AbstractProtocolTest
}
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class TCP extends ExceptionTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class SSL extends ExceptionTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return true;
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java
index f32bbc6..2429226 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
*/
package org.eclipse.net4j.tests;
@@ -178,4 +179,40 @@ public class SignalMonitorTest extends AbstractTransportTest
System.out.println("work: " + getWork()); //$NON-NLS-1$
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class TCP extends SignalMonitorTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class SSL extends SignalMonitorTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return true;
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
index 4505725..818fd29 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
*/
package org.eclipse.net4j.tests;
@@ -135,4 +136,40 @@ public class SignalTest extends AbstractProtocolTest
SocketChannel socketChannel = (SocketChannel)ReflectUtil.getValue(field, connector);
socketChannel.close();
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class TCP extends SignalTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class SSL extends SignalTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return true;
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java
index 82a192a..d58e001 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
*/
package org.eclipse.net4j.tests;
@@ -16,8 +17,15 @@ import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.connector.ConnectorException;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.internal.tcp.TCPAcceptor;
+import org.eclipse.net4j.internal.tcp.TCPAcceptorFactory;
import org.eclipse.net4j.internal.tcp.TCPClientConnector;
+import org.eclipse.net4j.internal.tcp.TCPConnector;
+import org.eclipse.net4j.internal.tcp.TCPConnectorFactory;
import org.eclipse.net4j.internal.tcp.TCPSelector;
+import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptor;
+import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptorFactory;
+import org.eclipse.net4j.internal.tcp.ssl.SSLClientConnector;
+import org.eclipse.net4j.internal.tcp.ssl.SSLConnectorFactory;
import org.eclipse.net4j.tcp.ITCPSelector;
import org.eclipse.net4j.tests.bundle.OM;
import org.eclipse.net4j.util.collection.RoundRobinBlockingQueue;
@@ -31,7 +39,6 @@ import org.eclipse.net4j.util.security.PasswordCredentialsProvider;
import org.eclipse.net4j.util.security.Randomizer;
import org.eclipse.net4j.util.security.ResponseNegotiator;
import org.eclipse.net4j.util.security.UserManager;
-import org.eclipse.net4j.util.tests.AbstractOMTest;
import org.eclipse.spi.net4j.Channel;
import org.eclipse.spi.net4j.InternalChannel;
@@ -43,14 +50,17 @@ import java.util.concurrent.Executors;
/**
* @author Eike Stepper
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
*/
-public class TCPConnectorTest extends AbstractOMTest
+public class TCPConnectorTest extends AbstractTransportTest
{
private static final int TIMEOUT = 10000;
+ private static final int PORT = 2040;
+
private static final String USER_ID = "stepper"; //$NON-NLS-1$
- private static final String INVALID_USER_ID = "crap"; //$NON-NLS-1$
+ private static final String INVALID_USER_ID = "invalid"; //$NON-NLS-1$
private static final char[] PASSWORD = "eike2008".toCharArray(); //$NON-NLS-1$
@@ -66,7 +76,7 @@ public class TCPConnectorTest extends AbstractOMTest
private TCPAcceptor acceptor;
- private TCPClientConnector connector;
+ private TCPConnector connector;
private Randomizer randomizer;
@@ -150,6 +160,63 @@ public class TCPConnectorTest extends AbstractOMTest
}
}
+ private void provideTransport()
+ {
+ selector = new TCPSelector();
+
+ if (useSSLTransport())
+ {
+ acceptor = new SSLAcceptor();
+ container.putElement(SSLAcceptorFactory.PRODUCT_GROUP, SSLAcceptorFactory.TYPE, null, acceptor);
+
+ // cannot use same container with the acceptor.
+ connector = new SSLClientConnector();
+ separateContainer.putElement(SSLConnectorFactory.PRODUCT_GROUP, SSLConnectorFactory.TYPE, null, acceptor);
+ }
+ else
+ {
+ acceptor = new TCPAcceptor();
+ container.putElement(TCPAcceptorFactory.PRODUCT_GROUP, TCPAcceptorFactory.TYPE, null, acceptor);
+
+ connector = new TCPClientConnector();
+ container.putElement(TCPConnectorFactory.PRODUCT_GROUP, TCPConnectorFactory.TYPE, null, acceptor);
+ }
+ }
+
+ private void provideTransport(final long increaseDelayAcceptor)
+ {
+ selector = new TCPSelector();
+
+ if (useSSLTransport())
+ {
+ acceptor = new SSLAcceptor()
+ {
+ @Override
+ public void handleAccept(ITCPSelector selector, ServerSocketChannel serverSocketChannel)
+ {
+ ConcurrencyUtil.sleep(increaseDelayAcceptor);
+ super.handleAccept(selector, serverSocketChannel);
+ }
+ };
+
+ connector = new SSLClientConnector();
+ }
+ else
+ {
+ acceptor = new TCPAcceptor()
+ {
+ @Override
+ public void handleAccept(ITCPSelector selector, ServerSocketChannel serverSocketChannel)
+ {
+ ConcurrencyUtil.sleep(increaseDelayAcceptor);
+ super.handleAccept(selector, serverSocketChannel);
+ }
+ };
+
+ connector = new TCPClientConnector();
+ }
+ }
+
public void testDeferredActivation() throws Exception
{
final long DELAY = 500L;
@@ -159,18 +226,9 @@ public class TCPConnectorTest extends AbstractOMTest
bufferPool = Net4jUtil.createBufferPool();
LifecycleUtil.activate(bufferPool);
- selector = new TCPSelector();
- selector.activate();
+ provideTransport(DELAY);
- acceptor = new TCPAcceptor()
- {
- @Override
- public void handleAccept(ITCPSelector selector, ServerSocketChannel serverSocketChannel)
- {
- ConcurrencyUtil.sleep(DELAY);
- super.handleAccept(selector, serverSocketChannel);
- }
- };
+ selector.activate();
acceptor.setStartSynchronously(true);
acceptor.setSynchronousStartTimeout(TIMEOUT);
@@ -178,15 +236,14 @@ public class TCPConnectorTest extends AbstractOMTest
acceptor.getConfig().setReceiveExecutor(threadPool);
acceptor.setSelector(selector);
acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(2036);
+ acceptor.setPort(PORT);
acceptor.activate();
- connector = new TCPClientConnector();
connector.getConfig().setBufferProvider(bufferPool);
connector.getConfig().setReceiveExecutor(threadPool);
connector.setSelector(selector);
connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(2036);
+ connector.setPort(PORT);
connector.activate();
// Can fail due to timing variations: assertEquals(false, connector.isActive());
@@ -232,10 +289,10 @@ public class TCPConnectorTest extends AbstractOMTest
challengeNegotiator.setUserManager(userManager);
challengeNegotiator.activate();
- selector = new TCPSelector();
+ provideTransport();
+
selector.activate();
- acceptor = new TCPAcceptor();
acceptor.setStartSynchronously(true);
acceptor.setSynchronousStartTimeout(TIMEOUT);
acceptor.getConfig().setBufferProvider(bufferPool);
@@ -243,7 +300,7 @@ public class TCPConnectorTest extends AbstractOMTest
acceptor.getConfig().setNegotiator(challengeNegotiator);
acceptor.setSelector(selector);
acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(2036);
+ acceptor.setPort(PORT);
acceptor.activate();
credentialsProvider = new PasswordCredentialsProvider(CREDENTIALS);
@@ -253,13 +310,12 @@ public class TCPConnectorTest extends AbstractOMTest
responseNegotiator.setCredentialsProvider(credentialsProvider);
responseNegotiator.activate();
- connector = new TCPClientConnector();
connector.getConfig().setBufferProvider(bufferPool);
connector.getConfig().setReceiveExecutor(threadPool);
connector.getConfig().setNegotiator(responseNegotiator);
connector.setSelector(selector);
connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(2036);
+ connector.setPort(PORT);
connector.activate();
connector.waitForConnection(DEFAULT_TIMEOUT);
@@ -312,10 +368,10 @@ public class TCPConnectorTest extends AbstractOMTest
challengeNegotiator.setUserManager(userManager);
challengeNegotiator.activate();
- selector = new TCPSelector();
+ provideTransport();
+
selector.activate();
- acceptor = new TCPAcceptor();
acceptor.setStartSynchronously(true);
acceptor.setSynchronousStartTimeout(TIMEOUT);
acceptor.getConfig().setBufferProvider(bufferPool);
@@ -323,7 +379,7 @@ public class TCPConnectorTest extends AbstractOMTest
acceptor.getConfig().setNegotiator(challengeNegotiator);
acceptor.setSelector(selector);
acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(2036);
+ acceptor.setPort(PORT);
acceptor.activate();
credentialsProvider = new PasswordCredentialsProvider(CREDENTIALS);
@@ -333,13 +389,12 @@ public class TCPConnectorTest extends AbstractOMTest
responseNegotiator.setCredentialsProvider(credentialsProvider);
responseNegotiator.activate();
- connector = new TCPClientConnector();
connector.getConfig().setBufferProvider(bufferPool);
connector.getConfig().setReceiveExecutor(threadPool);
connector.getConfig().setNegotiator(responseNegotiator);
connector.setSelector(selector);
connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(2036);
+ connector.setPort(PORT);
try
{
@@ -374,10 +429,10 @@ public class TCPConnectorTest extends AbstractOMTest
challengeNegotiator.setUserManager(userManager);
challengeNegotiator.activate();
- selector = new TCPSelector();
+ provideTransport();
+
selector.activate();
- acceptor = new TCPAcceptor();
acceptor.setStartSynchronously(true);
acceptor.setSynchronousStartTimeout(TIMEOUT);
acceptor.getConfig().setBufferProvider(bufferPool);
@@ -385,7 +440,7 @@ public class TCPConnectorTest extends AbstractOMTest
acceptor.getConfig().setNegotiator(challengeNegotiator);
acceptor.setSelector(selector);
acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(2036);
+ acceptor.setPort(PORT);
acceptor.activate();
credentialsProvider = new PasswordCredentialsProvider(CREDENTIALS);
@@ -395,13 +450,12 @@ public class TCPConnectorTest extends AbstractOMTest
responseNegotiator.setCredentialsProvider(credentialsProvider);
responseNegotiator.activate();
- connector = new TCPClientConnector();
connector.getConfig().setBufferProvider(bufferPool);
connector.getConfig().setReceiveExecutor(threadPool);
connector.getConfig().setNegotiator(responseNegotiator);
connector.setSelector(selector);
connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(2036);
+ connector.setPort(PORT);
try
{
@@ -424,25 +478,24 @@ public class TCPConnectorTest extends AbstractOMTest
bufferPool = Net4jUtil.createBufferPool();
LifecycleUtil.activate(bufferPool);
- selector = new TCPSelector();
+ provideTransport();
+
selector.activate();
- acceptor = new TCPAcceptor();
acceptor.setStartSynchronously(true);
acceptor.setSynchronousStartTimeout(TIMEOUT);
acceptor.getConfig().setBufferProvider(bufferPool);
acceptor.getConfig().setReceiveExecutor(threadPool);
acceptor.setSelector(selector);
acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(2036);
+ acceptor.setPort(PORT);
acceptor.activate();
- connector = new TCPClientConnector();
connector.getConfig().setBufferProvider(bufferPool);
connector.getConfig().setReceiveExecutor(threadPool);
connector.setSelector(selector);
connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(2036);
+ connector.setPort(PORT);
connector.setUserID("SHOULD_FAIL_LATER"); //$NON-NLS-1$
try
@@ -465,25 +518,24 @@ public class TCPConnectorTest extends AbstractOMTest
bufferPool = Net4jUtil.createBufferPool();
LifecycleUtil.activate(bufferPool);
- selector = new TCPSelector();
+ provideTransport();
+
selector.activate();
- acceptor = new TCPAcceptor();
acceptor.setStartSynchronously(true);
acceptor.setSynchronousStartTimeout(TIMEOUT);
acceptor.getConfig().setBufferProvider(bufferPool);
acceptor.getConfig().setReceiveExecutor(threadPool);
acceptor.setSelector(selector);
acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(2036);
+ acceptor.setPort(PORT);
acceptor.activate();
- connector = new TCPClientConnector();
connector.getConfig().setBufferProvider(bufferPool);
connector.getConfig().setReceiveExecutor(threadPool);
connector.setSelector(selector);
connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(2036);
+ connector.setPort(PORT);
connector.connect();
credentialsProvider = new PasswordCredentialsProvider(CREDENTIALS);
@@ -547,4 +599,39 @@ public class TCPConnectorTest extends AbstractOMTest
assertNull(queue.poll());
}
+ /**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class TCP extends TCPConnectorTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class SSL extends TCPConnectorTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return true;
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java
index e0f4bd2..4668527 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
*/
package org.eclipse.net4j.tests;
@@ -22,10 +23,12 @@ import org.eclipse.net4j.util.container.IContainerDelta;
import org.eclipse.net4j.util.container.IContainerEvent;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.factory.IFactory;
import org.eclipse.net4j.util.factory.ProductCreationException;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.spi.net4j.ClientProtocolFactory;
+import org.eclipse.spi.net4j.Connector;
import org.eclipse.spi.net4j.Protocol;
import org.eclipse.spi.net4j.ServerProtocolFactory;
@@ -54,8 +57,53 @@ public abstract class TransportTest extends AbstractProtocolTest
protected IBuffer provideBuffer()
{
- IBufferProvider bufferProvider = Net4jUtil.getBufferProvider(container);
- return bufferProvider.provideBuffer();
+ return provideBuffer(null);
+ }
+
+ protected IBuffer provideBuffer(IConnector iConnector)
+ {
+ IBuffer buffer = null;
+ if (!useJVMTransport() && useSSLTransport())
+ {
+ // cannot use buffer provider from net4j need to use SSL Buffer inside the SSLConnector.
+ buffer = ((Connector)iConnector).provideBuffer();
+ }
+ else
+ {
+ IBufferProvider bufferProvider = Net4jUtil.getBufferProvider(container);
+ buffer = bufferProvider.provideBuffer();
+ }
+
+ return buffer;
+ }
+
+ private void registerClientFactory(IFactory factory)
+ {
+ if (!useJVMTransport() && useSSLTransport())
+ {
+ // need separate container between client and server for SSL.
+ separateContainer.registerFactory(factory);
+ }
+ else
+ {
+ container.registerFactory(factory);
+ }
+ }
+
+ protected IBufferProvider provideBufferProvider(IConnector iConnector)
+ {
+ IBufferProvider bufferProvider = null;
+ if (!useJVMTransport() && useSSLTransport())
+ {
+ // cannot use buffer provider from net4j need to use SSL Buffer inside the SSLConnector.
+ bufferProvider = ((Connector)iConnector).getConfig().getBufferProvider();
+ }
+ else
+ {
+ bufferProvider = Net4jUtil.getBufferProvider(container);
+ }
+
+ return bufferProvider;
}
public void testConnect() throws Exception
@@ -66,10 +114,12 @@ public abstract class TransportTest extends AbstractProtocolTest
public void testSendBuffer() throws Exception
{
startTransport();
- IChannel channel = getConnector().openChannel();
+ IConnector iConnecter = getConnector();
+ IChannel channel = iConnecter.openChannel();
for (int i = 0; i < 3; i++)
{
- IBuffer buffer = provideBuffer();
+ IBuffer buffer = provideBuffer(iConnecter);
+
ByteBuffer byteBuffer = buffer.startPutting(channel.getID());
byteBuffer.putInt(1970);
channel.sendBuffer(buffer);
@@ -81,13 +131,14 @@ public abstract class TransportTest extends AbstractProtocolTest
final int COUNT = 3;
final CountDownLatch counter = new CountDownLatch(COUNT);
container.registerFactory(new TestProtocol.ServerFactory(counter));
- container.registerFactory(new TestProtocol.ClientFactory());
+ // need to handle about separating container between client and server for SSL.
+ registerClientFactory(new TestProtocol.ClientFactory());
startTransport();
-
- IChannel channel = getConnector().openChannel(TestProtocol.ClientFactory.TYPE, null);
+ IConnector iConnecter = getConnector();
+ IChannel channel = iConnecter.openChannel(TestProtocol.ClientFactory.TYPE, null);
for (int i = 0; i < COUNT; i++)
{
- IBuffer buffer = provideBuffer();
+ IBuffer buffer = provideBuffer(iConnecter);
ByteBuffer byteBuffer = buffer.startPutting(channel.getID());
byteBuffer.putInt(1970);
channel.sendBuffer(buffer);
@@ -263,7 +314,8 @@ public abstract class TransportTest extends AbstractProtocolTest
}
});
- final IChannel channel = getConnector().openChannel();
+ final IConnector iConnector = getConnector();
+ final IChannel channel = iConnector.openChannel();
assertEquals(true, counter.await(2, TimeUnit.SECONDS));
assertNotNull(inputStream[0]);
@@ -274,7 +326,7 @@ public abstract class TransportTest extends AbstractProtocolTest
{
try
{
- IBufferProvider bufferProvider = Net4jUtil.getBufferProvider(container);
+ IBufferProvider bufferProvider = provideBufferProvider(iConnector);
ChannelOutputStream outputStream = new ChannelOutputStream(channel, bufferProvider);
PrintStream printer = new PrintStream(outputStream);
StringTokenizer tokenizer = HugeData.getTokenizer();
@@ -436,6 +488,12 @@ public abstract class TransportTest extends AbstractProtocolTest
{
return false;
}
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
}
/**
@@ -448,5 +506,29 @@ public abstract class TransportTest extends AbstractProtocolTest
{
return true;
}
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class SSL extends TransportTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return true;
+ }
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java
index f0ebdd9..179ec9d 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - maintenance (SSL)
*/
package org.eclipse.net4j.tests.bugzilla;
@@ -17,8 +18,14 @@ import org.eclipse.net4j.internal.tcp.TCPConnectorFactory;
import org.eclipse.net4j.internal.tcp.TCPSelectorFactory;
import org.eclipse.net4j.internal.tcp.TCPSelectorInjector;
import org.eclipse.net4j.internal.tcp.TCPServerConnector;
+import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptor;
+import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptorFactory;
+import org.eclipse.net4j.internal.tcp.ssl.SSLConnectorFactory;
+import org.eclipse.net4j.internal.tcp.ssl.SSLServerConnector;
import org.eclipse.net4j.tcp.ITCPAcceptor;
+import org.eclipse.net4j.tcp.ITCPSelector;
import org.eclipse.net4j.tests.AbstractTransportTest;
+import org.eclipse.net4j.tests.ChannelTest;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
import org.eclipse.net4j.util.concurrent.ExecutorServiceFactory;
import org.eclipse.net4j.util.container.IManagedContainer;
@@ -29,6 +36,10 @@ import org.eclipse.internal.net4j.buffer.BufferProviderFactory;
import org.eclipse.spi.net4j.InternalChannel;
+import java.nio.channels.ClosedChannelException;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+
/**
* @author Eike Stepper
*/
@@ -45,12 +56,22 @@ public class Bugzilla_241463_Test extends AbstractTransportTest
container.registerFactory(new RandomizerFactory());
container.addPostProcessor(new TransportInjector());
- // TCP
container.registerFactory(new TCPSelectorFactory());
- container.registerFactory(new FakeAcceptorFactory());
- container.registerFactory(new TCPConnectorFactory());
container.addPostProcessor(new TCPSelectorInjector());
+ if (useSSLTransport())
+ {
+ // SSL
+ container.registerFactory(new FakeSSLAcceptorFactory());
+ container.registerFactory(new SSLConnectorFactory());
+ }
+ else
+ {
+ // TCP
+ container.registerFactory(new FakeAcceptorFactory());
+ container.registerFactory(new TCPConnectorFactory());
+ }
+
// Test
container.registerFactory(new TestSignalProtocol.Factory());
return container;
@@ -100,4 +121,92 @@ public class Bugzilla_241463_Test extends AbstractTransportTest
return acceptor;
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class FakeSSLAcceptorFactory extends SSLAcceptorFactory
+ {
+ @Override
+ public SSLAcceptor create(String description)
+ {
+ SSLAcceptor acceptor = new SSLAcceptor()
+ {
+
+ @Override
+ public void handleAccept(ITCPSelector selector, ServerSocketChannel serverSocketChannel)
+ {
+ try
+ {
+ SocketChannel socketChannel = serverSocketChannel.accept();
+ if (socketChannel != null)
+ {
+ socketChannel.configureBlocking(false);
+
+ SSLServerConnector connector = new SSLServerConnector(this)
+ {
+ @Override
+ public InternalChannel inverseOpenChannel(short channelID, String protocolID)
+ {
+ throw new RuntimeException("Simulated problem"); //$NON-NLS-1$
+ }
+ };
+ prepareConnector(connector);
+ connector.setSocketChannel(socketChannel);
+ connector.setSelector(selector);
+ connector.activate();
+ }
+ }
+ catch (ClosedChannelException ex)
+ {
+ deactivateAsync();
+ }
+ catch (Exception ex)
+ {
+ deactivateAsync();
+ }
+ }
+ };
+
+ acceptor.setAddress(ITCPAcceptor.DEFAULT_ADDRESS);
+ acceptor.setPort(ITCPAcceptor.DEFAULT_PORT);
+ return acceptor;
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class TCP extends ChannelTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ */
+ public static final class SSL extends ChannelTest
+ {
+ @Override
+ protected boolean useJVMTransport()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean useSSLTransport()
+ {
+ return true;
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
index cef0924..46a9fe9 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
@@ -110,11 +110,6 @@ public class Buffer implements InternalBuffer
public ByteBuffer getByteBuffer()
{
- if (state != BufferState.GETTING && state != BufferState.PUTTING)
- {
- throw new IllegalStateException(toString());
- }
-
return byteBuffer;
}
@@ -425,6 +420,10 @@ public class Buffer implements InternalBuffer
throw new ClosedChannelException();
}
}
+ catch (ClosedChannelException ex)
+ {
+ throw ex;
+ }
catch (IOException ex)
{
throw new ClosedChannelException();