Download presentation
Presentation is loading. Please wait.
Published byCharity Fletcher Modified over 8 years ago
1
OOMI Callbacks
2
Slide 2 of 11 © Ingeniørhøjskolen i Århus Outline Motivation –Using TTS as example CORBA Callbacks Issues & solutions Alternative solutions
3
Slide 3 of 11 © Ingeniørhøjskolen i Århus Data Collection & Presentation Server TRS CORBA Object New Reading DB PSP View Readings Classic CORBA Client / Sever model is sufficient for Data Collection & Presentation
4
Slide 4 of 11 © Ingeniørhøjskolen i Århus Alarm level surveillance Server (TRS) TRS CORBA Object New Reading DB PSP View Readings Problem: The client / server pattern breaks down when we want to notify FROM the server to the client. Solution: Client polling OR peer-to-peer model -> e.g. using Callbacks Present Alarm
5
Slide 5 of 11 © Ingeniørhøjskolen i Århus CORBA Callbacks CORBA specification: –ORB is BOTH client AND server channel –Peer-to-peer architecture –All client programs may register server objects - e.g. Callback object –How-to: TTS: RegisterCallback(ObjRef) -> list of PSP’s PSP: Notify() Callback object should be transient only
6
Slide 6 of 11 © Ingeniørhøjskolen i Århus Issues Distributed Deadlock –If client and server single-threaded –Client calls server, server calls client at same time –Deadlock – both are blocked, waiting for a response –OB: recommends thread-per-request semantics Solutions: –Do not make single-threaded applications Problem: not all OS’s support multithreading Inconvenience : multithreading introduces new complexities –OR use “oneway” semantics Problem with oneway: –“Maybe” semantics, no return value, no exceptions –Some ORB’s ignores “oneway” and performs a regular synchronized call – but this can be tested –Check ORB vendor manual for recommendations!
7
Slide 7 of 11 © Ingeniørhøjskolen i Århus Other issues (Henning & Vinoski) Callback Persistence –Server should store registered callbacks on persistent storage in case of server failure Callback Failure –As callback objects are transient, server should employ a “timeout” strategy for callback communication Coupling –Callback objects comes at a price of higher coupling
8
Slide 8 of 11 © Ingeniørhøjskolen i Århus Alternative solutions Event Service –Suppliers produces events, consumers receives them through an event channel –Push or Pull model –Decouples using Mediator pattern & asynchronous communication, and exchanging “Any values” –Read more in OOMI-3: chapter 12 Notifcation Service –Extends the Event Service –Allows the use of well-defined data structures –http://www.borland.com/resources/en/pdf/white_p apers/borland_notification_service_visinotify.pdfhttp://www.borland.com/resources/en/pdf/white_p apers/borland_notification_service_visinotify.pdf
9
Slide 9 of 11 © Ingeniørhøjskolen i Århus Good support for the Event Service & Notifcation Service Source: http://www.puder.org/corba/matrix/
10
Slide 10 of 11 © Ingeniørhøjskolen i Århus Group Assignment Use the rest of todays lesson for group work Each Group Should: –Make a pseudo code implementation of a multi-client GPS location system, where each client logs its current location with a “configurable interval”, records it with a single CORBA servant, including its own ID and the “current interval setting” and the local time of the device, while at the same time keeping up to date with the other clients current GPS position utilizing callbacks –Consider which patterns might be helpful? –Consider what might happen if you implement an xml file on the server for storage. What might go wrong? –Discuss how your system might deadlock – and discuss what you could do about it
11
Slide 11 of 11 © Ingeniørhøjskolen i Århus Group Assignment 2 Now consider how we might optimize performance, in the case of some clients being located within the same WiFi LAN area, but the server is only available via WAN. Consider also that different groups of clients might be within different WiFi LANs. At home: –try to implement a sample CORBA system (e.g. the above) that will deadlock at some point in time (and explain why) –Implement a fix to the above CORBA system that will solve the deadlock – and explain why
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.