scott,
when i checked out the code it comes up with a syntax error
in org.eclipse.ecf.provider.comm.tcp.Client! probably because
the projects where imported with jdk1.5 settings and you use
the "enum" as an identifier. in jdk1.5 it is a keyword!
cheers
/eike
Scott Lewis wrote:
ECFers,
The ECF team has checked into the ECF codebase the first complete
provider implementation along with updates to the ECF core plugin
(version 0.2.0) and API documentation. The new provider
implementation is in the (new) plugin:
org.eclipse.ecf.provider
For access to the new plugin source code see the project set files at
the bottom of the page: http://www.eclipse.org/ecf/downloads.html.
Also see http://www.eclipse.org/ecf/documentation.html for updated API
javadocs.
Below is a brief description of the characteristics of this plugin,
and some example/test code for using it.
Thanks,
Scott
1) It is a full distributed container implementation of the ECF
provider api. For example, it implements the full
ISharedObjectContainer interface, including all the
joinGroup/leaveGroup methods, the event distribution to the
ISharedObjectContainerListeners associated with a container via
addListener, as well as functioning implementations of all the
sharedobject create/add/remove/connect/disconnect container methods.
2) It provides a set of base classes for other provider
implementations (ECF implementations and others). These classes are
in the package org.eclipse.ecf.provider.* in the
org.eclipse.ecf.provider plugin.
3) It is implemented with a very simple TCP-based group protocol, but
structured so that other 'group transport' layers may replace the
simple TCP implementation...while reusing all the container classes
themselves. For example, one next step is to finish implementations
that run upon JMS (activemq), XMPP (smack) and Java Groups. This
should now be an easy thing because the base classes in
org.eclipse.ecf.provider can be easily extended by classes that
implement these or other wire protocols.
4) It is based upon a client-server messaging topology...the server
does message reflection to all the connected clients to provider
publish-and-subscribe message delivery. Both the client and a
trivial-but-completely-functional server are in the
org.eclipse.ecf.provider plugin (In case you are wondering, for the
client in the org.eclipse.ecf.provider.generic.TCPClientSOContainer
and org.eclipse.ecf.provider.generic.TCPServerSOContainer classes).
5) Both the server and client container can run as both a java
application and/or as an Eclipse plugin. What this means is that this
server (in particular) can/could run either on any JRE + OSGI
platform...i.e. as a webapp, as a standalone java application, or
within Eclipse. This provides a good deal of flexibility for ECF
users, in that they can have groups hosted by themselves (just as
Eclipse users), by an app server, or by some other shared server.
6) I generated javadocs for the org.eclipse.ecf.provider plugin and
they are available in the appropriate packages here:
http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/
7) There is now a fair amount of trace code in both the
org.eclipse.ecf and the org.eclispe.ecf.provider plugins. To access
the tracing for these plugins, go to the 'Tracing' tab in the
Run/Debug dialog (when defining a run config for a new RunTime
Workbench) and turn on desired tracing for the org.eclipse.ecf and/or
org.eclipse.ecf.provider plugins.
Here is some example/test code that creates a client instance of this
new provider:
ISharedObjectContainer clients[i] =
SharedObjectContainerFactory.makeSharedObjectContainer("org.eclipse.ecf.provider.generic.ContainerInstantiator");
Here's code for creating a localhost server that listens on port 3282
and has name 'server':
ID serverID =
IDFactory.makeStringID("ecftcp://localhost:3282/server");
Object [] args = new Object [] { new Boolean(false),
serverID };
server =
SharedObjectContainerFactory.makeSharedObjectContainer("org.eclipse.ecf.provider.generic.ContainerInstantiator",args);
Note that neither of these code snippets refers to the provider
classes directly at all (just to the
"org.eclipse.ecf.provider.generic.ContainerInstantiator"). The only
code referenced by such clients is the ECF core code.
There is a small amount of junit test code in the org.eclipse.ecf.test
plugin. See particularly the unit test code in:
ContainerJoinTest
CreateSharedObjectTest
ContainerListenerTest
MultiContainerJoinTest
for examples of doing client-server 'joinGroup/leaveGroup', shared
object creation, removal from container, setting up a container
listener, and a multi-client (i.e. 10 clients joining/leaving a single
server) test.