Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2013-01-18 06:27:23 +0000
committerslewis2013-01-18 06:27:23 +0000
commitcb4d73609ca031c5649f855b57dd03ed7cfc1b9d (patch)
treefd978c47712e959929584ace3e62984713bd213d /server-side
parent15d0cf001a6ca546eb08955b67a3fe7b9b51494e (diff)
parent6e0debee6465770c617adc3ca4c9c9e04e7c49b5 (diff)
downloadorg.eclipse.ecf-cb4d73609ca031c5649f855b57dd03ed7cfc1b9d.tar.gz
org.eclipse.ecf-cb4d73609ca031c5649f855b57dd03ed7cfc1b9d.tar.xz
org.eclipse.ecf-cb4d73609ca031c5649f855b57dd03ed7cfc1b9d.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'server-side')
-rw-r--r--server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/.settings/.api_filters22
-rw-r--r--server-side/bundles/org.eclipse.ecf.server.generic/launchconfigs/Generic Client Java App.launch24
-rw-r--r--server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractSSLGenericServer.java133
-rw-r--r--server-side/examples/bundles/org.eclipse.ecf.examples.remoteservices.server/readme.txt2
-rw-r--r--server-side/examples/bundles/org.eclipse.ecf.examples.updatesite.server/launch/Remote Updatesite Server.launch48
-rw-r--r--server-side/features/org.eclipse.ecf.server.feature/feature.xml62
-rw-r--r--server-side/features/org.eclipse.ecf.server.generic.feature/feature.xml76
7 files changed, 250 insertions, 117 deletions
diff --git a/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/.settings/.api_filters b/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/.settings/.api_filters
index cc1f966bf..2ab56cfd4 100644
--- a/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/.settings/.api_filters
+++ b/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/.settings/.api_filters
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.ecf.remoteservice.eventadmin" version="2">
- <resource path="src/org/eclipse/ecf/internal/remoteservice/eventadmin/LogTracker.java" type="org.eclipse.ecf.internal.remoteservice.eventadmin.LogTracker">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="LogService"/>
- <message_argument value="LogTracker"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.ecf.remoteservice.eventadmin" version="2">
+ <resource path="src/org/eclipse/ecf/internal/remoteservice/eventadmin/LogTracker.java" type="org.eclipse.ecf.internal.remoteservice.eventadmin.LogTracker">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="LogService"/>
+ <message_argument value="LogTracker"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/server-side/bundles/org.eclipse.ecf.server.generic/launchconfigs/Generic Client Java App.launch b/server-side/bundles/org.eclipse.ecf.server.generic/launchconfigs/Generic Client Java App.launch
index 2f6960d67..39f43f19a 100644
--- a/server-side/bundles/org.eclipse.ecf.server.generic/launchconfigs/Generic Client Java App.launch
+++ b/server-side/bundles/org.eclipse.ecf.server.generic/launchconfigs/Generic Client Java App.launch
@@ -1,12 +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.ecf.server.generic/src/org/eclipse/ecf/server/generic/app/GenericClientJavaApplication.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.ecf.server.generic.app.GenericClientJavaApplication"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-clientId something:slewis@composent.com/333334"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.ecf.server.generic"/>
-</launchConfiguration>
+<?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.ecf.server.generic/src/org/eclipse/ecf/server/generic/app/GenericClientJavaApplication.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.ecf.server.generic.app.GenericClientJavaApplication"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-clientId something:slewis@composent.com/333334"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.ecf.server.generic"/>
+</launchConfiguration>
diff --git a/server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractSSLGenericServer.java b/server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractSSLGenericServer.java
new file mode 100644
index 000000000..400a1f4a0
--- /dev/null
+++ b/server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractSSLGenericServer.java
@@ -0,0 +1,133 @@
+package org.eclipse.ecf.server.generic;
+
+import java.io.IOException;
+import java.security.PermissionCollection;
+import java.util.*;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.IContainerManager;
+import org.eclipse.ecf.core.identity.*;
+import org.eclipse.ecf.core.security.IConnectHandlerPolicy;
+import org.eclipse.ecf.internal.server.generic.Activator;
+import org.eclipse.ecf.provider.generic.*;
+
+/**
+ * @since 6.0
+ */
+public abstract class AbstractSSLGenericServer {
+
+ protected SSLServerSOContainerGroup serverGroup;
+
+ public AbstractSSLGenericServer(String host, int port) {
+ this.serverGroup = new SSLServerSOContainerGroup(host, port);
+ }
+
+ /**
+ * @since 2.0
+ */
+ public SSLGenericServerContainer getFirstServerContainer() {
+ return getServerContainer(0);
+ }
+
+ public List /* GenericServerContainer */getServerContainers() {
+ List result = new ArrayList();
+ for (Iterator i = serverGroup.elements(); i.hasNext();) {
+ result.add(i.next());
+ }
+ return result;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public SSLGenericServerContainer getServerContainer(int index) {
+ return (SSLGenericServerContainer) getServerContainers().get(index);
+ }
+
+ protected void putOnTheAir() throws IOException {
+ if (!serverGroup.isOnTheAir())
+ serverGroup.putOnTheAir();
+ }
+
+ protected void takeOffTheAir() {
+ if (serverGroup.isOnTheAir())
+ serverGroup.takeOffTheAir();
+ }
+
+ public synchronized void start(String path, int keepAlive) throws Exception {
+ createAndInitializeServer(path, keepAlive);
+ putOnTheAir();
+ }
+
+ public synchronized void stop() {
+ if (serverGroup != null) {
+ serverGroup.takeOffTheAir();
+ }
+ List servers = getServerContainers();
+ for (Iterator i = servers.iterator(); i.hasNext();) {
+ GenericServerContainer s = (GenericServerContainer) i.next();
+ s.ejectAllGroupMembers("Shutting down immediately"); //$NON-NLS-1$
+ s.dispose();
+ }
+ }
+
+ protected void createAndInitializeServer(String path) throws IDCreateException {
+ createAndInitializeServer(path, TCPServerSOContainer.DEFAULT_KEEPALIVE);
+ }
+
+ protected void createAndInitializeServer(String path, int keepAlive) throws IDCreateException {
+ if (path == null || path.equals("")) //$NON-NLS-1$
+ throw new NullPointerException("Cannot create ID with null or empty path"); //$NON-NLS-1$
+ SSLGenericServerContainer s = new SSLGenericServerContainer(this, createServerConfig(path), serverGroup, path, keepAlive);
+ IContainerManager containerManager = Activator.getDefault().getContainerManager();
+ if (containerManager != null) {
+ ContainerTypeDescription ctd = containerManager.getContainerFactory().getDescriptionByName("ecf.generic.server.secure"); //$NON-NLS-1$
+ containerManager.addContainer(s, ctd);
+ }
+ IConnectHandlerPolicy policy = createConnectHandlerPolicy(s, path);
+ if (policy != null)
+ s.setConnectPolicy(policy);
+ }
+
+ protected PermissionCollection checkConnect(Object address, ID fromID, ID targetID, String targetGroup, Object connectData) throws Exception {
+ return null;
+ }
+
+ protected abstract void handleDisconnect(ID targetID);
+
+ protected abstract void handleEject(ID targetID);
+
+ /**
+ * @since 2.0
+ */
+ protected IConnectHandlerPolicy createConnectHandlerPolicy(SSLGenericServerContainer s, String path) {
+ return new IConnectHandlerPolicy() {
+ public PermissionCollection checkConnect(Object address, ID fromID, ID targetID, String targetGroup, Object connectData) throws Exception {
+ return AbstractSSLGenericServer.this.checkConnect(address, fromID, targetID, targetGroup, connectData);
+ }
+
+ public void refresh() {
+ // do nothing
+ }
+ };
+ }
+
+ protected ID createServerIDFromPath(String path) throws IDCreateException {
+ if (!path.startsWith("/"))path = "/" + path; //$NON-NLS-1$//$NON-NLS-2$
+ String id = SSLServerSOContainer.DEFAULT_PROTOCOL + "://" //$NON-NLS-1$
+ + getHost() + ":" + getPort() + path; //$NON-NLS-1$
+ return IDFactory.getDefault().createStringID(id);
+ }
+
+ protected SOContainerConfig createServerConfig(String path) throws IDCreateException {
+ return new SOContainerConfig(createServerIDFromPath(path));
+ }
+
+ protected String getHost() {
+ return this.serverGroup.getName();
+ }
+
+ protected int getPort() {
+ return this.serverGroup.getPort();
+ }
+
+}
diff --git a/server-side/examples/bundles/org.eclipse.ecf.examples.remoteservices.server/readme.txt b/server-side/examples/bundles/org.eclipse.ecf.examples.remoteservices.server/readme.txt
index 687b6b65f..d484eeaa2 100644
--- a/server-side/examples/bundles/org.eclipse.ecf.examples.remoteservices.server/readme.txt
+++ b/server-side/examples/bundles/org.eclipse.ecf.examples.remoteservices.server/readme.txt
@@ -1,2 +1,2 @@
-This example has been deprecated, as with new OSGi 4.2
+This example has been deprecated, as with new OSGi 4.2
remote services spec this example is not useful. \ No newline at end of file
diff --git a/server-side/examples/bundles/org.eclipse.ecf.examples.updatesite.server/launch/Remote Updatesite Server.launch b/server-side/examples/bundles/org.eclipse.ecf.examples.updatesite.server/launch/Remote Updatesite Server.launch
index 5e96e79f7..fcbcbb7e1 100644
--- a/server-side/examples/bundles/org.eclipse.ecf.examples.updatesite.server/launch/Remote Updatesite Server.launch
+++ b/server-side/examples/bundles/org.eclipse.ecf.examples.updatesite.server/launch/Remote Updatesite Server.launch
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="automaticAdd" value="false"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Remote Updatesite Server"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="default_auto_start" value="false"/>
-<intAttribute key="default_start_level" value="4"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-console -consolelog -application org.eclipse.ecf.examples.updatesite.server.updateSiteServer file:///c:/build.server/ecf.build/updateSite/"/>
-<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.osgi.service.http.port=8081"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<booleanAttribute key="show_selected_only" value="true"/>
-<stringAttribute key="target_bundles" value="javax.servlet@default:default,org.apache.commons.logging@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.equinox.app@default:true,org.eclipse.equinox.common@2:true,org.eclipse.equinox.http.jetty@default:true,org.eclipse.equinox.http.registry@default:true,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi.util@default:default,org.eclipse.osgi@-1:true"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<stringAttribute key="workspace_bundles" value="org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.examples.updatesite.server@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.jmdns@default:true,org.eclipse.ecf@default:default"/>
-</launchConfiguration>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Remote Updatesite Server"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="default_auto_start" value="false"/>
+<intAttribute key="default_start_level" value="4"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-console -consolelog -application org.eclipse.ecf.examples.updatesite.server.updateSiteServer file:///c:/build.server/ecf.build/updateSite/"/>
+<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.osgi.service.http.port=8081"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<booleanAttribute key="show_selected_only" value="true"/>
+<stringAttribute key="target_bundles" value="javax.servlet@default:default,org.apache.commons.logging@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.equinox.app@default:true,org.eclipse.equinox.common@2:true,org.eclipse.equinox.http.jetty@default:true,org.eclipse.equinox.http.registry@default:true,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi.util@default:default,org.eclipse.osgi@-1:true"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<stringAttribute key="workspace_bundles" value="org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.examples.updatesite.server@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.jmdns@default:true,org.eclipse.ecf@default:default"/>
+</launchConfiguration>
diff --git a/server-side/features/org.eclipse.ecf.server.feature/feature.xml b/server-side/features/org.eclipse.ecf.server.feature/feature.xml
index 6bd474aab..71581e55b 100644
--- a/server-side/features/org.eclipse.ecf.server.feature/feature.xml
+++ b/server-side/features/org.eclipse.ecf.server.feature/feature.xml
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.ecf.serverfeature"
- label="ECF Server"
- version="2.0.0.qualifier"
- provider-name="Eclipse.org">
-
- <description url="http://www.eclipse.org/ecf">
- This feature provides a ECF server support.
- </description>
-
- <copyright url="http://www.eclipse.org/ecf">
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.ecf.serverfeature"
+ label="ECF Server"
+ version="2.0.0.qualifier"
+ provider-name="Eclipse.org">
+
+ <description url="http://www.eclipse.org/ecf">
+ This feature provides a ECF server support.
+ </description>
+
+ <copyright url="http://www.eclipse.org/ecf">
/*******************************************************************************
* Copyright (c) 2004 Composent, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available
@@ -18,10 +18,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Composent, Inc. - initial API and implementation
-******************************************************************************/
- </copyright>
-
- <license url="http://www.eclipse.org/ecf">
+******************************************************************************/
+ </copyright>
+
+ <license url="http://www.eclipse.org/ecf">
About This Content
May 2, 2006
License
@@ -41,18 +41,18 @@ Redistributor&apos;s license that was provided with the Content.
If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply
to any source code in the Content and such source code may be
-obtained at http://www.eclipse.org.
- </license>
-
- <requires>
- <import plugin="org.eclipse.osgi"/>
- </requires>
-
- <plugin
- id="org.eclipse.ecf.server"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+obtained at http://www.eclipse.org.
+ </license>
+
+ <requires>
+ <import plugin="org.eclipse.osgi"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.ecf.server"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/server-side/features/org.eclipse.ecf.server.generic.feature/feature.xml b/server-side/features/org.eclipse.ecf.server.generic.feature/feature.xml
index e87ed9daa..689790c17 100644
--- a/server-side/features/org.eclipse.ecf.server.generic.feature/feature.xml
+++ b/server-side/features/org.eclipse.ecf.server.generic.feature/feature.xml
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.ecf.server.generic.feature"
- label="ECF Generic Server"
- version="1.0.0.qualifier"
- provider-name="%providerName">
-
- <description url="http://www.eclipse.org/ecf">
- This feature provides the ECF Generic Server Support.
- </description>
-
- <copyright>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.ecf.server.generic.feature"
+ label="ECF Generic Server"
+ version="1.0.0.qualifier"
+ provider-name="%providerName">
+
+ <description url="http://www.eclipse.org/ecf">
+ This feature provides the ECF Generic Server Support.
+ </description>
+
+ <copyright>
#################################################
# Copyright (c) 2010 Composent, Inc. and others. All rights reserved.
# This program and the accompanying materials are made available under the
@@ -18,29 +18,29 @@
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors: Composent, Inc. - initial API and implementation
-#################################################
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <includes
- id="org.eclipse.ecf.remoteservice.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.ecf.server"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.server.generic"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+#################################################
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <includes
+ id="org.eclipse.ecf.remoteservice.feature"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.ecf.server"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.ecf.server.generic"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>

Back to the top