180 likes | 198 Views
Event Pipeline Pattern. Bina Ramamurthy Amisha Thakkar. Introduction. Event models in ad hoc networks such as Jini , and e-speak are quite narrow with few classes and methods. This is quite appropriate since event management is application-specific in these contexts.
E N D
Event Pipeline Pattern Bina Ramamurthy Amisha Thakkar OOPSLA 2000, Workshop on Jini Patterns
Introduction • Event models in ad hoc networks such as Jini, and e-speak are quite narrow with few classes and methods. • This is quite appropriate since event management is application-specific in these contexts. • Burden is on the applications to manage the events. • Event Pipeline Pattern is intended to aid in event-driven application development. OOPSLA 2000, Workshop on Jini Patterns
Topics of Discussion • Definition • Background (Events) • Context (Distributed Communications) • Examples • Pattern Defined • Pattern Applied • Other Uses • Summary OOPSLA 2000, Workshop on Jini Patterns
Definition • An event pipeline pattern describes how to dynamically construct a stack of event managers, each providing a unique communication capability as desired by a client and/or a server. OOPSLA 2000, Workshop on Jini Patterns
Background • Events are designed to communicate state changes in any objects to those entities that are interested in the state change in that object. • Events are typically asynchronous. • Event generators • Remote events • Remote event listeners • Event managers (Third Party Agent/Delegate) • Notification OOPSLA 2000, Workshop on Jini Patterns
Context • In local client-server systems : in-order delivery, partial failure, and latencies are minimal or do not exist. • In traditional distributed systems these are taken care of by the network protocol. • In Jini, it is the applications responsibility to implement any of the capabilities needed. OOPSLA 2000, Workshop on Jini Patterns
Event Delivery Needs • In-order delivery • Efficient delivery • Store and forward • Reliable delivery • Filtering of events • Grouping of events • Persistent delivery • Event patterns recognition OOPSLA 2000, Workshop on Jini Patterns
Examples We consider a stockbroker’s office • In-order delivery - The stockbroker would like to be notified all stock changes in order. • Efficiency - for some stocks the stockbroker may want information only once a day. • Store and forward - stockbroker may want a mailbox facility,where some of the events are stored and he/she can retrieve them later. • Reliable Delivery - stockbroker does not want to miss out on important tips. OOPSLA 2000, Workshop on Jini Patterns
Examples • Filter- stockbroker may not want information on his bank transactions below $1000. • Grouping of pattern - When analysts’ prediction follow a certain trend only then he may want to be notified. • Persistent Delivery – Follow the stockbroker irrespective of location and deliver events. OOPSLA 2000, Workshop on Jini Patterns
Pipeline Pattern Event Pipeline Event Consumer (target) Event Generator (source) Event Managers OOPSLA 2000, Workshop on Jini Patterns
Sample Event Pipeline Event Generator Event Consumer Event Filter In-Order Delivery Event Grouping OOPSLA 2000, Workshop on Jini Patterns
Pattern Applied • Consider an application that requires events delivered filtered using semantic filter, sequenced by order of generation, and grouped by a semantic type (semantic refers to application-dependency). • Typically lookup service notifies the event client. In this application lookup service feeds into the pipeline. • Code snippets of the event pipeline pattern and its usage are discussed next. OOPSLA 2000, Workshop on Jini Patterns
Definition of Pipeline Stage Class FilterStage extends UnicastRemoteObject implements RemoteEventListener … { public FilterStage() throws RemoteException { } public void notify (RemoteEvent e) { // events get notified thru’ this method } public void deliverToNextStage(RemoteEventListener nextStage) { //next stage is notified from here try { nextStage.notify((RemoteEvent)(filteredEvent)); } catch … } OOPSLA 2000, Workshop on Jini Patterns
Plug in Stages to Build a Pipeline Class EventClient implements RemoteEventListener { //instantiate the stage closest to the client InOrderDeliveryStage iods = new InOrderDeliveryStage(this); GroupingStage gs = new GroupingStage(iods); FilterStage fs = new FilterStage(gs); // connect event source to the first stage so that events are //delivered to the first stage : Source is lookup in this case EventRegistration erg = lookup.register(…,fs); } OOPSLA 2000, Workshop on Jini Patterns
Associated Support Functions • Leasing • Registration • Notification • Generation • Consumption OOPSLA 2000, Workshop on Jini Patterns
Uses • Jini as we have already spoken about it • Wireless Network : WiARS Architecture, our main research which bridges Jini networks and wireless networks lead us to “mine” event pipeline pattern. • Mobile Network • Device Network • Appliance Network OOPSLA 2000, Workshop on Jini Patterns
References • E. Gamma, R. Helm, R. Johnson, J. Vlissides: Design Patterns - Elements Of Reusable Object-Oriented Software, Addison Wesley, 1995 • C. Hortmann, G. Cornell: Core Java, Sun Microsystems Press, 1999 • W. Keith Edwards: Core Jini, Sun Microsystems Press, 1999 • G. Coulouris, J. Dollimore, T. Kindberg: Distributed Systems - Concepts and Design, Addison-Wesley, 1994 • Jan Newmarch, Jan Newmarch's Guide to JINI Technology, http://pandonia.canberra.edu.au/java/jini/tutorial/Jini.xml OOPSLA 2000, Workshop on Jini Patterns
Summary • Main contribution of this work is a realization of a systematic way to manage event in light-weight networks. • We plan to evaluate the trade-offs in using the pipeline versus the traditional event handling methods. • Application of event pipeline pattern (or pipeline pattern) in other networking environments will be explored. OOPSLA 2000, Workshop on Jini Patterns