help me obr you are my only hope - osgi users forum uk 16-nov2011

30
www.paremus.com Copyright © 2011 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. November 2011 Help Me OBR,You’re My Only Hope David Savage [email protected] Help Me OBR, You’re My Only Hope

Upload: mfrancis

Post on 12-Jul-2015

1.816 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 2: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 3: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 4: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 5: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 6: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 7: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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...

Page 8: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 9: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 10: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 11: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 12: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 13: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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?

Page 14: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 15: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 16: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 17: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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>>

Page 18: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 19: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 20: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 21: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 22: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 23: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 24: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 25: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 26: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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..

Page 27: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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>

Page 28: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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

Page 29: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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!

Page 30: Help me obr you are my only hope - osgi users forum uk 16-nov2011

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