SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
RESTful Services and Distributed OSGi

Friends or Foes


                                       Roland Tritsch
                                        Director PS FUSE
                      ACCU 2009 - Apr., 23rd - Oxford (UK)
Why is this relevant?
    Users and usage ...

        IBM's WebSphere
        Oracle's Weblogic
        Progress’s FUSE
        Red Hat's JBoss
        SpringSource's Application Platform
        Sun Microsystem's GlassFish Enterprise Server

      Linked-In, SAP NetWeaver, Telco, ... :)


2                                        © 2009 Progress Software Corporation
Agenda


      Introduction to OSGi and REST
       • The consortium, the standards, the users
       • Why to use it and how to use it

      Exposing WebServices from an OSGi
       container
       • To REST or not to REST that is here the ...

      Wrap and Summary
       • Current challenges and future developments
3                                         © 2009 Progress Software Corporation
The History


     OSGi originally stood for “Open Services
      Gateway initiative”
       • An initiative focused on deploying Java solutions
         into “residential gateways” for smart homes and
         building controls
       • The OSGi alliance was founded in 1999 to
         promote wide scale adoption of OSGi technology
     OSGi tackles the problem of deploying and
      administering Java “modules” (aka “bundles”)
       • Lifecycle - How to load, start, and stop Java
         bundles without shutting down the JVM
4                                          © 2009 Progress Software Corporation
The Benefits
    My personal hit list ...


      Mobile to Mainframe



      Managing the “CLASSPATH hell”



      With great tools/tooling around it


5                                           © 2009 Progress Software Corporation
The OSGi Alliance


     The OSGi alliance is made up of over 40
      members. Including ...
       • IBM, Progress, RedHat, SpringSource,
         Gigaspaces, Sun Microsystems ...
     Specifications are created by expert groups
       • Core Platform Expert Group (CPEG)
       • Vehicle Expert Group (VEG) - OSGi in the
         automotive industry
       • Mobile Expert Group (MEG) - OSGi in mobile
         telecommunications

6                                       © 2009 Progress Software Corporation
The OSGi Alliance (cont.)


     Specifications are created by expert groups
       • Residential Expert Group (REG) - OSGi in
         consumer and residential applications
       • Enterprise Expert Group (EEG) - OSGi in
         enterprise IT infrastructure applications
          – Distributed OSGi/RFC 119 describes how to allow
            remote invocations between OSGi containers
              A reference implementation is based on Apache CXF




7                                               © 2009 Progress Software Corporation
OSGi - Architecture Overview




Source: www.osgi.org
                               © 2009 Progress Software Corporation
OSGi - Key/Core Concepts - Bundles


     A bundle is a Java archive (JAR) with some
      meta-data
       • The meta-data is provided in plain-text in the
         META-INF/MANIFEST.MF file.
     Bundle meta-data includes the following
       • Bundle-Name, Bundle-Symbolic-Name, Bundle-
         Version, Export-Package, Import-Package
     Only those packages matching java.* are
      imported by default
       • all other packages must be imported explicitly

9                                          © 2009 Progress Software Corporation
OSGi - Key/Core Concepts - Services


      Services in OSGi are Java objects, invoked
       using local method invocations
        • Used to allow dynamic (re)use of code
      The Distributed OSGi specification (EEG RFC
       119) extends this concept to allow distributed
       communication.
        • A service in one OSGi framework instance could
          invoke on another service deployed in a different
          OSGi framework instance.
        • Services use additional OSGi properties to mark
          a service as “remote”.
10                                         © 2009 Progress Software Corporation
OSGi - Key/Core Concepts - Class Loading


      Using graph-based class-loading with versioned
       bundles means:
        • The same JVM can host numerous bundles …
        • … including different versions of the same
          bundle, …
        • … that can share and re-use classes, …
        • … with no runtime class-loading conflicts, …
        • … in a standardized manner.
      This is a major contribution of OSGi, in that it
       removes much of the risk associated with
       different JARs in the same JVM container
11                                         © 2009 Progress Software Corporation
OSGi - Implementations
     The “not-complete” list ... :)

       Apache Felix (from Apache Software
        Foundation)
          • Distributed under ASL 2.0
          • http://felix.apache.org/
       Equinox (from Eclipse Foundation)
          • Distributed under the Eclipse License
          • http://eclipse.org/equinox
       Knoplerfish (knoplerfish.org)
          • Distributed under the Knoplerfish License
          • http://knoplerfish.org
12                                           © 2009 Progress Software Corporation
REST - Introduction


      JAX-RS/JSR311 provides Java language
       support for RESTful services
        • For more information on REST, see Roy
          Fielding’s Ph.D. thesis:
          – http://www.ics.uci.edu/~fielding/pubs/dissertation/
            top.htm
      The approach is ideal for services that will be
       consumed by rich, browser- based internet client
       technologies like JavaScript and Google Web
       Toolkit (GWT)

13                                            © 2009 Progress Software Corporation
REST - Key/Core Concepts


        Approach:
         •   Annotate - your Java service.
         •   Deploy - in Spring Framework,
             Tomcat, J2EE, or standalone.
         •   Consume – e.g. from AJAX
             clients.




14                                           © 2009 Progress Software Corporation
The REST Interface


      No formal interface definition language (WSDL,
       IDL) is used
        • However, XSD is often used for data definition.
      A service’s “parameters” are passed via payload
       and URL
        • http://localhost:9000/contacts/007
        • Apache CXF supports multiple payloads,
          including XML and JSON




15                                         © 2009 Progress Software Corporation
The REST Interface (cont.)


      Services make use of a natural mapping from
       HTTP verbs to CRUD operations.
        •   POST: Create a new item of data on the service.
        •   GET: Retrieve data from the service.
        •   PUT: Update data on the service.
        •   DELETE: Delete data from services.




16                                          © 2009 Progress Software Corporation
The REST Interface - “HTTP” tunneling


      Some client-side tooling only supports GET and
       POST
      Instead of using PUT and DELETE, you can
       encode the operation for a create, delete or
       update into the URL of a HTTP POST
        • POST http://frodo/deleteCustomer/{id}
        • Don’t use this approach with HTTP GET, which
          should obey “read-only” semantics




17                                       © 2009 Progress Software Corporation
Testing RESTful Services


       You can test your REST services by simply
        pointing a browser at the URL
        • This will implicitly perform a GET on your service
       Alternatively, you can use command-line tools
        like wget or curl




18                                          © 2009 Progress Software Corporation
Agenda


       Introduction to OSGi and REST
        • The consortium, the standards, the users
        • Why to use it and how to use it

       Exposing WebServices from an OSGi
        container
        • To REST or not to REST that is here the ...

       Wrap and Summary
        • Current challenges and future developments
19                                         © 2009 Progress Software Corporation
Distributed OSGi
    Exposing and Consuming WebServices
                                         !"#$%"&'$()*+,-"*!(./*0123*4456

                                 (+&"/A%!&'"                               !"#$"#%!&'"

                                             ()#"%*"+&,%-./'+"0                   ()#"%*"+&,%-./'+"0

                                              1&2#3#4%-./'+"0                      1&2#3#4%-./'+"0
                                             5*(%667%-./'+"0                      5*(%667%-./'+"0
                                              89:3;<"%(=*>                         89:3;<"%(=*>

                                      ?4%9::%@/A"#B3;"0%-./'+"                 ?4%9::%@/A"#B3;"0%-./'+"

                                      ?4%9::%()/0.E"#%-./'+"                    ?4%9::%!"#$&;"%-./'+"

                                                       +02.3#&                               !"#$%#&
                                  '".2+1#&
                                                                                                       '()*+&,#&
                                                     0$;                                  C!D&
                                                    :#),4                                  0$;
                       "#-.%#
                       &#"2+!#
                      -#%$1$%$

                                                                    %(./$(           "#-.%#/#01'.+0%
                                                                  "78/9:$"/7
                  '&0;)$"#4
                   0"#$&;"
                  !                                                 !


 Source: http://blogs.iona.com/newcomer/OSGiCommunityEvent-DistOSGi.pdf © 2009 Progress Software Corporation
20
Exposing WebServices and ...


     public class Activator implements BundleActivator {
       private ServiceRegistration sr;

       public void start(BundleContext context) throws Exception {
         Dictionary props = new Hashtable();
         props.put("osgi.remote.interfaces", "*");
         sr = context.registerService(
           AuctionService.class.getName(),
             new AuctionServiceImpl(), props);
       }

       public void stop(BundleContext context) throws Exception {
         sr.unregister();
       }
     }

Source: http://coderthoughts.blogspot.com/2009/02/distributed-osgi-simple-example.html
21                                                                    © 2009 Progress Software Corporation
... consuming WebServices

     public class Activator implements BundleActivator {
       private ServiceTracker st;

       public void start(final BundleContext bc) throws Exception {
         st = new ServiceTracker(bc,
            AuctionService.class.getName(), null) {
           @Override
           public Object addingService(ServiceReference reference){
             Object svc = bc.getService(reference);
             if (svc instanceof AuctionService) {
               printServiceInfo((AuctionService) svc);
             }
             return super.addingService(reference);
           }
         };
         st.open();
       } ...
Source: http://coderthoughts.blogspot.com/2009/02/distributed-osgi-simple-example.html
22                                                                    © 2009 Progress Software Corporation
Making D-OSGi and REST work together


      Publishing RESTful endpoints from an OSGi
       container is possible right now
        • Package you annotated JAVA classes in a bundle
          and implement a suitable Activator() to start
          endpoint
      Consuming RESTful services from an OSGi
       container is less straight forward
        • You can always consume them manually with
          your own RESTful client side stack, but they will
          not look like OSGi services
      D-OSGi wants to make distribution seamless
23                                          © 2009 Progress Software Corporation
Making D-OSGi and REST work together



      The JAX-RS/JSR311 spec does not define a
       client side API for RESTful services ...

      ... but Jersey and Apache CXF do have such
       APIs, means ...

      ... both of these implementations are probably
       suitable to be plugged-in D-OSGi to allow OSGi
       containers to get seamless access to RESTful
       services
24                                     © 2009 Progress Software Corporation
Agenda


       Introduction to OSGi and REST
        • The consortium, the standards, the users
        • Why to use it and how to use it

       Exposing WebServices from an OSGi
        container
        • To REST or not to REST that is here the ...

       Wrap and Summary
        • Current challenges and future developments
25                                         © 2009 Progress Software Corporation
References



      The OSGi Alliance - http://www.osgi.org

      REST - http://www.ics.uci.edu/~fielding/pubs/
       dissertation/top.htm

      Distributed OSGi
        • Reference Implementation - http://cxf.apache.org/
          distributed-osgi.html


26                                         © 2009 Progress Software Corporation
Current Situation and Next Steps


      OSGi is on the rise

      With the efforts around D-OSGi, (RESTful)
       WebServices are first class citizens in the OSGi
       world
        • OSGi will become the de-facto deployment
          environment for (RESTful) WebServices

      The next steps could be to extend D-OSGi to
       include support for async messaging

27                                       © 2009 Progress Software Corporation
Questions




28               © 2009 Progress Software Corporation
Questions




             Thank You!


29                   © 2009 Progress Software Corporation
30   © 2009 Progress Software Corporation

Más contenido relacionado

La actualidad más candente

Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012Arun Gupta
 
HowTo Build an OSGI EJB3 Server
HowTo Build an OSGI EJB3 ServerHowTo Build an OSGI EJB3 Server
HowTo Build an OSGI EJB3 Serverekkehard gentz
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesJan S. Rellermeyer
 
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishBatch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishArun Gupta
 
Introduction to ActiveMQ Apollo
Introduction to ActiveMQ ApolloIntroduction to ActiveMQ Apollo
Introduction to ActiveMQ Apollodejanb
 
XML and Web Services with Groovy
XML and Web Services with GroovyXML and Web Services with Groovy
XML and Web Services with GroovyPaul King
 
GlassFish & Java EE Business Update @ CEJUG
GlassFish & Java EE Business Update @ CEJUGGlassFish & Java EE Business Update @ CEJUG
GlassFish & Java EE Business Update @ CEJUGArun Gupta
 
(Oleg zhurakousky)spring integration-scala-intro
(Oleg zhurakousky)spring integration-scala-intro(Oleg zhurakousky)spring integration-scala-intro
(Oleg zhurakousky)spring integration-scala-introSkills Matter Talks
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache CamelFuseSource.com
 
Groovy Testing Sep2009
Groovy Testing Sep2009Groovy Testing Sep2009
Groovy Testing Sep2009Paul King
 
Running your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the CloudRunning your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the CloudArun Gupta
 
Embrace Change - Embrace OSGi
Embrace Change - Embrace OSGiEmbrace Change - Embrace OSGi
Embrace Change - Embrace OSGiCarsten Ziegeler
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaArun Gupta
 
Apache Camel Introduction
Apache Camel IntroductionApache Camel Introduction
Apache Camel IntroductionClaus Ibsen
 
Weld-OSGi, injecting easiness in OSGi
Weld-OSGi, injecting easiness in OSGiWeld-OSGi, injecting easiness in OSGi
Weld-OSGi, injecting easiness in OSGiMathieu Ancelin
 
Open Cloud Computing Interface - OCCI Status update
Open Cloud Computing Interface - OCCI Status updateOpen Cloud Computing Interface - OCCI Status update
Open Cloud Computing Interface - OCCI Status updatebefreax
 
Java EE 7 and HTML5: Developing for the Cloud
Java EE 7 and HTML5: Developing for the CloudJava EE 7 and HTML5: Developing for the Cloud
Java EE 7 and HTML5: Developing for the CloudArun Gupta
 
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youJava EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youAlex Theedom
 
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...mfrancis
 

La actualidad más candente (20)

Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
 
HowTo Build an OSGI EJB3 Server
HowTo Build an OSGI EJB3 ServerHowTo Build an OSGI EJB3 Server
HowTo Build an OSGI EJB3 Server
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
 
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishBatch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
 
Introduction to ActiveMQ Apollo
Introduction to ActiveMQ ApolloIntroduction to ActiveMQ Apollo
Introduction to ActiveMQ Apollo
 
XML and Web Services with Groovy
XML and Web Services with GroovyXML and Web Services with Groovy
XML and Web Services with Groovy
 
Websocket 1.0
Websocket 1.0Websocket 1.0
Websocket 1.0
 
GlassFish & Java EE Business Update @ CEJUG
GlassFish & Java EE Business Update @ CEJUGGlassFish & Java EE Business Update @ CEJUG
GlassFish & Java EE Business Update @ CEJUG
 
(Oleg zhurakousky)spring integration-scala-intro
(Oleg zhurakousky)spring integration-scala-intro(Oleg zhurakousky)spring integration-scala-intro
(Oleg zhurakousky)spring integration-scala-intro
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
Groovy Testing Sep2009
Groovy Testing Sep2009Groovy Testing Sep2009
Groovy Testing Sep2009
 
Running your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the CloudRunning your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the Cloud
 
Embrace Change - Embrace OSGi
Embrace Change - Embrace OSGiEmbrace Change - Embrace OSGi
Embrace Change - Embrace OSGi
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 India
 
Apache Camel Introduction
Apache Camel IntroductionApache Camel Introduction
Apache Camel Introduction
 
Weld-OSGi, injecting easiness in OSGi
Weld-OSGi, injecting easiness in OSGiWeld-OSGi, injecting easiness in OSGi
Weld-OSGi, injecting easiness in OSGi
 
Open Cloud Computing Interface - OCCI Status update
Open Cloud Computing Interface - OCCI Status updateOpen Cloud Computing Interface - OCCI Status update
Open Cloud Computing Interface - OCCI Status update
 
Java EE 7 and HTML5: Developing for the Cloud
Java EE 7 and HTML5: Developing for the CloudJava EE 7 and HTML5: Developing for the Cloud
Java EE 7 and HTML5: Developing for the Cloud
 
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youJava EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
 
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
 

Similar a RESTful Services and Distributed OSGi - 04/2009

Kick Start your Application Development and Management Strategy
Kick Start your Application Development and Management Strategy Kick Start your Application Development and Management Strategy
Kick Start your Application Development and Management Strategy WSO2
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
Product Release Webinar- WSO2 Developer Studio 3.5
Product Release Webinar- WSO2 Developer Studio 3.5Product Release Webinar- WSO2 Developer Studio 3.5
Product Release Webinar- WSO2 Developer Studio 3.5WSO2
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Reviewnjbartlett
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriensmfrancis
 
Cloud standards interoperability: status update on OCCI and CDMI implementations
Cloud standards interoperability: status update on OCCI and CDMI implementationsCloud standards interoperability: status update on OCCI and CDMI implementations
Cloud standards interoperability: status update on OCCI and CDMI implementationsFlorian Feldhaus
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggeryWSO2
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the CloudCloudBees
 
The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011Arun Gupta
 
Java @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPJava @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPIlan Salviano
 
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston MeetupOpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston Meetupragss
 
Node.js and Oracle Database: New Development Techniques
Node.js and Oracle Database: New Development TechniquesNode.js and Oracle Database: New Development Techniques
Node.js and Oracle Database: New Development TechniquesChristopher Jones
 
WebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureWebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureFrank Greco
 
Secrets of Custom API Policies on the Oracle API Platform
Secrets of Custom API Policies on the Oracle API PlatformSecrets of Custom API Policies on the Oracle API Platform
Secrets of Custom API Policies on the Oracle API PlatformPhil Wilkins
 
Normalizing x pages web development
Normalizing x pages web development Normalizing x pages web development
Normalizing x pages web development Shean McManus
 

Similar a RESTful Services and Distributed OSGi - 04/2009 (20)

Kick Start your Application Development and Management Strategy
Kick Start your Application Development and Management Strategy Kick Start your Application Development and Management Strategy
Kick Start your Application Development and Management Strategy
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Product Release Webinar- WSO2 Developer Studio 3.5
Product Release Webinar- WSO2 Developer Studio 3.5Product Release Webinar- WSO2 Developer Studio 3.5
Product Release Webinar- WSO2 Developer Studio 3.5
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Review
 
IBM Z for the Digital Enterprise - Zowe overview
IBM Z for the Digital Enterprise - Zowe overviewIBM Z for the Digital Enterprise - Zowe overview
IBM Z for the Digital Enterprise - Zowe overview
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriens
 
Java Cloud and Container Ready
Java Cloud and Container ReadyJava Cloud and Container Ready
Java Cloud and Container Ready
 
Cloud standards interoperability: status update on OCCI and CDMI implementations
Cloud standards interoperability: status update on OCCI and CDMI implementationsCloud standards interoperability: status update on OCCI and CDMI implementations
Cloud standards interoperability: status update on OCCI and CDMI implementations
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggery
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the Cloud
 
The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011
 
Java @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPJava @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SP
 
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston MeetupOpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
 
Node.js and Oracle Database: New Development Techniques
Node.js and Oracle Database: New Development TechniquesNode.js and Oracle Database: New Development Techniques
Node.js and Oracle Database: New Development Techniques
 
WebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureWebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the Future
 
Secrets of Custom API Policies on the Oracle API Platform
Secrets of Custom API Policies on the Oracle API PlatformSecrets of Custom API Policies on the Oracle API Platform
Secrets of Custom API Policies on the Oracle API Platform
 
Fuji Overview
Fuji OverviewFuji Overview
Fuji Overview
 
Normalizing x pages web development
Normalizing x pages web development Normalizing x pages web development
Normalizing x pages web development
 
Making Apache Camel work for you
Making Apache Camel work for you Making Apache Camel work for you
Making Apache Camel work for you
 

Más de Roland Tritsch

Shared-Nothing Microservices Architectures ... and how to get there @ 404.ie ...
Shared-Nothing Microservices Architectures ... and how to get there @ 404.ie ...Shared-Nothing Microservices Architectures ... and how to get there @ 404.ie ...
Shared-Nothing Microservices Architectures ... and how to get there @ 404.ie ...Roland Tritsch
 
Reactive Programming Meetup - NodeJs on K8s
Reactive Programming Meetup - NodeJs on K8sReactive Programming Meetup - NodeJs on K8s
Reactive Programming Meetup - NodeJs on K8sRoland Tritsch
 
Scala, Android & BLE - Scala Meetup Dublin - Hands on code walkthrough
Scala, Android & BLE - Scala Meetup Dublin - Hands on code walkthroughScala, Android & BLE - Scala Meetup Dublin - Hands on code walkthrough
Scala, Android & BLE - Scala Meetup Dublin - Hands on code walkthroughRoland Tritsch
 
Immutable Deployment Platforms and Continuos Delivery - Friends or Foes?
Immutable Deployment Platforms and Continuos Delivery - Friends or Foes?Immutable Deployment Platforms and Continuos Delivery - Friends or Foes?
Immutable Deployment Platforms and Continuos Delivery - Friends or Foes?Roland Tritsch
 
Mobile Monday - WebServices on the iPhone - 05/2008
Mobile Monday - WebServices on the iPhone - 05/2008Mobile Monday - WebServices on the iPhone - 05/2008
Mobile Monday - WebServices on the iPhone - 05/2008Roland Tritsch
 
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Roland Tritsch
 
A SOA for the car - 01/2009
A SOA for the car - 01/2009A SOA for the car - 01/2009
A SOA for the car - 01/2009Roland Tritsch
 
Puppet Camp Dublin - 06/2012
Puppet Camp Dublin - 06/2012Puppet Camp Dublin - 06/2012
Puppet Camp Dublin - 06/2012Roland Tritsch
 
iPhone meets SOA - 06/2008
iPhone meets SOA - 06/2008iPhone meets SOA - 06/2008
iPhone meets SOA - 06/2008Roland Tritsch
 
Innovation, Gilt and Ireland - 11/2011
Innovation, Gilt and Ireland - 11/2011Innovation, Gilt and Ireland - 11/2011
Innovation, Gilt and Ireland - 11/2011Roland Tritsch
 
Teaching Functional Programming @ TCD - 11/2012
Teaching Functional Programming @ TCD - 11/2012Teaching Functional Programming @ TCD - 11/2012
Teaching Functional Programming @ TCD - 11/2012Roland Tritsch
 
"Managed Customization” in the Garment Industry - 10/2010
"Managed Customization” in the Garment Industry - 10/2010"Managed Customization” in the Garment Industry - 10/2010
"Managed Customization” in the Garment Industry - 10/2010Roland Tritsch
 
AJAX for Mobile Devices - 04/2009
AJAX for Mobile Devices - 04/2009AJAX for Mobile Devices - 04/2009
AJAX for Mobile Devices - 04/2009Roland Tritsch
 

Más de Roland Tritsch (14)

Shared-Nothing Microservices Architectures ... and how to get there @ 404.ie ...
Shared-Nothing Microservices Architectures ... and how to get there @ 404.ie ...Shared-Nothing Microservices Architectures ... and how to get there @ 404.ie ...
Shared-Nothing Microservices Architectures ... and how to get there @ 404.ie ...
 
SMACK Stack @ Nitro
SMACK Stack @ NitroSMACK Stack @ Nitro
SMACK Stack @ Nitro
 
Reactive Programming Meetup - NodeJs on K8s
Reactive Programming Meetup - NodeJs on K8sReactive Programming Meetup - NodeJs on K8s
Reactive Programming Meetup - NodeJs on K8s
 
Scala, Android & BLE - Scala Meetup Dublin - Hands on code walkthrough
Scala, Android & BLE - Scala Meetup Dublin - Hands on code walkthroughScala, Android & BLE - Scala Meetup Dublin - Hands on code walkthrough
Scala, Android & BLE - Scala Meetup Dublin - Hands on code walkthrough
 
Immutable Deployment Platforms and Continuos Delivery - Friends or Foes?
Immutable Deployment Platforms and Continuos Delivery - Friends or Foes?Immutable Deployment Platforms and Continuos Delivery - Friends or Foes?
Immutable Deployment Platforms and Continuos Delivery - Friends or Foes?
 
Mobile Monday - WebServices on the iPhone - 05/2008
Mobile Monday - WebServices on the iPhone - 05/2008Mobile Monday - WebServices on the iPhone - 05/2008
Mobile Monday - WebServices on the iPhone - 05/2008
 
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
 
A SOA for the car - 01/2009
A SOA for the car - 01/2009A SOA for the car - 01/2009
A SOA for the car - 01/2009
 
Puppet Camp Dublin - 06/2012
Puppet Camp Dublin - 06/2012Puppet Camp Dublin - 06/2012
Puppet Camp Dublin - 06/2012
 
iPhone meets SOA - 06/2008
iPhone meets SOA - 06/2008iPhone meets SOA - 06/2008
iPhone meets SOA - 06/2008
 
Innovation, Gilt and Ireland - 11/2011
Innovation, Gilt and Ireland - 11/2011Innovation, Gilt and Ireland - 11/2011
Innovation, Gilt and Ireland - 11/2011
 
Teaching Functional Programming @ TCD - 11/2012
Teaching Functional Programming @ TCD - 11/2012Teaching Functional Programming @ TCD - 11/2012
Teaching Functional Programming @ TCD - 11/2012
 
"Managed Customization” in the Garment Industry - 10/2010
"Managed Customization” in the Garment Industry - 10/2010"Managed Customization” in the Garment Industry - 10/2010
"Managed Customization” in the Garment Industry - 10/2010
 
AJAX for Mobile Devices - 04/2009
AJAX for Mobile Devices - 04/2009AJAX for Mobile Devices - 04/2009
AJAX for Mobile Devices - 04/2009
 

RESTful Services and Distributed OSGi - 04/2009

  • 1. RESTful Services and Distributed OSGi Friends or Foes Roland Tritsch Director PS FUSE ACCU 2009 - Apr., 23rd - Oxford (UK)
  • 2. Why is this relevant? Users and usage ...  IBM's WebSphere  Oracle's Weblogic  Progress’s FUSE  Red Hat's JBoss  SpringSource's Application Platform  Sun Microsystem's GlassFish Enterprise Server  Linked-In, SAP NetWeaver, Telco, ... :) 2 © 2009 Progress Software Corporation
  • 3. Agenda  Introduction to OSGi and REST • The consortium, the standards, the users • Why to use it and how to use it  Exposing WebServices from an OSGi container • To REST or not to REST that is here the ...  Wrap and Summary • Current challenges and future developments 3 © 2009 Progress Software Corporation
  • 4. The History  OSGi originally stood for “Open Services Gateway initiative” • An initiative focused on deploying Java solutions into “residential gateways” for smart homes and building controls • The OSGi alliance was founded in 1999 to promote wide scale adoption of OSGi technology  OSGi tackles the problem of deploying and administering Java “modules” (aka “bundles”) • Lifecycle - How to load, start, and stop Java bundles without shutting down the JVM 4 © 2009 Progress Software Corporation
  • 5. The Benefits My personal hit list ...  Mobile to Mainframe  Managing the “CLASSPATH hell”  With great tools/tooling around it 5 © 2009 Progress Software Corporation
  • 6. The OSGi Alliance  The OSGi alliance is made up of over 40 members. Including ... • IBM, Progress, RedHat, SpringSource, Gigaspaces, Sun Microsystems ...  Specifications are created by expert groups • Core Platform Expert Group (CPEG) • Vehicle Expert Group (VEG) - OSGi in the automotive industry • Mobile Expert Group (MEG) - OSGi in mobile telecommunications 6 © 2009 Progress Software Corporation
  • 7. The OSGi Alliance (cont.)  Specifications are created by expert groups • Residential Expert Group (REG) - OSGi in consumer and residential applications • Enterprise Expert Group (EEG) - OSGi in enterprise IT infrastructure applications – Distributed OSGi/RFC 119 describes how to allow remote invocations between OSGi containers  A reference implementation is based on Apache CXF 7 © 2009 Progress Software Corporation
  • 8. OSGi - Architecture Overview Source: www.osgi.org © 2009 Progress Software Corporation
  • 9. OSGi - Key/Core Concepts - Bundles  A bundle is a Java archive (JAR) with some meta-data • The meta-data is provided in plain-text in the META-INF/MANIFEST.MF file.  Bundle meta-data includes the following • Bundle-Name, Bundle-Symbolic-Name, Bundle- Version, Export-Package, Import-Package  Only those packages matching java.* are imported by default • all other packages must be imported explicitly 9 © 2009 Progress Software Corporation
  • 10. OSGi - Key/Core Concepts - Services  Services in OSGi are Java objects, invoked using local method invocations • Used to allow dynamic (re)use of code  The Distributed OSGi specification (EEG RFC 119) extends this concept to allow distributed communication. • A service in one OSGi framework instance could invoke on another service deployed in a different OSGi framework instance. • Services use additional OSGi properties to mark a service as “remote”. 10 © 2009 Progress Software Corporation
  • 11. OSGi - Key/Core Concepts - Class Loading  Using graph-based class-loading with versioned bundles means: • The same JVM can host numerous bundles … • … including different versions of the same bundle, … • … that can share and re-use classes, … • … with no runtime class-loading conflicts, … • … in a standardized manner.  This is a major contribution of OSGi, in that it removes much of the risk associated with different JARs in the same JVM container 11 © 2009 Progress Software Corporation
  • 12. OSGi - Implementations The “not-complete” list ... :)  Apache Felix (from Apache Software Foundation) • Distributed under ASL 2.0 • http://felix.apache.org/  Equinox (from Eclipse Foundation) • Distributed under the Eclipse License • http://eclipse.org/equinox  Knoplerfish (knoplerfish.org) • Distributed under the Knoplerfish License • http://knoplerfish.org 12 © 2009 Progress Software Corporation
  • 13. REST - Introduction  JAX-RS/JSR311 provides Java language support for RESTful services • For more information on REST, see Roy Fielding’s Ph.D. thesis: – http://www.ics.uci.edu/~fielding/pubs/dissertation/ top.htm  The approach is ideal for services that will be consumed by rich, browser- based internet client technologies like JavaScript and Google Web Toolkit (GWT) 13 © 2009 Progress Software Corporation
  • 14. REST - Key/Core Concepts  Approach: • Annotate - your Java service. • Deploy - in Spring Framework, Tomcat, J2EE, or standalone. • Consume – e.g. from AJAX clients. 14 © 2009 Progress Software Corporation
  • 15. The REST Interface  No formal interface definition language (WSDL, IDL) is used • However, XSD is often used for data definition.  A service’s “parameters” are passed via payload and URL • http://localhost:9000/contacts/007 • Apache CXF supports multiple payloads, including XML and JSON 15 © 2009 Progress Software Corporation
  • 16. The REST Interface (cont.)  Services make use of a natural mapping from HTTP verbs to CRUD operations. • POST: Create a new item of data on the service. • GET: Retrieve data from the service. • PUT: Update data on the service. • DELETE: Delete data from services. 16 © 2009 Progress Software Corporation
  • 17. The REST Interface - “HTTP” tunneling  Some client-side tooling only supports GET and POST  Instead of using PUT and DELETE, you can encode the operation for a create, delete or update into the URL of a HTTP POST • POST http://frodo/deleteCustomer/{id} • Don’t use this approach with HTTP GET, which should obey “read-only” semantics 17 © 2009 Progress Software Corporation
  • 18. Testing RESTful Services  You can test your REST services by simply pointing a browser at the URL • This will implicitly perform a GET on your service  Alternatively, you can use command-line tools like wget or curl 18 © 2009 Progress Software Corporation
  • 19. Agenda  Introduction to OSGi and REST • The consortium, the standards, the users • Why to use it and how to use it  Exposing WebServices from an OSGi container • To REST or not to REST that is here the ...  Wrap and Summary • Current challenges and future developments 19 © 2009 Progress Software Corporation
  • 20. Distributed OSGi Exposing and Consuming WebServices !"#$%"&'$()*+,-"*!(./*0123*4456 (+&"/A%!&'" !"#$"#%!&'" ()#"%*"+&,%-./'+"0 ()#"%*"+&,%-./'+"0 1&2#3#4%-./'+"0 1&2#3#4%-./'+"0 5*(%667%-./'+"0 5*(%667%-./'+"0 89:3;<"%(=*> 89:3;<"%(=*> ?4%9::%@/A"#B3;"0%-./'+" ?4%9::%@/A"#B3;"0%-./'+" ?4%9::%()/0.E"#%-./'+" ?4%9::%!"#$&;"%-./'+" +02.3#& !"#$%#& '".2+1#& '()*+&,#& 0$; C!D& :#),4 0$; "#-.%# &#"2+!# -#%$1$%$ %(./$( "#-.%#/#01'.+0% "78/9:$"/7 '&0;)$"#4 0"#$&;" ! ! Source: http://blogs.iona.com/newcomer/OSGiCommunityEvent-DistOSGi.pdf © 2009 Progress Software Corporation 20
  • 21. Exposing WebServices and ... public class Activator implements BundleActivator {   private ServiceRegistration sr;   public void start(BundleContext context) throws Exception {     Dictionary props = new Hashtable();     props.put("osgi.remote.interfaces", "*");     sr = context.registerService( AuctionService.class.getName(),         new AuctionServiceImpl(), props);   }   public void stop(BundleContext context) throws Exception {     sr.unregister();   } } Source: http://coderthoughts.blogspot.com/2009/02/distributed-osgi-simple-example.html 21 © 2009 Progress Software Corporation
  • 22. ... consuming WebServices public class Activator implements BundleActivator {   private ServiceTracker st;   public void start(final BundleContext bc) throws Exception {     st = new ServiceTracker(bc, AuctionService.class.getName(), null) {       @Override       public Object addingService(ServiceReference reference){         Object svc = bc.getService(reference);         if (svc instanceof AuctionService) {           printServiceInfo((AuctionService) svc);         }         return super.addingService(reference);       }     };     st.open();   } ... Source: http://coderthoughts.blogspot.com/2009/02/distributed-osgi-simple-example.html 22 © 2009 Progress Software Corporation
  • 23. Making D-OSGi and REST work together  Publishing RESTful endpoints from an OSGi container is possible right now • Package you annotated JAVA classes in a bundle and implement a suitable Activator() to start endpoint  Consuming RESTful services from an OSGi container is less straight forward • You can always consume them manually with your own RESTful client side stack, but they will not look like OSGi services  D-OSGi wants to make distribution seamless 23 © 2009 Progress Software Corporation
  • 24. Making D-OSGi and REST work together  The JAX-RS/JSR311 spec does not define a client side API for RESTful services ...  ... but Jersey and Apache CXF do have such APIs, means ...  ... both of these implementations are probably suitable to be plugged-in D-OSGi to allow OSGi containers to get seamless access to RESTful services 24 © 2009 Progress Software Corporation
  • 25. Agenda  Introduction to OSGi and REST • The consortium, the standards, the users • Why to use it and how to use it  Exposing WebServices from an OSGi container • To REST or not to REST that is here the ...  Wrap and Summary • Current challenges and future developments 25 © 2009 Progress Software Corporation
  • 26. References  The OSGi Alliance - http://www.osgi.org  REST - http://www.ics.uci.edu/~fielding/pubs/ dissertation/top.htm  Distributed OSGi • Reference Implementation - http://cxf.apache.org/ distributed-osgi.html 26 © 2009 Progress Software Corporation
  • 27. Current Situation and Next Steps  OSGi is on the rise  With the efforts around D-OSGi, (RESTful) WebServices are first class citizens in the OSGi world • OSGi will become the de-facto deployment environment for (RESTful) WebServices  The next steps could be to extend D-OSGi to include support for async messaging 27 © 2009 Progress Software Corporation
  • 28. Questions 28 © 2009 Progress Software Corporation
  • 29. Questions Thank You! 29 © 2009 Progress Software Corporation
  • 30. 30 © 2009 Progress Software Corporation