Tu sca ny 1 The Tuscany Java Recursive Core: Architecture Update 5 June 2006.

Slides:



Advertisements
Similar presentations
A DAPT IST Replication Framework: Progress Report Vance Maverick University of Bologna Dec. 11, 2003.
Advertisements

Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
Tu sca ny 1 Simplifying Service Oriented Applications with The Apache Tuscany project Jeremy Boynes 27 July 2006.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns VI Composite, Iterator, and Visitor Patterns.
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
Apache Chemistry face-to-face meeting April 2010.
INTRODUCING SCA Byungwook Cho Nov.2007.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
Introducing Axis2 Eran Chinthaka. Agenda  Introduction and Motivation  The “big picture”  Key Features of Axis2 High Performance XML Processing Model.
ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:
© 2007 by «Author»; made available under the EPL v1.0 | Date | Other Information, if necessary Eclipse SOA Tools Platform Project Eric Newcomer IONA Technologies.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 10: Service Component Architecture.
Parsley Introduction Kui Huang Oct. 13, Topics Background Dependency Injection Object Lifecycle Message Bus Sample FW Extensions.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
Spring core v3.x Prepared by: Nhan Le. History v3.0 Spring Expression Language Java based bean metadata v3.1 Cache Abstraction Bean Definition Profile.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter.
CHEF II / Sakai Architecture. CHEF II Changes uPortal replaces Jetspeed –jsr 168 portlet, servlet compliant Spring replaces Turbine component framework.
Tuscany 2.x Extensibility and SPIs Raymond Feng. Tuscany Extensibility Cx2x/Tuscany+2.x+Extensibility+and+SPIs#extensions.
Tu sca ny 1 Extending The Tuscany Java SCA Runtime 21 August 2006.
Component frameworks Roy Kensmil. Historical trens in software development. ABSTRACT INTERACTIONS COMPONENT BUS COMPONENT GLUE THIRD-PARTY BINDING.
Webservice versioning using osgi Allard Buijze, Jettro Coenradie.
Apache Synapse The small print
Slide 1 Extending Tuscany Raymond Feng Apache Tuscany committer.
Andrew S. Budarevsky Adaptive Application Data Management Overview.
SCALABLE EVOLUTION OF HIGHLY AVAILABLE SYSTEMS BY ABHISHEK ASOKAN 8/6/2004.
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
Client Call Back Client Call Back is useful for multiple clients to keep up to date about changes on the server Example: One auction server and several.
18 April 2005CSci 210 Spring Design Patterns 1 CSci 210.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Tuscany: a SOA framework Jeffrey Guo Accelrys, Inc.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
Tu sca ny 1 The Tuscany Java SCA Runtime 20 August 2006.
SCA Bindings Simon Holdsworth Piotr Przybylski. Agenda n SCA Bindings Overview l Bindings TC Charter n Bindings l Web Services Binding l JMS Binding l.
Tuscany Runtime Architecture. Contents Overview An example Bootstrap kernel Process of composite application.
Tu sca ny 1 The Tuscany Project in the Apache Incubator and The Service Component Architecture Jeremy Boynes Simon Nash 28 June 2006.
Dynamic and Selective Combination of Extension in Component-based Applications Eddy Truyen, Bart Vanhaute, Wouter Joosen, Pierre Verbaeten, Bo N. Jørgensen.
Eric Tryon Brian Clark Christopher McKeowen. System Architecture The architecture can be broken down to three different basic layers Stub/skeleton layer.
Axis2 - Overview. Agenda  What is already there Overall Architecture Core AXIOM WSDL Deployment Client API  What is yet to come Encoding – Pluggable.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
Slide 1 Extending Tuscany Raymond Feng Apache Tuscany committer.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Slide 1 Extending Tuscany Raymond Feng Apache Tuscany committer.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Service Component Architecture (SCA) Policy TC … Face to Face Agenda – Jan 24,
REST By: Vishwanath Vineet.
Bulding a Modular Application with Coherence David Whitmarsh Independent Contractor Technical Architect Investment Banks
SCA and Java n SCA provides support for multiple Java-based component implementation types l Java POJOs (implementation.java) l Spring Beans (implementation.spring)
Advanced Object-oriented Design Patterns Creational Design Patterns.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Module 9. Dealing with Generalization Course: Refactoring.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Java Servlets By: Tejashri Udavant..
Overall Architecture and Component Model
Node.js Express Web Services
Tuscany Java SCA Architecture
Magento Technical Guidelines Eugene Shakhsuvarov, Software Magento
Presented by Jinpeng Zhou
Ashish Pandit IT Architect, Middleware & Integration Services
Apache Tuscany Demo BigBank Example
Objectives In this lesson you will learn about: Need for servlets
Message Passing Systems Version 2
OPeNDAP/Hyrax Interfaces
Message Passing Systems
Presentation transcript:

tu sca ny 1 The Tuscany Java Recursive Core: Architecture Update 5 June 2006

tu sca ny 2 Agenda Spec Update Core Update Extending the Runtime

tu sca ny 3 Agenda Spec Update Core Update Extending the Runtime

tu sca ny 4 Simplify Composition Reduce the number of SCA concepts Yet adds additional capabilities Modules become Composites Composites are a compound Component Type Entry Point eliminated, Service provides same function External Service eliminated, Reference provides same function Component Type Properties ServicesReferences

tu sca ny 5 Recursive Composition A Composite can become the implementation of a component The component’s services, references and properties are those of the composite that is used as its implementation. Nestable to any level...

tu sca ny 6 Complex Property Types Property types can now be any XML complex type Before they were simple types represented by a string “type” attribute contains QName of complex type Body of element contains default value value inner value

tu sca ny 7 Setting Component Property Values concept has been removed Value can be derived from content of element: Or, can be the result of an XPath expression value inner value value inner value

tu sca ny 8 Composite Inclusion Module Fragments have been removed Replaced by a SCA-specific include mechanism XInclude was rejected due to complexity of XPointer Alternative still being defined Work in progress on subsystem concept Some form of open composite Tied into deployment concepts

tu sca ny 9 Packaging Structures No specification yet of a packaging format for a composite We need to do something in Tuscany OSGi bundle format looks promising

tu sca ny 10 Agenda Spec Update Core Update Overview Atomic Components Wires Composites The Component Tree Deployment Loading Building Bootstrap Extending the Runtime

tu sca ny 11 Overview SCA recursion as well experience with M1 led us to the conclusion that the existing core architecture needed substantial refactoring Overall brittleness The $10,000,000 question: Which classloader is active at any given point? Component type loading Model initialization and walking Wiring and proxy generation Deprecated methods and use throughout the runtime Parts of the core were baroque Artifact registration Context factories, builders, invokers Model decoration Mixing of behavior and model No clear separation of concerns No SPI demarcation Model bleeds into runtime Core development cycle too long Develop-build-test-deploy cycle was painful Implementing recursion with the existing architecture would not simplify Most importantly, things could be easier and simpler…

tu sca ny 12 Atomic Component AtomicComponent: the most basic component form Corresponds to the spec concept Offers services, has references and properties Implementations deal with the specifics of a type, e.g. Java, XSLT, etc. Has implementation instances Has inbound and outbound wires Outbound wireInbound wire Properties

tu sca ny 13 Atomic Component Instance Management Atomic components use a ScopeContainer to manage implementation instances Module, HTTP Session, Request, Stateless ScopeContainers track implementation instances by scope id and the AtomicComponent instance identity Instances are stored in an InstanceWrapper which is specific to the component implementation type (e.g. PojoInstanceWrapper.java) ScopeContainer AtomicComponent Collection of instance wrappers keyed by scope id and collection keyed by AtomicComponent

tu sca ny 14 Component Implementation Instance Creation ScopeContainer getInstance(this) no instance cached createInstance return instance track and enqueue instance (for destruction) return instance AtomicComponent Instantiate and inject the instance (which will recurse for dependents)

tu sca ny 15 Wires: RuntimeWire Corresponds to the specification term wire Responsible for flowing an invocation to a target Components (atomic and composite) have 0..n wires Two sides InboundWire - handles the source side of a wire, including policy OutboundWire - handles the target side of a wire, including policy The runtime connects inbound and outbound wires, performing optimizations if possible Inbound and outbound wires may be associated with different service contracts Different implementation types “Standard” wires contain invocation chains that have Interceptors and MessageHandlers that perform some form of mediation (e.g. policy) Other wire types exist that, for example, do not perform mediations Outbound wireInbound wire

tu sca ny 16 Invocation Chains A wire has an InvocationChain per service operation An InvocationChain may have Interceptors - “Around-style” mediation One-way MessageHandlers Component implementation instances access a wire through a WireInvocationHandler associated with a reference WireInvocationHandlers may (or may not depending on the component type) be fronted by a proxy WireInvocationHandlers dispatch an invocation to the correct chain A wire has a TargetInvoker that is created from the target side AtomicComponent or Reference and is stored on the source wire invocation handler. The TargetInvoker is resposnible for dispatching the request to the target instance when the message hits the end of the target invocation chain. Invocation chains

tu sca ny 17 Invocation Overview An invocation is dispatched to the WireInvocationHandler The WireInvocationHandler looks up the correct InvocationChain It then creates a message, sets the payload, sets the TargetInvoker, and passes the message down the chain When the message reaches the end of the chain, the TargetInvoker is called, which in turn is responsible for dispatching to the target Having the TargetInvoker stored on the outbound side allows it to cache the target instance when the wire source has a scope of equal or lesser value than the target (e.g. request-->module) WireInvocationHandler Invocation TargetInvoker associated with the operation Payload Dispatch on target

tu sca ny 18 Wires and Implementation Instances The runtime provides components with InboundWires and OutboundWires InvocationChains are held in component wires and are therefore stateless Allows for dynamic behavior such as introduction of new interceptors or re-wiring WireInvocationHandler Implementation instance Proxy Outboundwire held by component InboundWire associated with a service and held by component TargetInvoker may need to resolve the target instance. This may be done by referencing the ScopeContainer

tu sca ny 19 Invocation Detail Outbound Interceptor Chain TargetInvoker Outbound Request Channel 1 Inbound Request Channel Request 2 Inbound Response Channel Outbound Response Channel 6 7 Response RequestResponseInterceptor (RRI) dispatches to the outbound request channel (OReqC) 2.RRI dispatches to the inbound request channel (IReqC) 3.MessageDispatcher dispatches to the inbound interceptor chain 4.TargetInvokerInterceptor pulls the TargetInvoker from the message and dispatches to it 5.TargetInvoker dispatches to the target (implementation instance or to some transport) 6.RRI dispatches to the inbound response channel (IRespC) 7.RRI dispatches to the outbound response channel (ORespC) 8.The response is returned back up the outbound channel to the client Inbound Interceptor Chain Note the runtime may optimize invocations not to call interceptors or handlers and possibly dispatch directly to a target (or any combination thereof)

tu sca ny 20 Composite Component CompositeComponent: a component which contains child components Corresponds to the spec concept Offers services, has references over bindings Has properties Has inbound and outbound wires associated with Services and References Implementations deal with the specifics of a type, e.g. Spring Reference Service Properties

tu sca ny 21 A Composite Example Expose a Spring Bean through a service with a SOAP/HTTP binding and using a reference bound over SOAP/JMS Spring application.xml does not need to be modified Preserves Spring programming model Allows existing Spring applications to be wired in an assembly Services and references are contributed by SCA bindings (e.g. Celtix) Reference Service SpringCompositeComponent Spring Bean

tu sca ny 22 Composite Wiring Services and references are “twist-ties” for inbound and outbound wires Services have connected InboundWire/ OutboundWire pairs OutboundInbound OutboundInbound References have connected InboundWire/ OutboundWire pairs Inbound Outbound CompositeComponent AtomicComponent

tu sca ny 23 Composite Reference Invocations When a message reaches the end of the outbound reference wire, the TargetInvoker dispatches over a transport In contrast to Component-->Component invocations, where the TargetInvoker would resolve the target implementation instance OutboundInboundOutboundInbound Invoke on transport AtomicComponentComposite Reference

tu sca ny 24 Component Tree Composites form a containment hierarchy The hierarchy may be arbitrarily deep The runtime itself, DefaultRuntime, is a composite There are two runtime hierarchies The application hierarchy End-user components The system hierarchy Runtime extensions

tu sca ny 25 Deployment Deployer Loader Builder Connector Loads artifacts to create configuration model Creates components and bindings from configuration model Creates wires that connect components to each other Co-ordinates deployment process

tu sca ny 26 Configuration Loading Loader StAXElement Loader ComponentType Loader Loads XML element from StAX stream Loads the componentType for an implementation

tu sca ny 27 Component Type Loading Loads the component type definition for a specific implementation How it does this is implementation-specific May load XML sidefile (location set by implementation) May introspect an implementation artifact (e.g. Java annotations) … or anything else Composite ComponentType Loader Load SCDL from supplied URL Extract and load SCDL from composite package (format TBD) POJO ComponentType Loader Load SCDL from class-relative “.componentType” sidefile Introspect Java annotations

tu sca ny 28 Annotation Processing Spec needs to clarify annotation processing algorithms Proposal based on the to our list 5/29 Pluggable annotation processors Ability to add new annotations Extend Magic Property and

tu sca ny 29 Building Builder creates a runtime component from the configuration model Builder for each implementation type Builder for each binding type (service or reference component) Runtime component manages: Implementation instances Inbound and Outbound wires Every implementation is likely to be different Different artifacts, programming model, … Composite implementation recurses for contained components Re-invokes the Builder for every child

tu sca ny 30 Bootstrap Bootstrap process is controlled by Host environment Default process implemented in DefaultBootstrapper Create DefaultRuntime Create Bootstrap Deployer Deploy System Assembly Locate Application Assemblies Locate System Assembly Deploy Application Assembly Start Server

tu sca ny 31 Agenda Spec Update Core Update Extending the Runtime

tu sca ny 32 The SPI Package A separate SPI project has been created for extending the runtime Extension code must never reference classes in tuscany-core Besides being bad design, this type of code will break when deployed to hosts that enforce classloader isolation There is a tuscany-test package for testcases to instantiate a few core implementation classes without directly referrencing them (we should look to eliminate it if possible) tuscany-core is an implementation of tuscany-spi tuscany-core tuscany-spi Extension

tu sca ny 33 Extension Design Principals The core must be as simple as possible but no simpler Simple but not simplistic Don’t sacrifice performance for extension simplification Make the extension API progressive High-level API for common cases A lower-level API that allows extenders nearly complete access Make the runtime easier for application developers first, then extenders Make everything possible an extension Limit the knowledge of the core The core should know very little about extension points People will want to extend the runtime in ways we haven’t thought of so make it as flexible as possible Extenders are Java developers and understand IoC Extending the runtime should only require knowledge of J2SE and IoC

tu sca ny 34 Base Extension Types Components Protocol Bindings Transport Bindings Data Bindings Policy Loaders Other types: Scope contexts Wires Proxy generation Anything people can think of and attach to the runtime…

tu sca ny 35 Extension Package tuscany-spi contains an extension package with abstract classes for base extensions AtomicComponentExtension.java CompositeComponentExtension.java LoaderExtension.java ReferenceExtension.java ServiceExtension.java

tu sca ny 36 Creating an Atomic Component Implementation Type 1.Implement 1..n model POJOs 2.Implement Loader or extend LoaderExtension Reads a StAX stream and creates appropriate model objects 3.Implement AtomicComponent or extend AtomicComponentExtension Extension will be given InboundWires and OutboundWires corresponding to its services and references; it must decide how to inject those onto its implementation instances (e.g. create a proxy) A WireService will be provided to the extension, which it can use to generate proxies and WireInvocationHandlers The extension must implement createTargetInvoker(..) and instantiate TargetInvokers responsible for dispatching to target instances 4.Implement ComponentBuilder or extend ComponentBuilderExtension Implements build(..) which returns the AtomicComponent implementation 5.Write a simple SCDL file and deploy into the system composite hierarchy

tu sca ny 37 Creating a Composite Component Implementation Type 1.Implement 1..n model POJOs 2.Implement Loader or extend LoaderExtension Reads a StAX stream and creates appropriate model objects 3.Implement CompositeComponent or extend CompositeComponentExtension The extension must implement createTargetInvoker(..) and instantiate TargetInvokers responsible for dispatching to target child instances 4.Implement ComponentBuilder or extend ComponentBuilderExtension Implements build(..) which returns the AtomicComponent implementation 5.Write a simple SCDL file and deploy into the system composite hierarchy

tu sca ny 38 Creating a Service 1.Implement 1..n model POJOs 2.Implement Loader or extend LoaderExtension Reads a StAX stream and creates appropriate model objects 3.Implement Service or extend ServiceExtension Receives requests from a binding. This may involve interfacing with the Tuscany host environment through the Host API 4.Implement BindingBuilder or extend BindingBuilderExtension Implements build(..) which returns the Service implementation 5.Write a simple SCDL file and deploy into the system composite hierarchy

tu sca ny 39 Creating a Reference 1.Implement 1..n model POJOs 2.Implement Loader or extend LoaderExtension Reads a StAX stream and creates appropriate model objects 3.Implement Reference or extend ReferenceExtension Receives requests from a binding. This may involve interfacing with the Tuscany host environment through the Host API The extension must also implement createTargetInvoker(..) and create TargetInvokers responsible for dispatching to the transport 4.Implement BindingBuilder or extend BindingBuilderExtension Implements build(..) which returns the Reference implementation 5.Write a simple SCDL file and deploy into the system composite hierarchy

tu sca ny 40 Creating a Generic Extension 1.Write a Java class 2.Write a simple SCDL file and deploy into the system composite hierarchy