SlideShare uma empresa Scribd logo
1 de 34
OSGi as an embedded Rich Internet Application Engine
Introduction to Rich Internet Applications (RIA)
Rich Internet Applications What are Rich Internet Apps (RIAs)? ,[object Object]
Frameworks:Adobe Air & Flex, Google WT, Gears, Yahoo Widgets…,[object Object]
Rich Internet Applications RIAs on PCs: A Happy World… Source: ethanmorrow.com … same thing for Mobile? …
Rich Internet Applications ,[object Object]
No integration with phone functions (i.e. location)
Data bandwidth, Offline Mode
Security, etc.… NO!!! Source: abcnews.go.com
Introduction to Rich Internet MobileNet Applications (RMA)
Rich MobileNet Applications Rich Internet Application: ”Fully featured software package that runs in a browser.”- from Loosely Coupled (http://www.loselycoupled.com/glossary/RIA) Movements to achieve “fully featured”: Google Gears OMTP BONDI W3C Geolocation API Incomplete/Work in progress Specification work in BONDI ongoing Implementations are browser and platform specific
Rich MobileNet Applications Traditional Approach to mobile Portals: Web Server Web Server Web Server Location PIM Bluetooth … Browser This persentation  is NOT about this
The new approach: RMA Rich MobileNet Applications XYZ Server Web Service App Service Web Server Web Server Location PIM Bluetooth … Browser Mobile OSGi My Local Portal
Server in the pocket concept The role of mobile phones changes Content is created on the go Photos taken by camera phones Blog entries written on smart phones Data collected via sensors Location information Services are provided at the edge of the network For example phone as a content (media) server Ad hoc connectivity Local networks, peer to peer etc. Different realizations of the concept – or parts: Mobile web server: Nokia MyMobilesite.Net Personal web server: Opera Unite (http://unite.opera.com)
OSGi – The Server In Your Pocket HTTP Service: your personal web server UPnP: for ad hoc connectivity and automatic configuration Portability: runs on many different platforms (S60, WM, BREW, Android etc.) Platform integration: existing Java APIs to access device functionality Local web applications (widgets) Remote Service Access: automatic export of services
OSGi enabling BONDI BONDI is an emerging standard for browser JavaScript extensions (mostly for access to phone features) OSGi is a component and service runtime OSGi can inject BONDI into browsers OSGi Browser Java JSR JSR JSR JSR JSR API API API API API Phone OS Phone OS
Services in your pocket Horizontal services Device integration or operator services Shared by applications Can be deployed post shipment Application specific services: Complex business logic implemented in Java Can use the full power of Java JEE-like 3-tier architecture in the device Can leverage existing 3rd-party components
Technology
Remote Service Access - Architecture UI Runtime  (e.g. Browser) OSGi Remote Events Event Admin Application (e.g widget) RSR Convenience Library  (e.g. JavaScript) Service Registry 3. find 2. export RSA 4. bind Service Service Object 5. use 1. register
Widgets Locally installed web applications Support for W3C Widget specification Widget use HTML and CSS as the markup Metadata provided in config.xml Packaged as a ZIP Widgets are fully manageable via OSGi Secure widget execution: security context spans from OSGi to the Browser
Remote Service Access Based on Distributed OSGi concept Bindings specified for JSON RPC – lightweight and fits JavaScript naturally Services can be marked for export Access point and skeleton automatically created IDL: Java – simple mapping to JavaScript (with some restrictions) Remote Service Registry (RSR) Available at a well-know URL Accessible via a well-known (JSON) web service interface
Service Model Asymmetric: service provider OSGi, service consumer UI Runtime Synchronous method calls Parameters passed by value No callbacks, no listeners… Event support: to prevent polling in the applications Applications can subscribe to Event Admin topics
Convenience Library Remote Service Access is specified in terms of protocols and access points Ensures interoperability with any UI Runtime A JavaScript convenience library is provided for better developer experience Simple API to access RSR – find and bind services Automatically generates stubs for using bound services Subscribe to remote events (listeners)
How to make a remote service So, how to create a remote service? By flagging it “remotable”: org.osgi.remote.publish=true
Best design practices for remote services Use simple types as parameters Primitive types and their wrappers Strings JavaBeans Classes with default constructor and public members Maps Arrays (homogeneous) Synchronous methods should return quickly If operation takes longer, use notifications Session-oriented services
Session oriented services startSession: returns session ID Session ID used to identify an Event Admin topic. Notifications are delivered through that topic Session ID is used in each service request to identify the session asynchServiceMethod: returns request ID Events related to this request carry the request ID
Session oriented service example - Messaging public interface MessagingService { public String startSession(); publicvoidstopSession(String sessionId); /**     * Result will be delivered to:      * /com/prosyst/service/MessagingService/<sessionId> topic.     */ publicintsendSms(String sessionId, SMSMessage message, Map options); } public class SMSMessage { public String[] recipients; public String body; public Map options; } Success Event attributes Failure Event attributes ,[object Object]
Request ID
Type: “MessageResult”
Session ID
Request ID
Type: “MessageError”
Status: sent, pending, delivered or failed
Recipients

Mais conteúdo relacionado

Destaque

Eprotect Complan Ver 4
Eprotect Complan Ver 4Eprotect Complan Ver 4
Eprotect Complan Ver 4etalcomendras
 
Gr trav f. risk cv s.metabolique
Gr trav f. risk cv s.metaboliqueGr trav f. risk cv s.metabolique
Gr trav f. risk cv s.metaboliquesfa_angeiologie
 
201103 emotional impacts on digital media
201103 emotional impacts on digital media201103 emotional impacts on digital media
201103 emotional impacts on digital mediaJavier Gonzalez-Sanchez
 
Heirloom Travel: Wine Country - Wineries
Heirloom Travel: Wine Country - WineriesHeirloom Travel: Wine Country - Wineries
Heirloom Travel: Wine Country - WineriesIceMilk Aprons
 
RCMSL Phenomenal July 9, 2009
RCMSL Phenomenal July 9, 2009RCMSL Phenomenal July 9, 2009
RCMSL Phenomenal July 9, 2009etalcomendras
 
Developing distributed analysis pipelines with shared community resources usi...
Developing distributed analysis pipelines with shared community resources usi...Developing distributed analysis pipelines with shared community resources usi...
Developing distributed analysis pipelines with shared community resources usi...Brad Chapman
 
Week14 Presentation Group-C
Week14 Presentation Group-CWeek14 Presentation Group-C
Week14 Presentation Group-Cs1160114
 
Awesome Powerpoint Monday Morning #5
Awesome Powerpoint Monday Morning #5Awesome Powerpoint Monday Morning #5
Awesome Powerpoint Monday Morning #5SylShannon
 
Heirloom Travel: Wine Country - Sonoma
Heirloom Travel: Wine Country - SonomaHeirloom Travel: Wine Country - Sonoma
Heirloom Travel: Wine Country - SonomaIceMilk Aprons
 
Deutsche Telekom BarCamp 03, 25 June 2009
Deutsche Telekom BarCamp 03, 25 June 2009Deutsche Telekom BarCamp 03, 25 June 2009
Deutsche Telekom BarCamp 03, 25 June 2009Jackson Bond
 
LiveOffice Email Archiving & Compliance 101
LiveOffice Email Archiving & Compliance 101LiveOffice Email Archiving & Compliance 101
LiveOffice Email Archiving & Compliance 101Veritas Technologies LLC
 

Destaque (20)

201010 SPLASH Tutorial
201010 SPLASH Tutorial201010 SPLASH Tutorial
201010 SPLASH Tutorial
 
200710 - Project Hoshimi
200710 - Project Hoshimi200710 - Project Hoshimi
200710 - Project Hoshimi
 
Eprotect Complan Ver 4
Eprotect Complan Ver 4Eprotect Complan Ver 4
Eprotect Complan Ver 4
 
Gr trav f. risk cv s.metabolique
Gr trav f. risk cv s.metaboliqueGr trav f. risk cv s.metabolique
Gr trav f. risk cv s.metabolique
 
201103 emotional impacts on digital media
201103 emotional impacts on digital media201103 emotional impacts on digital media
201103 emotional impacts on digital media
 
Heirloom Travel: Wine Country - Wineries
Heirloom Travel: Wine Country - WineriesHeirloom Travel: Wine Country - Wineries
Heirloom Travel: Wine Country - Wineries
 
RCMSL Phenomenal July 9, 2009
RCMSL Phenomenal July 9, 2009RCMSL Phenomenal July 9, 2009
RCMSL Phenomenal July 9, 2009
 
Séptimo Básico.Pp
Séptimo Básico.PpSéptimo Básico.Pp
Séptimo Básico.Pp
 
200310 - Apache Web Server
200310 - Apache Web Server200310 - Apache Web Server
200310 - Apache Web Server
 
Developing distributed analysis pipelines with shared community resources usi...
Developing distributed analysis pipelines with shared community resources usi...Developing distributed analysis pipelines with shared community resources usi...
Developing distributed analysis pipelines with shared community resources usi...
 
Jay Cross Vivo Versao Final Corrigida
Jay Cross Vivo Versao Final CorrigidaJay Cross Vivo Versao Final Corrigida
Jay Cross Vivo Versao Final Corrigida
 
Tabado
TabadoTabado
Tabado
 
Cup A Soup MiNi
Cup A Soup MiNiCup A Soup MiNi
Cup A Soup MiNi
 
Week14 Presentation Group-C
Week14 Presentation Group-CWeek14 Presentation Group-C
Week14 Presentation Group-C
 
lectura
lecturalectura
lectura
 
Awesome Powerpoint Monday Morning #5
Awesome Powerpoint Monday Morning #5Awesome Powerpoint Monday Morning #5
Awesome Powerpoint Monday Morning #5
 
Heirloom Travel: Wine Country - Sonoma
Heirloom Travel: Wine Country - SonomaHeirloom Travel: Wine Country - Sonoma
Heirloom Travel: Wine Country - Sonoma
 
Farma
FarmaFarma
Farma
 
Deutsche Telekom BarCamp 03, 25 June 2009
Deutsche Telekom BarCamp 03, 25 June 2009Deutsche Telekom BarCamp 03, 25 June 2009
Deutsche Telekom BarCamp 03, 25 June 2009
 
LiveOffice Email Archiving & Compliance 101
LiveOffice Email Archiving & Compliance 101LiveOffice Email Archiving & Compliance 101
LiveOffice Email Archiving & Compliance 101
 

Último

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

OSGi As An Embedded Rich Internet Application Engine

  • 1. OSGi as an embedded Rich Internet Application Engine
  • 2. Introduction to Rich Internet Applications (RIA)
  • 3.
  • 4.
  • 5. Rich Internet Applications RIAs on PCs: A Happy World… Source: ethanmorrow.com … same thing for Mobile? …
  • 6.
  • 7. No integration with phone functions (i.e. location)
  • 9. Security, etc.… NO!!! Source: abcnews.go.com
  • 10. Introduction to Rich Internet MobileNet Applications (RMA)
  • 11. Rich MobileNet Applications Rich Internet Application: ”Fully featured software package that runs in a browser.”- from Loosely Coupled (http://www.loselycoupled.com/glossary/RIA) Movements to achieve “fully featured”: Google Gears OMTP BONDI W3C Geolocation API Incomplete/Work in progress Specification work in BONDI ongoing Implementations are browser and platform specific
  • 12. Rich MobileNet Applications Traditional Approach to mobile Portals: Web Server Web Server Web Server Location PIM Bluetooth … Browser This persentation is NOT about this
  • 13. The new approach: RMA Rich MobileNet Applications XYZ Server Web Service App Service Web Server Web Server Location PIM Bluetooth … Browser Mobile OSGi My Local Portal
  • 14. Server in the pocket concept The role of mobile phones changes Content is created on the go Photos taken by camera phones Blog entries written on smart phones Data collected via sensors Location information Services are provided at the edge of the network For example phone as a content (media) server Ad hoc connectivity Local networks, peer to peer etc. Different realizations of the concept – or parts: Mobile web server: Nokia MyMobilesite.Net Personal web server: Opera Unite (http://unite.opera.com)
  • 15. OSGi – The Server In Your Pocket HTTP Service: your personal web server UPnP: for ad hoc connectivity and automatic configuration Portability: runs on many different platforms (S60, WM, BREW, Android etc.) Platform integration: existing Java APIs to access device functionality Local web applications (widgets) Remote Service Access: automatic export of services
  • 16. OSGi enabling BONDI BONDI is an emerging standard for browser JavaScript extensions (mostly for access to phone features) OSGi is a component and service runtime OSGi can inject BONDI into browsers OSGi Browser Java JSR JSR JSR JSR JSR API API API API API Phone OS Phone OS
  • 17. Services in your pocket Horizontal services Device integration or operator services Shared by applications Can be deployed post shipment Application specific services: Complex business logic implemented in Java Can use the full power of Java JEE-like 3-tier architecture in the device Can leverage existing 3rd-party components
  • 19. Remote Service Access - Architecture UI Runtime (e.g. Browser) OSGi Remote Events Event Admin Application (e.g widget) RSR Convenience Library (e.g. JavaScript) Service Registry 3. find 2. export RSA 4. bind Service Service Object 5. use 1. register
  • 20. Widgets Locally installed web applications Support for W3C Widget specification Widget use HTML and CSS as the markup Metadata provided in config.xml Packaged as a ZIP Widgets are fully manageable via OSGi Secure widget execution: security context spans from OSGi to the Browser
  • 21. Remote Service Access Based on Distributed OSGi concept Bindings specified for JSON RPC – lightweight and fits JavaScript naturally Services can be marked for export Access point and skeleton automatically created IDL: Java – simple mapping to JavaScript (with some restrictions) Remote Service Registry (RSR) Available at a well-know URL Accessible via a well-known (JSON) web service interface
  • 22. Service Model Asymmetric: service provider OSGi, service consumer UI Runtime Synchronous method calls Parameters passed by value No callbacks, no listeners… Event support: to prevent polling in the applications Applications can subscribe to Event Admin topics
  • 23. Convenience Library Remote Service Access is specified in terms of protocols and access points Ensures interoperability with any UI Runtime A JavaScript convenience library is provided for better developer experience Simple API to access RSR – find and bind services Automatically generates stubs for using bound services Subscribe to remote events (listeners)
  • 24. How to make a remote service So, how to create a remote service? By flagging it “remotable”: org.osgi.remote.publish=true
  • 25. Best design practices for remote services Use simple types as parameters Primitive types and their wrappers Strings JavaBeans Classes with default constructor and public members Maps Arrays (homogeneous) Synchronous methods should return quickly If operation takes longer, use notifications Session-oriented services
  • 26. Session oriented services startSession: returns session ID Session ID used to identify an Event Admin topic. Notifications are delivered through that topic Session ID is used in each service request to identify the session asynchServiceMethod: returns request ID Events related to this request carry the request ID
  • 27.
  • 33. Status: sent, pending, delivered or failed
  • 35. Name
  • 36.
  • 37. Demo – Meet Me Here! Meet Me Here! is a simple web application Select a contact from the device contact list and send him a message The default message contains a Google Map URL with the current location of the user Implemented as a widget and a service bundle to access device features Three remote services: contacts, location, messaging Installed from a single deployment package
  • 38. Service Lookup and Binding <script src="http://localhost/rsr/rsr_1.0.js"> </script> <script type="text/javascript"> functionbindService(service) { varsreg = RSR.find(service,null); if( sreg ) { returnRSR.bind(sreg[0]); } else { alert("Can't find " + service + " service!"); } } const LOCATION= "com.prosyst.demo.rma.LocationService"; varlocationService = bindService(LOCATION); packagecom.prosyst.demo.rma; publicinterfaceLocationService { public Location getLocation(); } public class Activator implementsBundleActivator { public void start(BundleContext context) throws Exception { Hashtable props = newHashtable(); props.put( "org.osgi.remote.publish", Boolean.TRUE); this.locationService = newLocationServiceImpl(context); context.registerService( LocationService.class.getName(), this.locationService, props); …
  • 39. Service Usage varmsg = "Location service not available"; if( !locationService ) { locationService = bindService(LOCATION_SERVICE); } var location = false; if( locationService ) { location = locationService.getLocation(); } if( location ) { msg = "Meet Me Here: " + "http://maps.google.com/maps?q=" + location.latitude + ", " + location.longitude; } varsmsMessage = document.getElementById("smsMessage"); smsMessage.value = msg; packagecom.prosyst.demo.rma; publicinterfaceLocationService { public Location getLocation(); } public class Location { public double latitude; public double longitude; public double altitude; public long timestamp; }
  • 40. JSON RPC – Lightweight web service protocol Specification: http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html Request: {"version":"1.1","method":"getLocation","params":[]} Response: {"version":"1.1","result":{"altitude":0,"timestamp":1242744765930,"latitude":47.434006,"longitude":19.148868}}
  • 41. Demo
  • 42. Summary “Mobile Web Applications will beat native applications”Daniel K. Appelquist (http://www.torgo.com/blog/2008/10/mobile-web-native-apps.html) Using OSGi – you can take the best of both worlds: Web developers & designers build the front-end Java developers build the app logic … and OSGi ensures the transparent interworking. Having a server on the edge of the network changes the way things work.
  • 43. Where To Start? Devices: First MASS Deployment in US in 2009. – Project Name: Sprint Titan Shipping 5 device models during 2009 On 3 different platforms: Windows Mobile, BREW, 3rd platform OSGi for Android Download: http://dz.prosyst.com/oss#mBS_Android 2009 Sprint Open Developer Conference http://developer.sprint.com/devcon2009 My blog: http://picisblog.blogspot.com/
  • 45. Contact Gábor Pécsy g.pecsy@prosyst.com Mobile: +36 70 385 5821 http://picisblog.blogspot.com ProSyst Software GmbH Dürener Straße 405 D-50858 Cologne, Germany Tel. +49 221 6604-0 Fax +49 221 6604-660 info@prosyst.com www.prosyst.com Member of: