look inside your osgi bundles and build them block by block - fa kramer
DESCRIPTION
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.TRANSCRIPT
![Page 1: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/1.jpg)
March 2012 - Business Confidential - Bitreactive AS
Frank Alexander Kraemer
@fralkr
frank @ bitreactive.com
Look Inside Your OSGi Bundles and Build them Block by Block
EclipseCon Europe 2014 OSGi Community Event 2014
![Page 2: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/2.jpg)
Title - edit manually in the normal master 2
WithoutOSGi
![Page 3: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/3.jpg)
Title - edit manually in the normal master 3
With OSGi
![Page 4: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/4.jpg)
OSGiIoT Application Gateways
- roadside stations - onboard units - residential gateways - …
![Page 5: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/5.jpg)
![Page 6: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/6.jpg)
Title - edit manually in the normal master 6
![Page 7: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/7.jpg)
Title - edit manually in the normal master 7
![Page 8: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/8.jpg)
IoT Application Gateways- autonomous - remotely managed - interfaces to “things” - network connections
![Page 9: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/9.jpg)
Title - edit manually in the normal master 9
GPIOMain
Application Bundle
DB
ModbusMQTTRuntime
![Page 10: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/10.jpg)
Events- life cycle - other bundles - config changes - messages - network - handle hardware
![Page 11: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/11.jpg)
Concurrency
![Page 12: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/12.jpg)
![Page 13: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/13.jpg)
Title - edit manually in the normal master 13
![Page 14: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/14.jpg)
Title - edit manually in the normal master 14
public void start(BundleContext b) throws Exception {
}
// application goes here
![Page 15: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/15.jpg)
M2M Applications with Reactive Blocks
INHOLD Corporate Identity Manual 7
X
X X
X/2
X/2
LOGO SCALE GUIDELINES
The logo must be surrounded with adequate clear space to ensuremaximum 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.
min 15 mm
LOGO
![Page 16: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/16.jpg)
Title - edit manually in the normal master 16
TODO show the start() from the bundle method also here?
public void start(BundleContext b) throws Exception {
}
![Page 17: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/17.jpg)
Title - edit manually in the normal master 17
![Page 18: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/18.jpg)
public void ledOn() {logInfo("Switching on LED");leds[0].setState(true);
}
public void ledOff() {logInfo("Switching off LED");leds[0].setState(false);
}
![Page 19: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/19.jpg)
![Page 20: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/20.jpg)
![Page 21: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/21.jpg)
![Page 22: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/22.jpg)
![Page 23: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/23.jpg)
![Page 24: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/24.jpg)
![Page 25: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/25.jpg)
![Page 26: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/26.jpg)
Joining Data
![Page 27: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/27.jpg)
Buffering
![Page 28: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/28.jpg)
Limiting Data
![Page 29: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/29.jpg)
OSGi
![Page 30: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/30.jpg)
OSGi and Concurrency
Java Interfaces OSGi Events✔ Names✔ Types✘ Sequences✘ Timing
![Page 31: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/31.jpg)
Documentation?
![Page 32: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/32.jpg)
![Page 33: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/33.jpg)
![Page 34: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/34.jpg)
![Page 35: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/35.jpg)
![Page 36: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/36.jpg)
![Page 37: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/37.jpg)
![Page 38: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/38.jpg)
![Page 39: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/39.jpg)
![Page 40: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/40.jpg)
![Page 41: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/41.jpg)
![Page 42: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/42.jpg)
OSGi and Concurrency
Java Interfaces OSGi Events✔ Names✔ Types✘ Sequences✘ Timing
Building Blocks for OSGi
![Page 43: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/43.jpg)
Event Admin
Termination
Service Tracker
Remote Configuration
![Page 44: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/44.jpg)
Configuration
![Page 45: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/45.jpg)
![Page 46: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/46.jpg)
![Page 47: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/47.jpg)
![Page 48: Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer](https://reader034.vdocuments.mx/reader034/viewer/2022052316/559796c31a28ab6e538b460a/html5/thumbnails/48.jpg)
Next Steps:-bitreactive.com -IoT Playground -Tutorials