Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "ECF/Servers"

< ECF
(Setting up an ECF Generic Server with Equinox (ECF version 1.0.0M6 or newer))
 
(41 intermediate revisions by 12 users not shown)
Line 1: Line 1:
 
==ECF Generic Server==
 
==ECF Generic Server==
[[Eclipse Communication Framework Project|ECF]] is currently using the [http://www.eclipse.org/equinox/documents/http_in_container.php Equinox Servlet Incubator] to run and support the example collab application running on the 'ECF generic' provider.
 
  
===Connecting to the ECF Generic Server===
+
ECF Generic Servers can now be created, started, and managed dynamically using the [http://download.eclipse.org/rt/ecf/3.5Test/javadoc/org/eclipse/ecf/server/generic/IGenericServerContainerGroupFactory.html IGenericServerContainerGroupFactory] service started in the bundle activator of the org.eclipse.ecf.server.generic bundle.
#[http://www.eclipse.org/ecf/downloads.php Download] and install the ECF SDK.
+
#Right-click on a project within your workspace.
+
#Choose 'ECF' -> 'Connect Project...' from the popup menu.
+
#Select the 'ECF generic' provider from the list.
+
#Use '''ecftcp://ecf.eclipse.org:3282/server''' as the connect URI.
+
#Choose a nickname and then select the 'OK' button.
+
  
===Setting up an ECF Generic Server with Equinox (ECF version 1.0.0M6 or newer)===
+
Here some example code for creating/starting a simple ECF generic server
  
With the following enhancement: [https://bugs.eclipse.org/bugs/show_bug.cgi?id=112890 #112890], it's
 
possible to configure an ECF generic server by providing a plugin with an extension for the
 
<b>org.eclipse.ecf.server.generic.configure</b> extension point.
 
 
<ol>
 
<li>Follow instructions for setting up the [http://www.eclipse.org/equinox/server/http_in_container.php Equinox Servlet Incubator].  Note the location of the '''<appserverhome>/webapps/bridge/WEB-INF/platform/plugins''' directory.
 
</li>
 
<li><b>
 
NOTE: ECF server requires some of the bundles that come from the Equinox core (containing org.eclipse.core.runtime packages and and others).  See [http://download.eclipse.org/eclipse/equinox/ Equinox download page] for these bundles.</b>
 
</li>
 
<li>Download and install/deploy ECF bundles to the '''<appserverhome>/webapps/bridge/WEB-INF/platform/plugins''' directory.
 
</li>
 
<li>
 
Create a new plugin, and add the following extension to this new plugin:
 
 
<pre>
 
<pre>
  <extension
+
// Get generic server container group factory service...e.g. via declarative service injection
        point="org.eclipse.ecf.server.generic.configuration">
+
// or via ServiceTracker
      <connector
+
IGenericServerContainerGroupFactory genericServerFactory = <get IGenericServerContainerGroupFactory service>;
            hostname="localhost"
+
            keepAlive="30000"
+
            port="3283">
+
        <group
+
              name="server">
+
        </group>
+
      </connector>
+
  </extension>
+
</pre>
+
  
With the above, the server id would be 'ecftcp://localhost:3283/server'.
+
// Create generic server container group for localhost, listen port=3282
 +
IGenericServerContainerGroup containerGroup = genericServerFactory.createContainerGroup("localhost",3282);
  
Change the values of 'hostname', 'keepAlive', 'port' for the connector, and add groups as desired/appropriate.  For example:
+
// Create an ECF container within the container group, and give it path="/server"
<pre>
+
// The resulting container's ID will be:  ecftcp://localhost:3282/server
  <extension
+
containerGroup.createContainer("/server");
        point="org.eclipse.ecf.server.generic.configuration">
+
      <connector
+
            hostname="ecf.eclipse.org"
+
            keepAlive="20000"
+
            port="9999">
+
        <group
+
              name="groupone">
+
        </group>
+
        <group
+
              name="grouptwo">
+
        </group>
+
      </connector>
+
  </extension>
+
</pre>
+
  
With the above, the ids for the two groups would be 'ecftcp://ecf.eclipse.org:9999/groupone' and 'ecftcp://ecf.eclipse.org:9999/grouptwo'.
+
// start listening for client connections
</li>
+
containerGroup.startListening();
<li>
+
Build and deploy this new plugin to server plugins directory, along with all the other ECF bundles.
+
</li>
+
<li>Start the <b>org.eclipse.ecf.server.generic</b> bundle.  This can be done via the server console (with ''''start org.eclipse.ecf.server.generic'''') or can be setup to start automatically via the '''<appserverhome>webapps/bridge/WEB-INF/platform/configuration/config.ini''' file.  Which is chosen
+
is dependent upon how one has setup the [http://www.eclipse.org/equinox/server/ Equinox server].
+
</li>
+
</ol>
+
 
+
===Setting up an ECF Generic Server with Equinox (prior to version 1.0.0M6)===
+
 
+
<ol>
+
<li>Follow instructions for setting up the [http://www.eclipse.org/equinox/server/http_in_container.php Equinox Servlet Incubator].  Note the location of the '''<appserverhome>/webapps/bridge/WEB-INF/platform/plugins''' directory.
+
</li>
+
<li><b>
+
NOTE: ECF server requires some of the bundles that come from the Equinox core (containing org.eclipse.core.runtime packages and and others).  See [http://download.eclipse.org/eclipse/equinox/ Equinox download page] for these bundles.</b>
+
</li>
+
<li>Download ECF plugins:  [http://www.eclipse.org/downloads/download.php?file=/technology/ecf/org.eclipse.ecf.sdk-0.9.6.S20070113.zip  ECF 0.9.6] or [http://www.eclipse.org/downloads/download.php ECF Download Page]
+
#Copy the ECF plugins into the '''<appserverhome>/webapps/bridge/WEB-INF/platform/plugins''' directory created above.
+
</li>
+
<li>Edit the '''conf/server.xml''' in '''org.eclipse.ecf.server''' plugin (temporarily (0.9.6) you will need to unjar this plugin, edit the server.xml as described below and either re-jar it or create a directory for  it...we'll get this fixed in subsequent releases.  I've setup bug  [https://bugs.eclipse.org/bugs/show_bug.cgi?id=172724 172724] to track this).
+
 
+
The default content for server.xml is:
+
 
+
<pre>
+
<server>
+
  <!--
+
    <connector protocol="ecftcp"  hostname="localhost" port="3282" timeout="30000">
+
<group name="server"/>
+
    </connector>
+
-->
+
</server>
+
 
</pre>
 
</pre>
  
Notice that this default connector is commented out.  You should create connectors like this (from ecf.eclipse.org):
+
{{ECF}}
 
+
<pre>
+
<server>
+
  <connector protocol="ecftcp"  hostname="localhost" port="3282" timeout="30000">
+
          <group name="server"/>
+
          <group name="se"/>
+
  </connector>
+
</server>
+
</pre>
+
 
+
This sets up two groups, with URLs: 
+
 
+
'''ecftcp://ecf.eclipse.org:3282/server''' and '''ecftcp://ecf.eclipse.org:3282/se'''
+
 
+
You can add as many groups as you want for a given connector.
+
</li>
+
<li>Start the org.eclipse.ecf.server bundle.  This can be done via the server console (with ''''start org.eclipse.ecf.server'''') or can be setup to start automatically via the '''<appserverhome>webapps/bridge/WEB-INF/platform/configuration/config.ini''' file.
+
</li>
+
</ol>
+
  
[[Category:Eclipse Communication Framework|Servers]]
+
[[Category:Eclipse Communication Framework]]
 +
[[Category:ECF]]
 +
[[Category:Servers]]

Latest revision as of 15:36, 14 March 2011

ECF Generic Server

ECF Generic Servers can now be created, started, and managed dynamically using the IGenericServerContainerGroupFactory service started in the bundle activator of the org.eclipse.ecf.server.generic bundle.

Here some example code for creating/starting a simple ECF generic server

// Get generic server container group factory service...e.g. via declarative service injection
// or via ServiceTracker
IGenericServerContainerGroupFactory genericServerFactory = <get IGenericServerContainerGroupFactory service>;

// Create generic server container group for localhost, listen port=3282
IGenericServerContainerGroup containerGroup = genericServerFactory.createContainerGroup("localhost",3282);

// Create an ECF container within the container group, and give it path="/server"
// The resulting container's ID will be:  ecftcp://localhost:3282/server
containerGroup.createContainer("/server");

// start listening for client connections
containerGroup.startListening();
Eclipse Communication Framework
API
API DocumentationJavadocProviders
Development
Development GuidelinesIntegrators Guide

Back to the top