help me obr you are my only hope - osgi users forum uk 16-nov2011
TRANSCRIPT
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
David [email protected]
Help Me OBR, You’re My Only Hope
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Help Me OBR, You’re My Only Hope
A Brief Introduction To The OSGi Bundle Repository
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
A Long Time Ago...
• OSGi Bundle Repository
• Motivation, History
• Main Aspects
• Benefits, Impact on Ecosystem
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Common OSGi Pain Points
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Dependency Management:
• Development
• Deployment
• Runtime
• Which bundles to install when, why, how
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
The Story So Far...
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Informally specified & implemented by Richard Hall ~2004, add-on to Felix
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Various problems:
• Provisioning external runtimes
• Distinction between development/runtime
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Others:
• P2
• Nimble
• Sigil
• Maven
• Ivy
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Official OBR revived in 2009 by Hal Hildebrand
• Spec'd by David Savage in EEG
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
The Problem
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
OBR Is...
• Primarily a standardised Model to describe:
• Which Bundles are available?
• What do they do?
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
OBR Is Not...
• A management agent/deployer:
• “calculator only”
• A “server” or “database”:
• no defined protocol
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Main Aspects
• Repository
• Resolver
• Interchange Format
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Uses 4.3 concept of "wiring"
• Implements often requested functionality for introspection
A New Model
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Environment
Resource
BundleRevision
Wire
BundleWire
Requirement
BundleRequirement
Capability
BundleCapability
<<contains>>
<<expressed by>> <<provides>>
<<connected by>> <<connected to>>
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Resources can be physical or virtual
• Resources have Requirements and Capabilities
Capability Requirement
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Capabilities have a namespace and a map of attributes
• Requirements have a namespace and a set of directives
Capability Requirement
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• A Requirement matches a Capability if the namespaces are equal and the directives match the attributes
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
• Capabilities:
• osgi.identity → Unique per resource
• osgi.content → Checksums, SCM, etc
• Requirements:
• osgi.wiring.package → Import-Package
• osgi.wiring.bundle → Require-Bundle
Common Namespaces
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Repository
• Repository: simple service(s) that provide resources with capabilities
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Resolution
• Resources + Wiring = Environment
• Environment + Requirements = Resolution
A
D
C
B
D
C A
B
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
An Example
ServletBundle
Active Servlet
Container
ServletContainerProvider
osgi.service=servlet.containereffective=active
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Subsystems
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Interchange Format
• Based on XML Schema
• Human-readable Name & URI for repository identity
• Version increment (long)
• Resource URLs, Size, Checksums..
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
<?xml version=”1.0”?><repository name=”example” increment=”1” targetNamespace=”http://www.osgi.org/xmlns/obr/v1.0.0”><resource> <capability namespace=”osgi.identity”> <attribute name=”osgi.identity” value=”org.foo.mumble” /> <attribute name=”version” type=”version” value=”1.0.0” /> <attribute name=”type” value=”osgi.bundle” /> </capability> <capability namespace=”osgi.content”> <attribute name=”osgi.content” value=”org/foo/org.foo.mumble-1.0.0.jar” /> <attribute name=”size” type=”long” value=”46725” /> <attribute name=”checksum” value=”1bafd2ece2e88db4cdf835a7f8f0de65fab5b1147977a5dcc59b7c1b8c6f5080” /> </capability> </resource></repository>
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Leftovers
• Limited resolution failure introspection
• Repository event model
• License handling
• Web based service
• Deployment model → Subsystems
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Conclusion
• OBR:
• Small, robust, reliable
• Fixes Things Automatically
• Gets The Job Done!
www.paremus.comCopyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
November 2011Help Me OBR, You’re My Only Hope
Questions?
• Email: [email protected]
• Twitter: @davemssavage
• Blog: http://chronological-thought.blogspot.com
• Book: http://www.manning.com/hall/
• Paremus: http://www.paremus.com
• OSGi: http://www.osgi.org