Background The goal of the ECF project, most simply, is to provide a cross-protocol API. ECF creates value for four constituencies: Communications providers Who -- Plug-in developers implementing new and existing communication providers (Yahoo, AIM, etc.) for Eclipse-based applications and plug-ins.Value -- Interoperability. Developers and users can allow their applications to work together in and across protocols. Component developers Who -- Plug-in developers implementing generic component-level features (file sharing or whiteboard sharing, for example). Value -- Reusability. Application designers now can reuse components as long as the provider implementation supports it. Tool integrators Who -- Plug-in developers who integrate existing applications with ECF technology to add new value. A good example would be adding collaboration support to a graphical editor. Value -- Feature enrichment. Developers can breathe new life into their applications via ECF. User interface (UI) developers Who -- Plug-in developers who build or integrate user interfaces. ECF provides the bare bones, so you can provide your own UIs for chat rooms, file sharing, etc. Value -- Usability. UIs can be improved and customized independent of underlying implementation, at design or even integration. ECF aims to meet this goal by providing a set of high-level abstractions, rather than yet another messaging API. This design choice empowers you to reuse high-level communications components (instant messaging, file sharing, video conferencing, etc.) in varying application contexts and UIs. Imagine developing an application that requires instant messaging, blogging, BitTorrent, file sharing, and voice conferencing. With ECF, development can be expedited over all the communication code for each of those services, allowing you to focus on business logic and UIs. Installing ECF ECF is installed as a set of Eclipse plug-ins, via the standard plug-in installation processes: The ECF project also hosts a server containing extra providers and application examples (IRC, JMS, etc.): ECF eye candy We believe that eye candy is essential to the success of any article (must keep readers interested). Figure 1 shows the sample ECF IRC provider demonstrating some of the chat-room capabilities of the framework. Figure 2 shows the sample buddy list view with two messaging connections. Figure 1. ECF IRC provider
Figure 2. ECF buddy list view
Now that you have seen what ECF looks like, we can discuss the finer details. ECF adapters The first step in understanding how ECF works is to take a quick look at its APIs, particularly adapters. In ECF, the fundamental building blocks are the communication containers of instance IContainer. IContainer instances provide a common interface for communication within ECF. It can represent an instance of a communication context, be it of a client-server or publish-subscribe communication model. IContainer is an important interface within ECF, and the extensibility it provides via the familiar Eclipse IAdaptable interface is crucial. Since ECF containers support runtime extensibility by being IAdaptable, you can query runtime instances about their capabilities and act on them. Examples of capabilities in the context of ECF are presence/chat, chat rooms, etc. The table below lists common capabilities found in ECF. Common ECF capabilitiesIPresenceContainerExposes the capability of setting up listeners for presence messages (away,available,etc...), text messages, subscription requests. A good implementation of this interface would be any chat messaging protocol (Yahoo, AIM, Gadu Gadu, etc.). ISharedObjectContainer Exposes the capability to build arbitrary communication protocols by providing the power to pass arbitrary information around. IDiscoveryContainer Exposes the capability to support look-up and discovery facilities (computers, devices and services on IP networks). Apple's Bonjour is a good example of a possible implementer of this adapter. IChatRoomManager Exposes the capability to support chat rooms within ECF. Example implementations of this interface are protocols that support chat rooms (Yahoo, XMPP, IRC, etc.). As ECF matures, these adapters will be refined and new ones will be added. ECF example We will play the role of a communications provider, particularly, with the Yahoo! messaging protocol (YMSG). We will use an open source implementation of the protocol, jYMSG. This article includes a basic ECF implementation of the YMSG protocol through an ECF presence container (IPresenceContainer). We will outline the steps taken to implement this and have made the final code available for download. (Note that this code will most likely end up being contributed to the ECF project.) The steps involved in implementing a presence container for YMSG are as follows: (责任编辑:JavaVideo) |


