Real-Time Middleware
Total Page:16
File Type:pdf, Size:1020Kb
Design Patterns and Component Framework for Building RTSJ-Based Real-Time Middleware Mohammed Fathi Alrahmawy PhD The University of York Computer Science Department YORK, UK September 2010 Abstract The middleware is a software layer located on top of the operating system that uses its facilities, integrates with it, and extends its functionality in order to support the development of effective and reliable distributed systems; however, the architectures of most of the conventional middleware solutions, e.g. Java RMI, do not either offer the predictability required to support the real-time behaviour in these systems, or the reconfigurablity required for these middleware solutions to be applicable in a wide range of distributed systems. Java has a great support for building distributed systems; however, due to its unpredictability, Java does not support building distributed real-time systems and middleware solutions. Hence, this thesis argues that the RTSJ can be used to build reusable and reconfigurable software components and design patterns that have high levels of predictability and reliability. These proposed real-time components and design patterns can be used for building real-time middleware solutions in Java. Therefore, the RTSJ has to be used as a base for modifying the existing reconfigurable and reusable software patterns and components for distribution models. It could also be used to create a new set of these patterns and components, in order to support the real-time behaviour and the predictability in the real-time middleware. The key contributions in this thesis include the presentation of a component framework design model for building RTSJ-based middleware and distributed systems; this framework focuses mainly on the memory model, the communication model of building the components and it also provides the management mechanism of these components, which uses a set of design patterns that integrates with these models. This includes a memory model for the RTSJ components associated with a set of reusability and life-management sub-components that support building real-time components in the RTSJ. Also, we provided a design of a real-time reconfigurable communication component based on the RTSJ that can be used to support predictable low level remote communications in distributed real-time Java applications and we showed how this component could be integrated within the component model as a sub-component, to provide communication services within the component model. Also, we presented our own model of integrating both the framework and the component model within the RMI architecture to provide a reconfigurable real-time Java RMI middleware based on the RTSJ. Table of Contents Abstract ............................................................................................................... Chapter 1 .......................................................................................................... 1 1.1 Overview of Distributed Real-Time Systems ..................................... 3 1.1.1 Definitions of Real-Time Systems ................................................. 4 1.1.2 Classification of Real-Time Systems ............................................. 5 1.1.3 Definition of Distributed Real-Time Systems ................................ 7 1.2 Overview of Real-time Middleware .................................................... 8 1.2.1 Definition of Middleware ............................................................... 8 1.2.2 Middleware Characteristics ............................................................ 9 1.2.3 Middleware Classifications .......................................................... 10 1.3 Motivations and Research Scope ...................................................... 13 1.4 Thesis Goals, Hypothesis and Contribution ...................................... 15 1.5 Thesis Structure ................................................................................. 17 1.6 Summary ........................................................................................... 20 Chapter 2 ........................................................................................................ 21 2.1 Message Passing Paradigm ............................................................... 22 2.2 The Client Server Paradigm .............................................................. 26 2.3 The Peer-to-Peer Paradigm ............................................................... 27 2.4 The Message System Paradigm ......................................................... 30 2.5 Remote Procedure Call Paradigm (RPC) .......................................... 34 2.6 The Distributed Object Paradigms .................................................... 34 2.6.1 Remote Method Invocation (RMI) ............................................... 35 2.6.2 The Network Service Paradigm ................................................... 35 2.6.3 The Object Request Broker Paradigm (ORB) .............................. 36 2.7 Component Oriented Architecture (COA) Paradigm ........................ 36 2.8 The Application Server Paradigm ..................................................... 37 2.9 The Tuple Space (Object Space) Paradigm ....................................... 38 2.10 The Collaborative Application (Groupware) Paradigm .................... 41 2.11 Summary ........................................................................................... 42 Chapter 3 ........................................................................................................ 45 3.1 Java and Real-Time systems ............................................................. 45 3.2 Overview of Java RMI System Architecture..................................... 48 3.2.1 RMI Layers .................................................................................. 49 3.2.2 RMI Distributed Garbage Collection (DGC) ............................... 51 3.3 RMI Framework Implementation ...................................................... 52 3.3.1 RMI Client Implementation ......................................................... 52 3.3.2 RMI Server Implementation ......................................................... 53 3.4 Problems and Requirements of RMI in RT Systems ......................... 55 3.4.1 Java and JVM Requirements ........................................................ 55 3.4.2 RTSJ Support................................................................................ 57 3.4.3 RMI Tools .................................................................................... 58 3.4.4 RMI programming model ............................................................. 58 3.4.5 RMI Implementation .................................................................... 60 3.5 Levels of Integrating RTSJ and RMI................................................. 62 3.5.1 Level-0 Integration: Minimal Integration ..................................... 63 3.5.2 Level-1 Integration: Real-Time RMI ........................................... 63 3.5.3 Level-2 Integration: Distributed Real time threads ...................... 64 3.6 RT-RMI (Level-1) Models ................................................................ 68 3.6.1 Adaptations in the RMI-HRT ....................................................... 69 3.6.2 Adaptations in the RMI-QoS ........................................................ 72 3.7 RT-CORBA ....................................................................................... 75 3.7.1 RT-CORBA Features ................................................................... 75 3.7.2 RT-CORBA and the RTSJ ........................................................... 76 3.8 Summary ............................................................................................ 79 Chapter 4 ......................................................................................................... 81 4.1 Real-time Java ................................................................................... 81 4.2 Real-time Java Enhancements ........................................................... 82 4.2.1 Threads and Scheduling ............................................................... 82 4.2.2 Memory Management in the RTSJ ............................................... 84 4.3 Component Based Software Engineering .......................................... 90 4.3.1 Component Definition .................................................................. 91 4.3.2 Characteristics of the Components ............................................... 92 4.3.3 Disadvantages of Components ..................................................... 93 4.3.4 Basics of Component Based Systems ........................................... 94 4.3.5 Components in Real-time Systems ............................................... 97 4.3.6 Components Models in Java for Distributed Systems ................ 101 As we mentioned in the last chapters, Java language supports middleware for distributed systems mainly in Java RMI and CORBA. The component technology found its way in these two middleware solutions, to support components in distributed systems. There are mainly two component models built over these two middleware solutions. These two models are: ............................................... 101 4.3.7 Components in Real–time Java .................................................. 101 4.4 Software Patterns ............................................................................. 103 4.4.1 Definition of the Software Pattern