Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Look Inside Your OSGi Bundles and 
Build them Block by Block 
Frank Alexander Kraemer 
@fralkr 
frank @ bitreactive.com 
M...
Without 
OSGi 
Title - edit manually in the normal master 2
With OSGi 
Title - edit manually in the normal master 3
OSGi 
IoT Application Gateways 
- roadside stations 
- onboard units 
- residential gateways 
- …
Title - edit manually in the normal master 6
Title - edit manually in the normal master 7
IoT Application Gateways 
- autonomous 
- remotely managed 
- interfaces to “things” 
- network connections
GPIO 
Main 
Application 
Bundle 
DB 
Runtime MQTT Modbus 
Title - edit manually in the normal master 9
Events 
- life cycle 
- other bundles 
- config changes 
- messages 
- network 
- handle hardware
Concurrency
Title - edit manually in the normal master 13
public void start(BundleContext b) 
throws Exception { 
// application goes here 
} 
Title - edit manually in the normal m...
M2M Applications with 
Reactive Blocks 
INHOLD Corporate X 
X X 
X/2 
X/2 
LOGO 
LOGO SCALE GUIDELINES 
The logo must be s...
public void start(BundleContext b) 
throws Exception { 
TODO show the start() from the bundle 
method also here? 
} 
Title...
Title - edit manually in the normal master 17
public void ledOn() { 
logInfo("Switching on LED"); 
leds[0].setState(true); 
} 
public void ledOff() { 
logInfo("Switchin...
Joining Data
Buffering
Limiting Data
OSGi
OSGi and Concurrency 
Java Interfaces OSGi Events 
✔ Names 
✔ Types 
✘ Sequences 
✘ Timing
Documentation 
?
OSGi and Concurrency 
Java Interfaces OSGi Events 
✔ Names 
✔ Types 
✘ Sequences 
✘ Timing 
Building Blocks 
for OSGi
Event Admin 
Termination 
Service Tracker 
Remote Configuration
Configuration
Next Steps: 
-bitreactive.com 
-IoT Playground 
-Tutorials
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Upcoming SlideShare
Loading in …5
×

Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer

682 views

Published on

OSGi Community Event 2014

Abstract:
OSGi provides the infrastructure to build applications from components and services, provided as bundles. But how can we work equally structured also within bundles? We show how to build OSGi bundles with Reactive Blocks, by plugging together building blocks. This makes it easy to handle concurrency, reuse behavior and find intricate concurrency errors automatically.

Let’s have a look at a typical OSGi application, for instance one that runs on a residential gateway. It needs to coordinate behavior of several other bundles, listen to incoming messages, respond in time, handle remote configuration changes and react on its own bundle life cycle. Also, the bundle should react properly when the network goes down or when required services get unavailable.

When so much happens in parallel, it get’s complicated. Concurrent programming is still a delicate art form. Code with lots of concurrency is hard to write and debug (race conditions, anyone?). The code is also hard to understand for any other developer that inherits it.

Reactive Blocks is a tool integrated with the Java tools in Eclipse. With it, Java code is organized in the form of building blocks, which can be plugged together using graphical data flows. The data flows make it easy to handle concurrency and synchronize behavior. But Reactive Blocks does not try to replace Java programming. Graphics and code work together. The data flows simply describe when Java operations are called.

Libraries of building blocks provide functions that are often used. As an example, libraries for OSGi provide building blocks to listen to other services and OSGi events. It's also possible to make new building blocks.

Applications are constructed by connecting building blocks. An automatic analysis checks the behavior of the application. You can detect, for instance, that a bundle contains logic that drives it into a deadlock instead of nicely shutting down.

The structure with building blocks makes it easier to keep the overview of an application, even if it is highly concurrent and complicated. Suddenly you can look inside your OSGi application bundle!

Speaker Bio:
Frank Alexander Kraemer studied Electrical Engineering and Information Technology at the University of Stuttgart, Germany, and received his Ph.D. from the Norwegian University of Science and Technology (NTNU) in 2008. Frank has experience with the development of software tools, initiated by an internship at IBM, Germany, where he helped integrating tools into the Eclipse platform. During the research for his Ph.D. thesis, he developed an engineering method for the design of reactive systems at the Department for Telematics, NTNU. The results of this research are usable with the Reactive Blocks tool, which is currently applied to a number of industrial projects. Frank is co-founder of Bitreactive AS, which helps other companies to deliver new applications built with Reactive Blocks.

Published in: Technology
  • Be the first to comment

Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer

  1. 1. Look Inside Your OSGi Bundles and Build them Block by Block Frank Alexander Kraemer @fralkr frank @ bitreactive.com March 2012 - Business Confidential - Bitreactive AS EclipseCon Europe 2014 OSGi Community Event 2014
  2. 2. Without OSGi Title - edit manually in the normal master 2
  3. 3. With OSGi Title - edit manually in the normal master 3
  4. 4. OSGi IoT Application Gateways - roadside stations - onboard units - residential gateways - …
  5. 5. Title - edit manually in the normal master 6
  6. 6. Title - edit manually in the normal master 7
  7. 7. IoT Application Gateways - autonomous - remotely managed - interfaces to “things” - network connections
  8. 8. GPIO Main Application Bundle DB Runtime MQTT Modbus Title - edit manually in the normal master 9
  9. 9. Events - life cycle - other bundles - config changes - messages - network - handle hardware
  10. 10. Concurrency
  11. 11. Title - edit manually in the normal master 13
  12. 12. public void start(BundleContext b) throws Exception { // application goes here } Title - edit manually in the normal master 14
  13. 13. M2M Applications with Reactive Blocks INHOLD Corporate X X X X/2 X/2 LOGO LOGO SCALE GUIDELINES The logo must be surrounded with adequate clear space to ensure maximum prominence and visual impact. All scaling of the logo is to be proportional. In case the logo needs to appear on a limited background, the minimum size allowed is not less than 15 mm.
  14. 14. public void start(BundleContext b) throws Exception { TODO show the start() from the bundle method also here? } Title - edit manually in the normal master 16
  15. 15. Title - edit manually in the normal master 17
  16. 16. public void ledOn() { logInfo("Switching on LED"); leds[0].setState(true); } public void ledOff() { logInfo("Switching off LED"); leds[0].setState(false); }
  17. 17. Joining Data
  18. 18. Buffering
  19. 19. Limiting Data
  20. 20. OSGi
  21. 21. OSGi and Concurrency Java Interfaces OSGi Events ✔ Names ✔ Types ✘ Sequences ✘ Timing
  22. 22. Documentation ?
  23. 23. OSGi and Concurrency Java Interfaces OSGi Events ✔ Names ✔ Types ✘ Sequences ✘ Timing Building Blocks for OSGi
  24. 24. Event Admin Termination Service Tracker Remote Configuration
  25. 25. Configuration
  26. 26. Next Steps: -bitreactive.com -IoT Playground -Tutorials

×