460 likes | 842 Views
University of Pisa. Experimenting Event Notification in Web Service Composition. Daniele Strollo (IMT Lucca) Roberto Guanciale (IMT Lucca) Dagstuhl Feb 2007. Car repair specification: SAGA. <<saga>> CarRepair. ChargeCreditCard. RevokeCharge. OrderGarage. CancelGarage. <<saga>>
E N D
University of Pisa Experimenting Event Notification in Web Service Composition Daniele Strollo (IMT Lucca) Roberto Guanciale (IMT Lucca) Dagstuhl Feb 2007
Car repair specification: SAGA <<saga>> CarRepair ChargeCreditCard RevokeCharge OrderGarage CancelGarage <<saga>> CarRental OrderTowTruck OrderRentalCar RedirectRentalCar CancelTowTruck
Car repair specification: SAGA <<saga>> CarRepair ChargeCreditCard RevokeCharge OrderGarage CancelGarage <<saga>> CarRental OrderTowTruck OrderRentalCar RedirectRentalCar CancelTowTruck
Car repair specification: SAGA <<saga>> CarRepair ChargeCreditCard RevokeCharge OrderGarage CancelGarage <<saga>> CarRental OrderTowTruck OrderRentalCar RedirectRentalCar CancelTowTruck
Car repair specification: SAGA <<saga>> CarRepair ChargeCreditCard RevokeCharge OrderGarage CancelGarage <<saga>> CarRental OrderTowTruck OrderRentalCar RedirectRentalCar CancelTowTruck
Car repair specification: SAGA AtomicComponent credit = factory.createAtomicComponent( creditUrl, new ChargeCreditCard(), new RevokeCredit() ); ChargeCreditCard RevokeCharge
Car repair specification: SAGA AtomicComponent garage = factory.createAtomicComponent( garageUrl, new OrderGarage(), new CancelGarage() ); . . . ChargeCreditCard RevokeCharge OrderGarage CancelGarage OrderTowTruck OrderRentalCar RedirectRentalCar CancelTowTruck
Car repair specification: SAGA Saga carRental = factory.createSaga(rentalUrl); carRental.addInternalComponent(orderRentalUrl); ChargeCreditCard RevokeCharge OrderGarage CancelGarage <<saga>> CarRental OrderTowTruck OrderRentalCar RedirectRentalCar CancelTowTruck
Car repair specification: SAGA TransactionalParallel par = factory.createParallel(parallelUrl); par.addInternalComponent(truckUrl); par.addInternalComponent(rentalUrl); ChargeCreditCard RevokeCharge OrderGarage CancelGarage <<saga>> CarRental OrderTowTruck OrderRentalCar RedirectRentalCar CancelTowTruck
Car repair specification: SAGA <<saga>> CarRepair ChargeCreditCard RevokeCharge OrderGarage CancelGarage <<saga>> CarRental OrderTowTruck OrderRentalCar RedirectRentalCar CancelTowTruck Saga saga = factory.createSaga(sagaUrl); TransactionalSequence seq = factory.createSequence(sequenceUrl); seq.addInternalComponent(creditUrl); seq.addInternalComponent(garageUrl); seq.addInternalComponent(parallelUrl); saga.addInternalComponent(sequenceUrl);
The lower layer Signal Calculus (SC) • Middleware: collection of Java APIs implementing the SC primitives. • lowerlayer for describing coordination logics on services • Specialized to implement Long Running Transactions Programming Model • Event Notification paradigm • common programming paradigm to model service coordination • distribute the coordination tasks among involved services (choreography) • dynamic interface publication • dynamic topology of service connections • Process Calculus with asynchronouscommunication facilities • Event topics to describe coordinationpolicies Java Signal Core Layer (JSCL)
The main concepts: components R a F • Is uniquely identified by a name. • A component: Component Name
The main concepts: components R a F • Declares event topics for which it is interested to have notifications • The reactions define a binding among signals of a well defined topic to an handling task to execute internally upon a new notification receptionv • A component: • Is uniquely identified by a name. Reaction
The main concepts: components R a F • Declares event topics for which it is interested to have notifications • The reactions define a binding among signals of a well defined topic to an handling task to execute internally upon a new notification reception • A component: • Is uniquely identified by a name. • Defines its outgoing connections through the “Flow” structureF. • The connections among components are realized through signal links, which are tuples of the form (topic, emitter, handler). • F stores all the signal links having a as emitter. Flow
The main concepts: signal emission R a F • Signal Calculus Primitives: • Signal emission • notifies the occurrence of an event • events are classified into schemata identified by their name 1, 2 • signals are uniquely identified by their name s s:
The main concepts: reaction update R a B F • Signal Calculus Primitives: • Signal emission • Reaction Update • adds a new reaction to the component interface • checks the well-formeness of the resulting reaction • defines the behavior “B” to activate at the reception of signals of schema , and the variable binding +
The main concepts: flow update R a F b • Signal Calculus Primitives: • Signal emission • Reaction Update • Flow Update • adds a new outgoing connections to the component • defines the set of component names to which deliver signals of schema • checks the well-formeness of the resulting flow
The main concepts: networks • Signal Calculus Primitives: • Signal emission • Reaction Update • Flow Update • Network • describes the component distribution • carries envelopes containing signals exchanged among components s: Signal envelop Reaction enabled
JSCL – Architectural overview Inter-Object Communication Layers FGS@FORTE06
IOCL primitives • Each IOCL implements: • the data serialization (e.g. SOAP message envelops for WSs, etc.) and the deployment phase (e.g. stub generation, dynamic proxy binding, etc.). • Moreover each IOCL plugin defines the way components are identified by extending the basic interface ComponentAddress. iocl instantiation IOCLPluginLoader loader = new IOCLPluginLoader( new IOCLAddress ("jscl.core.IOCL.XSoap.IOCLImpl")); IOCLPluginI iocl = loader.getIOCLInstance(); iocl.startup(ioclPort);
IOCL primitives • Each IOCL implements: • the data serialization (e.g. SOAP message envelops for WSs, etc.) and the deployment phase (e.g. stub generation, dynamic proxy binding, etc.). • Moreover each IOCL plugin defines the way components are identified by extending the basic interface ComponentAddress. Component creation // Instantiate a component address = new ServiceAddress ("http://jscl.org:10190/services/Hotel"); component = iocl.createComponent(address); // Publication iocl.registerComponent(address, component);
IOCL primitives • Each IOCL implements: • the data serialization (e.g. SOAP message envelops for WSs, etc.) and the deployment phase (e.g. stub generation, dynamic proxy binding, etc.). • Moreover each IOCL plugin defines the way components are identified by extending the basic interface ComponentAddress. Flow update iocl.createLink(1001, HotelAddress, CarAddress, null);
JSCL primitives • Each JSCL component can: • Declare its reactions • The handling task implements the virtual method • handleSignal (Signal signal) Reaction update component.addReaction (new Reaction (sigT, handlingTask));
JSCL primitives • Each JSCL component can: • Declare its reactions • The handling task implements the virtual method • handleSignal (Signal signal) • Raise an event Signal emission component.emitSignal (new Signal (sigT, data));
Part II How to design JSCL components in Eclipse
Implementation in JSCL Inv Inv Rb • JTWS (BMMFST@WSFM05) • Transactional composition of WSs. • Fixed set of Signal Schemata: • Well defined semantics of components • Structural composition (parallel and sequential) A Successful execution of A Unsuccessful execution of A Executes main activity A B Atomic Component definition AtomicComponent (ComponentAddress addr, AtomicTask A, AtomicTask B) Request for abort. Executes B. Compensation successful executed Compensation failure
Implementation in JSCL Rb Rb Exc • JTWS (BMMFST@wsfm’05) • Transactional composition of WSs. • Fixed set of Signal Schemata: • Well defined semantics of components • Structural composition (parallel and sequential) A B Compensation successful executed Request for abort. Executes B. Compensation failure Atomic Component definition AtomicComponent (ComponentAddress addr, AtomicTask A, AtomicTask B)
sequence Inv P Q Sequence sequence.addInternalComponent (AtomicComponent comp) In Out oCt iCt oRb iRb oEx iEx
sequence Inv P Q In Out A oCt iCt oRb iRb oEx iEx
sequence Inv P Q In Out A oCt iCt oRb iRb oEx iEx
sequence Inv P Q In Out oCt iCt oRb iRb oEx iEx
sequence P Q Rb In Out oCt iCt B oRb iRb oEx iEx
sequence P Q Rb In Out oCt iCt B oRb iRb oEx iEx
sequence P Q Rb In Out oCt iCt oRb iRb oEx iEx
parallel In Out Inv Inv oCt iCt oRb iRb oEx iEx Par (P, Q) ´ P|Q Dispatcher P Q Collector Status = (-,-)
parallel In Out Inv oCt iCt oRb iRb oEx iEx Dispatcher A P A Q Collector Status = (---,---)
parallel In Out Inv oCt iCt oRb iRb oEx iEx Dispatcher A P A Q Collector Status = (Inv,---)
parallel In Out Inv oCt iCt oRb iRb oEx iEx Dispatcher A P A Q Collector Status = (Inv,Inv)
Part III Concluding remarks
JSCL/SC: concluding remarks • Main features: • Basic framework for programming/modeling coordination. • Abstraction from the networkoverlay • Logicalports permit a simple design of the flow diagrams. • The connections (and interfaces) can be dinamically modified. • Session management • Nocentralization • BPEL orchestrations can be mapped and executed in SC/JSCL (straighforward coding)
Future works • JSCL and SC programming model • UML front-end to design SOA • Theoretical based verification tool • SC: • Dynamic type system to model: • Choreographies • SLA • Programming environment • IOCL plugins based on model transformation • Eclipse plugin extensions: • Nested Orchestrations in order to reuse services in several diagrams. • Automatic deploy of the services • Debugger and profiler integration