| Recent years, with the rapid development of software technology, software component technology has become a trend in software engineering. OSGi (Open Service Gateway Initiative) as a specification of realizing service-oriented components, providing a lightweight service-oriented, component-based environment, and a standard mechanism to manage life cycle of software, is widely used in fields of pervasive computing and Internetware.R-OSGi, as a distributed extension of OSGi, solves the remote calls between service -oriented components in distributed environment through dynamically generating service proxies and distributed service registered mechanism based on SLP (Service Location Protocol). After researching the fault-tolerant mechanism of R-OSGi, R-OSGi, be founded, can not deal with the exceptions in the situation of network volatility and persistent fault of service components. Hance, this paper presents a solution of fault tolerance in distributed OSGi (FT-OSGi) based on R-OSGi, combined with the related technologies of R-OSGi and distributed fault-tolerant middleware.In the FT-OSGi Framework, this paper first describes that FT-OSGi acquires exception messages by the way of intercepting R-OSGi messages through FT-OSGi architecture, emphasizes loose coupling between FT-OSGi and R-OSGi and transparency in the development of service components, and designs the FT-OSGi component architecture with two mechanisms(Interceptor & Sender mechanism, Configurer mechanism) and three core components(Replication Manager, Failure Detector, Strategy Selector), in which the Configurer mechanism makes the application developer could configure the bottom -level fault tolerance messages,improving the flexibility of fault tolerance. Then,the function of FT-OSGi's components and its internal workflow are described, including the definition the conditions and rules among components, in which one core component, Replication Manager, is composed of Config Getter , Send Judger, Exception Capturer and Exception Saver which complete with each other managing and maintaining these messages in Replication Manager.In the design and implementation of FT-OSGi, this paper first describes the design framework of FT-OSGi, details the definition of 11 interfaces in FT-OSGi , the initialization process of these interfaces and the implementation process of methods defined, in which the relationship among the call of five interface designed in Replication Manager are mainly described. After the implementation, FT-OSGi could tolerant these faults in the situation of network volatility, persistent fault of service components and R-OSGi in the remote call of service components, and enlarge OSGi's effectiveness. |