Download - Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Transcript
Page 1: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved

Getting started with OSGi

using a 3D OSGi Robot sample application

Christian Baranowski, SEITENBAU GmbH Jochen Hiller, Deutsche Telekom AG, Products & Innovation September 20th 2011

Page 1

Page 2: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

What is an OSGi Code Camp?

Experience from the first Camp

OSGi Alliance Marketing © 2008-2011 . All Rights Reserved Page 4

Page 3: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

#1 Agile Design

• Components

• Interaction

• “Post-it”-Design

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 6

Page 4: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

#2 Pair Programming

• Pair programming

• OSGi beginners/

experts

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 7

Page 5: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

#3 Communication

• Ad-hoc design of

component interaction

• Interfaces agreed

between pairs

• All developers in 1 room!

• Loud!

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 8

Page 6: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

#4 Test Driven Development

• Focus on OSGi concepts

• Too much time for

infrastructure setup

• No time for testing!

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 9

Page 7: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

#5 Continuous Delivery

• Build server

available

• No one did care

• Late integration

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 10

Page 8: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Summary and Lessons Learned

from the first Camp

We need…

• Development VM

• Cool application

• List of OSGi

concepts to be

implemented

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 11

Page 9: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Live Demo Mars Robot

How to teach OSGi by Example

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 12

Page 10: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Bundle Context API

and Lifecycle

• Simple provisioning

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 13

Page 11: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Separate Interface (Service API)

and Implementation Bundle

• Mars robot API and world implementation bundle

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 14

Page 12: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Whiteboard Pattern

• Simulator desktop bundle adding internal frames

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 15

Page 13: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Extender Pattern

and Bundle Tracker

• Adding static objects to mars world

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 16

Page 14: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Configuration Admin and

Metatype Service

• Creating wall and robot instances

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 17

Page 15: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Event Admin Service

• Integration sensor data view and world (event bus)

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 18

Page 16: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Extending the OSGi Console

(OSGi RFC 147 Draft)

• Robot commands to move and rotate the robot

• Shows how to use OSGi service properties

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 19

Page 17: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

OSGi Concepts

Should be added during the next camp

• Simulator by using the Event Admin Service

• Robot web control console with the HTTP Service

• WAR bundles (RFC66) to build a web console

• Remote robot console using OSGi Remote Services

• Service handling e.g. adding other object types to the world (balls) • with Service Tracker

• using Blueprint components

• Offer sensor and robot data by using Monitor Admin Service

• Add logging with the Log Service

• Preferences Service to persist some user settings (e.g. world size)

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 20

Page 18: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Conclusion

• Mars Robot is a cool application

• OSGi concepts can be demonstrated very easily

• Robot domain nice for running OSGi example

• Extensible in various areas

Mars robot as a “PetStore” for OSGi applications?

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 21

Page 19: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

OSGi Code Camp Berlin

• about

20 participants

• VirtualBox VM

• Felix, bndtools

• Hosted at Telekom

Laboratories

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 22

Page 20: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

Discusssion and Q&A

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 23

Page 21: Getting started with OSGi using a 3D OSGi Robot sample application - Christian Baranowski + Jochen Hiller

References

• Simbad 3D Robot Simulator http://simbad.sourceforge.net/

• Richard S. Hall et. al. OSGi in Action - Creating Modular Applications in Java

• Apache Felix: RFC 147 Overview http://felix.apache.org/site/apache-felix-gogo.html

• OSGi Code Camp 2010 – Konstanz http://germany.osgiusers.org/Main/SummerOCC2011

• OSGi Code Camp 2011 – Berlin

• http://germany.osgiusers.org/Main/SummerOCC2010

• bndtools http://bndtools.org

• Apache Felix Application Demonstration http://felix.apache.org/site/apache-felix-application-demonstration.html

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 24