More Related Content Similar to OSGi Mars World in Action Similar to OSGi Mars World in Action (20) More from Christian Baranowski More from Christian Baranowski (20) OSGi Mars World in Action1. 20
12
OSGi Mars World in
Action Christian Baranowski
2. Welcome
• Christian Baranowski
• Software Qualitätssicherung @ SEITENBAU Gmbh Konstanz (DE)
• Custom Software Solutions
• E-Government Solutions
• Identity Management and SSO Solutions
• www.seitenbau.de
• Vorstand OSGi Users' Forum Germany
• Co-lead (mit Jochen Hiller) German Enterprise Working Group.
• OSGi Code Camp
6. OSGi
A
Service
B
Modularity
Modules Lifecycle Services
7. OSGi
A
Service
B
Modularity
Modules Lifecycle Services
Security
13.
A
Service
B
Modularity
Modules Lifecycle Services
Security
16. OSGi Specification World
OSGi Enterprise
Version R5
Compendium Specification
Version 4.3
OSGi Core
Version 4.3 / R5
18. Open Source
OSGi Frameworks
Core
Enterprise
Compendium
Apache Felix (ASL) Apache Aris (ASL)
http://felix.apache.org/ http://aries.apache.org
Eclipse Equinox (EPL) Eclipse Gemini (EPL)
http://eclipse.org/equinox/ http://www.eclipse.org/gemini/
24. Extender Pattern
OSGi
Framework
listen
Bundle A
Extender Bundle B Matching
Bundles
Bundle C
do work for Bundle
Bundle D Non-matching
Bundle
42. Service Registry
Provider
Name Value
type api.Echo
- register availavility 5
- unregister
Consumer
Name Value - get
- listen
type api.Echo
availavility 5 Service Registry
... ...
44. Demo
OSGi Declarative Services
Provider
47. Bundle
scr:component name=InfoConsumer
scr:component name=InfoProvider implementation class=..InfoConsumer/
implementation class=..RobotInfoComponent/ reference name=RobotInformation
service interface=.. RobotInformation
provide interface=..RobotInformation / bind=setInfo unbind=unsetInfo /
/service /scr:component
/scr:component
51. Bundle @Component
public class SysoutRobotInformation {
@Component
public class RobotInformationComponent implements RobotInformation { RobotInformation information;
ListString robotNames = new ArrayListString(); @Reference
public void setInformation(RobotInformation i) {
@Reference(multiple=true, dynamic=true) this.information = i;
public void addRobot(Robot robot) { }
robotNames.add(robot.getName());
} @Reference
public void unsetInformation(RobotInformation i) {
public void removeRobot(Robot robot) { this.information = null;
robotNames.remove(robot.getName()); }
}
}
@Override
public ListString getRobotNames() {
return robotNames;
}
}
59. QA
Twitter @tux2323
References
Simbad 3D Robot Simulator - http://simbad.sourceforge.net/
OSGi in Action (ISBN 1933988916)
Richard S. Hall, Karl Pauls, Stuart McCulloch, and David Savage
Why OSGi?
BJ Hargrave (IBM), Peter Kriens (aQute)
http://www.slideshare.net/bjhargrave/why-osgi
Bndtools - http://bndtools.org/
OSGi Demo Mars Robot Project
http://code.google.com/a/eclipselabs.org/p/occ/