Difference between revisions of "ECF/Servers"

From Eclipsepedia

< ECF
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
==ECF Generic Server==
 
==ECF Generic Server==
  
ECF Generic Servers can now be created, started, and managed dynamically using the [https://build.ecf-project.org/jenkins/job/C-HEAD-sdk.feature/javadoc/org/eclipse/ecf/server/generic/IGenericServerContainerGroupFactory.html IGenericServerContainerGroupFactory] service started in the bundle activator of the org.eclipse.ecf.server.generic bundle.
+
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.
  
 
Here some example code for creating/starting a simple ECF generic server
 
Here some example code for creating/starting a simple ECF generic server
Line 9: Line 9:
 
// or via ServiceTracker
 
// or via ServiceTracker
 
IGenericServerContainerGroupFactory genericServerFactory = <get IGenericServerContainerGroupFactory service>;
 
IGenericServerContainerGroupFactory genericServerFactory = <get IGenericServerContainerGroupFactory service>;
 +
 
// Create generic server container group for localhost, listen port=3282
 
// Create generic server container group for localhost, listen port=3282
 
IGenericServerContainerGroup containerGroup = genericServerFactory.createContainerGroup("localhost",3282);
 
IGenericServerContainerGroup containerGroup = genericServerFactory.createContainerGroup("localhost",3282);
 +
 
// Create an ECF container within the container group, and give it path="/server"
 
// Create an ECF container within the container group, and give it path="/server"
containerGroup.createContainer("/server",30000,null);
 
 
// The resulting container's ID will be:  ecftcp://localhost:3282/server
 
// The resulting container's ID will be:  ecftcp://localhost:3282/server
// Now start listening for client connections
+
containerGroup.createContainer("/server");
 +
 
 +
// start listening for client connections
 
containerGroup.startListening();
 
containerGroup.startListening();
 
</pre>
 
</pre>

Latest revision as of 15:36, 14 March 2011

[edit] 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 DocumentationJavadocProvidersECF/Bot Framework
Development
Development GuidelinesIntegrators Guide