0
Building dynamic distributed data
stores with OSGi
http://www.paremus.com
info@paremus.com

Tim Ward
Dynamic Distributed D...
Who is Tim Ward?
@TimothyWard

• Senior Consulting Engineer and Architect at Paremus
• 5 years at IBM developing WebSphere...
What we’re going to cover

• OSGi Remote Services
• Deploying external processes using Packager
• Building Dynamically wir...
OSGi Remote Services

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus L...
OSGi Remote Services (1)

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Parem...
OSGi Remote Services (1)

• OSGi Bundles communicate using the Service Registry

Dynamic Distributed Data Stores in OSGi

...
OSGi Remote Services (1)

• OSGi Bundles communicate using the Service Registry
• This allows for dynamic, loosely coupled...
OSGi Remote Services (1)

• OSGi Bundles communicate using the Service Registry
• This allows for dynamic, loosely coupled...
OSGi Remote Services (1)

• OSGi Bundles communicate using the Service Registry
• This allows for dynamic, loosely coupled...
OSGi Remote Services (2)

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Parem...
OSGi Remote Services (2)

• Because OSGi services are loosely coupled they can come from anywhere!

Dynamic Distributed Da...
OSGi Remote Services (2)

• Because OSGi services are loosely coupled they can come from anywhere!
• Any service can be tr...
OSGi Remote Services (2)

• Because OSGi services are loosely coupled they can come from anywhere!
• Any service can be tr...
OSGi Remote Services (2)

• Because OSGi services are loosely coupled they can come from anywhere!
• Any service can be tr...
OSGi Remote Services (2)

• Because OSGi services are loosely coupled they can come from anywhere!
• Any service can be tr...
OSGi Remote Services (2)

• Because OSGi services are loosely coupled they can come from anywhere!
• Any service can be tr...
OSGi Remote Services (3)

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Parem...
OSGi Remote Services (3)

• Exposing a remote service is not transparent

Dynamic Distributed Data Stores in OSGi

Wednesd...
OSGi Remote Services (3)

• Exposing a remote service is not transparent

Network

objectclass =
{List, Collection}
Provid...
OSGi Remote Services (3)

• Exposing a remote service is not transparent
• Services opt-in using the service.exported.inte...
OSGi Remote Services (3)

• Exposing a remote service is not transparent
• Services opt-in using the service.exported.inte...
OSGi Remote Services (3)

• Exposing a remote service is not transparent
• Services opt-in using the service.exported.inte...
OSGi Remote Services and Remote Service Admin

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyrigh...
OSGi Remote Services and Remote Service Admin

• The OSGi Alliance has two specifications. Remote Services and Remote
Servi...
OSGi Remote Services and Remote Service Admin

• The OSGi Alliance has two specifications. Remote Services and Remote
Servi...
OSGi Remote Services and Remote Service Admin

• The OSGi Alliance has two specifications. Remote Services and Remote
Servi...
OSGi Remote Services and Remote Service Admin

• The OSGi Alliance has two specifications. Remote Services and Remote
Servi...
OSGi Remote Services and Remote Service Admin

• The OSGi Alliance has two specifications. Remote Services and Remote
Servi...
OSGi Remote Services and Remote Service Admin

• The OSGi Alliance has two specifications. Remote Services and Remote
Servi...
OSGi Remote Services and Remote Service Admin

• The OSGi Alliance has two specifications. Remote Services and Remote
Servi...
Packaging Applications with Packager

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 ...
Packager Aims and advantages

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 P...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles

Dynamic Distributed Data Stores in OSGi
...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Packager Aims and advantages

• Package programs as self-describing OSGi Bundles
• Allows Dynamic Resolution and Assembly ...
Approach

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus Ltd.
May not ...
Approach

• Wrap Native Artifacts in OSGi Bundles

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copy...
Approach

• Wrap Native Artifacts in OSGi Bundles
• Link the Artifact Lifecycle to OSGi.

Dynamic Distributed Data Stores ...
Approach

• Wrap Native Artifacts in OSGi Bundles
• Link the Artifact Lifecycle to OSGi.
• Bundle Install/Resolve/Start

D...
Approach

• Wrap Native Artifacts in OSGi Bundles
• Link the Artifact Lifecycle to OSGi.
• Bundle Install/Resolve/Start =>...
Approach

• Wrap Native Artifacts in OSGi Bundles
• Link the Artifact Lifecycle to OSGi.
• Bundle Install/Resolve/Start =>...
Approach

• Wrap Native Artifacts in OSGi Bundles
• Link the Artifact Lifecycle to OSGi.
• Bundle Install/Resolve/Start =>...
Approach

• Wrap Native Artifacts in OSGi Bundles
• Link the Artifact Lifecycle to OSGi.
• Bundle Install/Resolve/Start =>...
Separation of Concerns

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus...
Separation of Concerns

• What are we running, and how do we configure/run it?

Dynamic Distributed Data Stores in OSGi

We...
Separation of Concerns

• What are we running, and how do we configure/run it?
• Package Type Service

Dynamic Distributed ...
Separation of Concerns

• What are we running, and how do we configure/run it?
• Package Type Service
• When should we star...
Separation of Concerns

• What are we running, and how do we configure/run it?
• Package Type Service
• When should we star...
Separation of Concerns

• What are we running, and how do we configure/run it?
• Package Type Service
• When should we star...
Separation of Concerns

• What are we running, and how do we configure/run it?
• Package Type Service
• When should we star...
Packager Package Types

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus...
Package Type

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus Ltd.
May ...
Package Type

• Usually contains the native parts

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copy...
Package Type

• Usually contains the native parts
• Installs the Native Program

Dynamic Distributed Data Stores in OSGi

...
Package Type

• Usually contains the native parts
• Installs the Native Program
• Configures the program based on the suppl...
Package Type

• Usually contains the native parts
• Installs the Native Program
• Configures the program based on the suppl...
Package Type

• Usually contains the native parts
• Installs the Native Program
• Configures the program based on the suppl...
Package Type

• Usually contains the native parts
• Installs the Native Program
• Configures the program based on the suppl...
How the Package Type works

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Par...
How the Package Type works

• Installing an external process can take a long time

Dynamic Distributed Data Stores in OSGi...
How the Package Type works

• Installing an external process can take a long time
• Not suitable for running in a bundle’s...
How the Package Type works

• Installing an external process can take a long time
• Not suitable for running in a bundle’s...
How the Package Type works

• Installing an external process can take a long time
• Not suitable for running in a bundle’s...
How the Package Type works

• Installing an external process can take a long time
• Not suitable for running in a bundle’s...
How the Package Type works

• Installing an external process can take a long time
• Not suitable for running in a bundle’s...
How the Package Type works

• Installing an external process can take a long time
• Not suitable for running in a bundle’s...
How the Package Type works

• Installing an external process can take a long time
• Not suitable for running in a bundle’s...
Packager Process Guards

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremu...
Process Guard Service

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus ...
Process Guard Service

• Gathers Process Config Properties

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October ...
Process Guard Service

• Gathers Process Config Properties
• Existence signals When to Start/Stop

Dynamic Distributed Data...
Process Guard Service

• Gathers Process Config Properties
• Existence signals When to Start/Stop
• Receives State Change E...
Process Guard Service

• Gathers Process Config Properties
• Existence signals When to Start/Stop
• Receives State Change E...
Process Guard Service

• Gathers Process Config Properties
• Existence signals When to Start/Stop
• Receives State Change E...
How the Process Guard works

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Pa...
How the Process Guard works

• Most external processes require some level of configuration to run

Dynamic Distributed Data...
How the Process Guard works

• Most external processes require some level of configuration to run
• This configuration is of...
How the Process Guard works

• Most external processes require some level of configuration to run
• This configuration is of...
How the Process Guard works

• Most external processes require some level of configuration to run
• This configuration is of...
How the Process Guard works

• Most external processes require some level of configuration to run
• This configuration is of...
How the Process Guard works

• Most external processes require some level of configuration to run
• This configuration is of...
How the Process Guard works

• Most external processes require some level of configuration to run
• This configuration is of...
How the Process Guard works

• Most external processes require some level of configuration to run
• This configuration is of...
How the Process Guard works

• Most external processes require some level of configuration to run
• This configuration is of...
The Packager Manager

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus L...
The Packager Manager

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus L...
The Packager Manager

• Listens for matching Package Type and Process Guard Services

Dynamic Distributed Data Stores in O...
The Packager Manager

• Listens for matching Package Type and Process Guard Services
• One Package Type may match many Pro...
The Packager Manager

• Listens for matching Package Type and Process Guard Services
• One Package Type may match many Pro...
The Packager Manager

• Listens for matching Package Type and Process Guard Services
• One Package Type may match many Pro...
The Packager Manager

• Listens for matching Package Type and Process Guard Services
• One Package Type may match many Pro...
The Packager Manager

• Listens for matching Package Type and Process Guard Services
• One Package Type may match many Pro...
The Packager Manager

• Listens for matching Package Type and Process Guard Services
• One Package Type may match many Pro...
Packager Interactions
Package Type

Packager Manager

Process Guard

Dynamic Distributed Data Stores in OSGi

Wednesday, 3...
Packager Interactions
Package Type

Register services
Packager Manager

Process Guard

Dynamic Distributed Data Stores in ...
Packager Interactions
Package Type

Get Configuration
Packager Manager

Process Guard

Dynamic Distributed Data Stores in ...
Packager Interactions
Package Type

Packager Manager

Create Scripts and start!

Process Guard

Dynamic Distributed Data S...
Packager Interactions
Package Type

Packager Manager

Monitor and notify

Process Guard

Dynamic Distributed Data Stores i...
Packager Interactions
Package Type

Packager Manager

Shutdown on unregistration

Process Guard

Dynamic Distributed Data ...
Building dynamically wired systems with
Remote Services and Packager

Dynamic Distributed Data Stores in OSGi

Wednesday, ...
Publishing an Endpoint

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus...
Publishing an Endpoint

• How do you tell the rest of the framework that your external process
has started, or where it is...
Publishing an Endpoint

• How do you tell the rest of the framework that your external process
has started, or where it is...
Publishing an Endpoint

• How do you tell the rest of the framework that your external process
has started, or where it is...
Publishing an Endpoint

• How do you tell the rest of the framework that your external process
has started, or where it is...
Publishing an Endpoint

• How do you tell the rest of the framework that your external process
has started, or where it is...
Dynamically building configurations

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 -...
Dynamically building configurations

• Process Guard services can be very simple

Dynamic Distributed Data Stores in OSGi
...
Dynamically building configurations

• Process Guard services can be very simple
• Static properties

Dynamic Distributed ...
Dynamically building configurations

• Process Guard services can be very simple
• Static properties
• Injection from Confi...
Dynamically building configurations

• Process Guard services can be very simple
• Static properties
• Injection from Confi...
Dynamically building configurations

• Process Guard services can be very simple
• Static properties
• Injection from Confi...
Dynamically building configurations

• Process Guard services can be very simple
• Static properties
• Injection from Confi...
Dynamically building configurations

• Process Guard services can be very simple
• Static properties
• Injection from Confi...
Dynamically building configurations (2)

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 20...
Dynamically building configurations (2)

• Replicating this out over multiple nodes lets you dynamically assemble
large sy...
Dynamically building configurations (2)

• Replicating this out over multiple nodes lets you dynamically assemble
large sy...
Dynamically building configurations (2)

• Replicating this out over multiple nodes lets you dynamically assemble
large sy...
Dynamically building configurations (2)

• Replicating this out over multiple nodes lets you dynamically assemble
large sy...
Dynamically building configurations (2)

• Replicating this out over multiple nodes lets you dynamically assemble
large sy...
Dynamically building configurations (2)

• Replicating this out over multiple nodes lets you dynamically assemble
large sy...
Putting Packager to the test with Redis

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 20...
What is Redis?

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus Ltd.
Ma...
What is Redis?

• Redis is an open source key-value store (http://redis.io)

Dynamic Distributed Data Stores in OSGi

Wedn...
What is Redis?

• Redis is an open source key-value store (http://redis.io)
• Redis supports queries based on key or value...
What is Redis?

• Redis is an open source key-value store (http://redis.io)
• Redis supports queries based on key or value...
What is Redis?

• Redis is an open source key-value store (http://redis.io)
• Redis supports queries based on key or value...
What is Redis?

• Redis is an open source key-value store (http://redis.io)
• Redis supports queries based on key or value...
Demo

Dynamic Distributed Data Stores in OSGi

Wednesday, 30 October 13

Copyright © 2005 - 2013 Paremus Ltd.
May not be r...
Thanks!

• For more about OSGi...
• Specifications at http://www.osgi.org
• Enterprise OSGi in Action
• http://www.manning....
Upcoming SlideShare
Loading in...5
×

Building dynamic distributed data stores with OSGi - Tim Ward

806

Published on

OSGi Community Event 2013 (http://www.osgi.org/CommunityEvent2013/Schedule)

ABSTRACT
Managing large distributed runtimes can be very hard, particularly when it comes to configuration. Tools like Puppet and Chef try to solve this by automating configuration rollout, but it can be very hard to cope when parts of the runtime need to be moved, or the underlying platform changes.

OSGi is a powerful modularity framework for Java, but it also provides support for dynamic life-cycles and loosely coupled service interactions. This makes OSGi an ideal tool for configuring and managing distributed environments, especially when responding to change.


In this talk you will see how an OSGi framework can be used to manage external processes, and how by using OSGi Remote Services it is possible to automatically configure these processes into a resilient, distributed NoSQL store that adapts to its environment.

SPEAKER BIO
Tim Ward is a Principal Engineer at Paremus Ltd, a co-author of Enterprise OSGi in Action, and has been actively working with OSGi for over five years. Tim has been a regular participant in the OSGi Core Platform and Enterprise Expert Groups, and led development of several specifications. Tim is also an active Open Source committer and a PMC member in the Apache Aries project, which provides a container for enterprise OSGi applications.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
806
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
24
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Building dynamic distributed data stores with OSGi - Tim Ward"

  1. 1. Building dynamic distributed data stores with OSGi http://www.paremus.com info@paremus.com Tim Ward Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  2. 2. Who is Tim Ward? @TimothyWard • Senior Consulting Engineer and Architect at Paremus • 5 years at IBM developing WebSphere Application Server • Container Implementation experience with Java EE and OSGi, including Blueprint, JPA, EJB and JTA • OSGi Specification lead for JPA and Bytecode Weaving • PMC member of the Apache Aries project • Previous speaker at EclipseCon, Devoxx, Jazoon, JAX London, OSGi Community Event... • Author of Manning’s Enterprise OSGi in Action • http://www.manning.com/cummins Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  3. 3. What we’re going to cover • OSGi Remote Services • Deploying external processes using Packager • Building Dynamically wired distributed systems • Demo Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  4. 4. OSGi Remote Services Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  5. 5. OSGi Remote Services (1) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  6. 6. OSGi Remote Services (1) • OSGi Bundles communicate using the Service Registry Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  7. 7. OSGi Remote Services (1) • OSGi Bundles communicate using the Service Registry • This allows for dynamic, loosely coupled interaction Provider A Consumer Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  8. 8. OSGi Remote Services (1) • OSGi Bundles communicate using the Service Registry • This allows for dynamic, loosely coupled interaction Provider A Consumer Provider B Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  9. 9. OSGi Remote Services (1) • OSGi Bundles communicate using the Service Registry • This allows for dynamic, loosely coupled interaction Provider A Consumer Provider B Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  10. 10. OSGi Remote Services (2) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  11. 11. OSGi Remote Services (2) • Because OSGi services are loosely coupled they can come from anywhere! Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  12. 12. OSGi Remote Services (2) • Because OSGi services are loosely coupled they can come from anywhere! • Any service can be transparently remoted * Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  13. 13. OSGi Remote Services (2) • Because OSGi services are loosely coupled they can come from anywhere! • Any service can be transparently remoted * • Service properties are made available remotely too Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  14. 14. OSGi Remote Services (2) • Because OSGi services are loosely coupled they can come from anywhere! • Any service can be transparently remoted * • Service properties are made available remotely too Network Provider A Wormhole Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  15. 15. OSGi Remote Services (2) • Because OSGi services are loosely coupled they can come from anywhere! • Any service can be transparently remoted * • Service properties are made available remotely too Network Provider A Consumer Wormhole Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  16. 16. OSGi Remote Services (2) • Because OSGi services are loosely coupled they can come from anywhere! • Any service can be transparently remoted * • Service properties are made available remotely too Network Provider A Consumer Wormhole * Make sure your service is actually suitable for remoting! Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  17. 17. OSGi Remote Services (3) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  18. 18. OSGi Remote Services (3) • Exposing a remote service is not transparent Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  19. 19. OSGi Remote Services (3) • Exposing a remote service is not transparent Network objectclass = {List, Collection} Provider A Consumer Wormhole Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  20. 20. OSGi Remote Services (3) • Exposing a remote service is not transparent • Services opt-in using the service.exported.interfaces property Network objectclass = {List, Collection} Provider A Consumer Wormhole Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  21. 21. OSGi Remote Services (3) • Exposing a remote service is not transparent • Services opt-in using the service.exported.interfaces property objectclass = {Collection} Network objectclass = {List, Collection} Provider A Consumer Wormhole Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 service.exported.interfaces = {Collection} Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  22. 22. OSGi Remote Services (3) • Exposing a remote service is not transparent • Services opt-in using the service.exported.interfaces property • Imported services are marked with a service.imported = true objectclass = {Collection} Network objectclass = {List, Collection} Provider A Consumer service.imported = true Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Wormhole service.exported.interfaces = {Collection} Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  23. 23. OSGi Remote Services and Remote Service Admin Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  24. 24. OSGi Remote Services and Remote Service Admin • The OSGi Alliance has two specifications. Remote Services and Remote Service Admin (RSA) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  25. 25. OSGi Remote Services and Remote Service Admin • The OSGi Alliance has two specifications. Remote Services and Remote Service Admin (RSA) • What I have described is Remote Services Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  26. 26. OSGi Remote Services and Remote Service Admin • The OSGi Alliance has two specifications. Remote Services and Remote Service Admin (RSA) • What I have described is Remote Services • The underlying implementation is completely unspecified Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  27. 27. OSGi Remote Services and Remote Service Admin • The OSGi Alliance has two specifications. Remote Services and Remote Service Admin (RSA) • What I have described is Remote Services • The underlying implementation is completely unspecified • RSA builds on Remote Services, and is more prescriptive Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  28. 28. OSGi Remote Services and Remote Service Admin • The OSGi Alliance has two specifications. Remote Services and Remote Service Admin (RSA) • What I have described is Remote Services • The underlying implementation is completely unspecified • RSA builds on Remote Services, and is more prescriptive • Pluggable distribution mechanisms (WS, RMI, JMS...) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  29. 29. OSGi Remote Services and Remote Service Admin • The OSGi Alliance has two specifications. Remote Services and Remote Service Admin (RSA) • What I have described is Remote Services • The underlying implementation is completely unspecified • RSA builds on Remote Services, and is more prescriptive • Pluggable distribution mechanisms (WS, RMI, JMS...) • Pluggable discovery mechanisms (SLP, mDNS, Zookeeper...) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  30. 30. OSGi Remote Services and Remote Service Admin • The OSGi Alliance has two specifications. Remote Services and Remote Service Admin (RSA) • What I have described is Remote Services • The underlying implementation is completely unspecified • RSA builds on Remote Services, and is more prescriptive • Pluggable distribution mechanisms (WS, RMI, JMS...) • Pluggable discovery mechanisms (SLP, mDNS, Zookeeper...) • Notifications for “Topology Manager” bundles to decide which services to export/import Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  31. 31. Packaging Applications with Packager Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  32. 32. Packager Aims and advantages Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  33. 33. Packager Aims and advantages • Package programs as self-describing OSGi Bundles Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  34. 34. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  35. 35. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes • Can be semantically versioned Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  36. 36. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes • Can be semantically versioned • Leverage the existing bundle/service lifecycle and API Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  37. 37. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes • Can be semantically versioned • Leverage the existing bundle/service lifecycle and API • Allow processes to be installed and uninstalled in a running system Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  38. 38. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes • Can be semantically versioned • Leverage the existing bundle/service lifecycle and API • Allow processes to be installed and uninstalled in a running system • Allow processes to be dynamically started and stopped Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  39. 39. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes • Can be semantically versioned • Leverage the existing bundle/service lifecycle and API • Allow processes to be installed and uninstalled in a running system • Allow processes to be dynamically started and stopped • Allow integration with other OSGi specification Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  40. 40. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes • Can be semantically versioned • Leverage the existing bundle/service lifecycle and API • Allow processes to be installed and uninstalled in a running system • Allow processes to be dynamically started and stopped • Allow integration with other OSGi specification • Dynamic Configuration using Config Admin, Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  41. 41. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes • Can be semantically versioned • Leverage the existing bundle/service lifecycle and API • Allow processes to be installed and uninstalled in a running system • Allow processes to be dynamically started and stopped • Allow integration with other OSGi specification • Dynamic Configuration using Config Admin, • Use and provide Local and Remote Services Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  42. 42. Packager Aims and advantages • Package programs as self-describing OSGi Bundles • Allows Dynamic Resolution and Assembly of runtimes • Can be semantically versioned • Leverage the existing bundle/service lifecycle and API • Allow processes to be installed and uninstalled in a running system • Allow processes to be dynamically started and stopped • Allow integration with other OSGi specification • Dynamic Configuration using Config Admin, • Use and provide Local and Remote Services • Allow existing code to be packaged without change Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  43. 43. Approach Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  44. 44. Approach • Wrap Native Artifacts in OSGi Bundles Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  45. 45. Approach • Wrap Native Artifacts in OSGi Bundles • Link the Artifact Lifecycle to OSGi. Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  46. 46. Approach • Wrap Native Artifacts in OSGi Bundles • Link the Artifact Lifecycle to OSGi. • Bundle Install/Resolve/Start Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 => Artifact “install” Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  47. 47. Approach • Wrap Native Artifacts in OSGi Bundles • Link the Artifact Lifecycle to OSGi. • Bundle Install/Resolve/Start => Artifact “install” • Service registration/unregistration => Artifact “run/stop” Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  48. 48. Approach • Wrap Native Artifacts in OSGi Bundles • Link the Artifact Lifecycle to OSGi. • Bundle Install/Resolve/Start => Artifact “install” • Service registration/unregistration => Artifact “run/stop” • Bundle Uninstall => Artifact “uninstall” Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  49. 49. Approach • Wrap Native Artifacts in OSGi Bundles • Link the Artifact Lifecycle to OSGi. • Bundle Install/Resolve/Start => Artifact “install” • Service registration/unregistration => Artifact “run/stop” • Bundle Uninstall => Artifact “uninstall” • Link to Standard OSGi Services: Configuration Admin, Metatype, Log Service... Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  50. 50. Approach • Wrap Native Artifacts in OSGi Bundles • Link the Artifact Lifecycle to OSGi. • Bundle Install/Resolve/Start => Artifact “install” • Service registration/unregistration => Artifact “run/stop” • Bundle Uninstall => Artifact “uninstall” • Link to Standard OSGi Services: Configuration Admin, Metatype, Log Service... <system name="BackEnd:MongoDB" boundary="fibre"> <!-- MongoDB package --> <system.part category="msf" name="com.paremus.packager.demos.mongo.guard"> <property name="port" value="27017" /> </system.part> </system> Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  51. 51. Separation of Concerns Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  52. 52. Separation of Concerns • What are we running, and how do we configure/run it? Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  53. 53. Separation of Concerns • What are we running, and how do we configure/run it? • Package Type Service Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  54. 54. Separation of Concerns • What are we running, and how do we configure/run it? • Package Type Service • When should we start it, and what configuration properties should we use? Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  55. 55. Separation of Concerns • What are we running, and how do we configure/run it? • Package Type Service • When should we start it, and what configuration properties should we use? • Process Guard Service Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  56. 56. Separation of Concerns • What are we running, and how do we configure/run it? • Package Type Service • When should we start it, and what configuration properties should we use? • Process Guard Service • Actually invoke the start/stop scripts, and monitor the state of the external process Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  57. 57. Separation of Concerns • What are we running, and how do we configure/run it? • Package Type Service • When should we start it, and what configuration properties should we use? • Process Guard Service • Actually invoke the start/stop scripts, and monitor the state of the external process • Packager Manager/Watchdog Process Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  58. 58. Packager Package Types Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  59. 59. Package Type Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  60. 60. Package Type • Usually contains the native parts Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  61. 61. Package Type • Usually contains the native parts • Installs the Native Program Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  62. 62. Package Type • Usually contains the native parts • Installs the Native Program • Configures the program based on the supplied config Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  63. 63. Package Type • Usually contains the native parts • Installs the Native Program • Configures the program based on the supplied config • Returns scripts to the Packager for: start, stop, ping... Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  64. 64. Package Type • Usually contains the native parts • Installs the Native Program • Configures the program based on the supplied config • Returns scripts to the Packager for: start, stop, ping... • Is (usually) platform specific Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  65. 65. Package Type • Usually contains the native parts • Installs the Native Program • Configures the program based on the supplied config • Returns scripts to the Packager for: start, stop, ping... • Is (usually) platform specific Provide-Capability: packager.type; packager.type=mongodb; version:Version=2.2.0 Require-Capability: osgi.native; filter:=”(& (osgi.native.osname=Linux) (osgi.native.processor=x86-64) )” Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  66. 66. How the Package Type works Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  67. 67. How the Package Type works • Installing an external process can take a long time Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  68. 68. How the Package Type works • Installing an external process can take a long time • Not suitable for running in a bundle’s Activator! Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  69. 69. How the Package Type works • Installing an external process can take a long time • Not suitable for running in a bundle’s Activator! • Installation should be asynchronous with respect to bundle start Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  70. 70. How the Package Type works • Installing an external process can take a long time • Not suitable for running in a bundle’s Activator! • Installation should be asynchronous with respect to bundle start • Run on a separate thread? Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  71. 71. How the Package Type works • Installing an external process can take a long time • Not suitable for running in a bundle’s Activator! • Installation should be asynchronous with respect to bundle start • Run on a separate thread? • Install on demand? Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  72. 72. How the Package Type works • Installing an external process can take a long time • Not suitable for running in a bundle’s Activator! • Installation should be asynchronous with respect to bundle start • Run on a separate thread? • Install on demand? • Notify possible clients when a type is “ready” using the whiteboard pattern Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  73. 73. How the Package Type works • Installing an external process can take a long time • Not suitable for running in a bundle’s Activator! • Installation should be asynchronous with respect to bundle start • Run on a separate thread? • Install on demand? • Notify possible clients when a type is “ready” using the whiteboard pattern • Service properties advertise what the external process is Package Type Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  74. 74. How the Package Type works • Installing an external process can take a long time • Not suitable for running in a bundle’s Activator! • Installation should be asynchronous with respect to bundle start • Run on a separate thread? • Install on demand? • Notify possible clients when a type is “ready” using the whiteboard pattern • Service properties advertise what the external process is • Service unregisters to “uninstall” Package Type Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  75. 75. Packager Process Guards Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  76. 76. Process Guard Service Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  77. 77. Process Guard Service • Gathers Process Config Properties Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  78. 78. Process Guard Service • Gathers Process Config Properties • Existence signals When to Start/Stop Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  79. 79. Process Guard Service • Gathers Process Config Properties • Existence signals When to Start/Stop • Receives State Change Events (started, crashed...) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  80. 80. Process Guard Service • Gathers Process Config Properties • Existence signals When to Start/Stop • Receives State Change Events (started, crashed...) • Advertises the Running Package (Optional) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  81. 81. Process Guard Service • Gathers Process Config Properties • Existence signals When to Start/Stop • Receives State Change Events (started, crashed...) • Advertises the Running Package (Optional) • Usually platform independent Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  82. 82. How the Process Guard works Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  83. 83. How the Process Guard works • Most external processes require some level of configuration to run Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  84. 84. How the Process Guard works • Most external processes require some level of configuration to run • This configuration is often platform independent Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  85. 85. How the Process Guard works • Most external processes require some level of configuration to run • This configuration is often platform independent • When a process should be started the process guard registers a service Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  86. 86. How the Process Guard works • Most external processes require some level of configuration to run • This configuration is often platform independent • When a process should be started the process guard registers a service • Another example of using the whiteboard pattern Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  87. 87. How the Process Guard works • Most external processes require some level of configuration to run • This configuration is often platform independent • When a process should be started the process guard registers a service • Another example of using the whiteboard pattern • It uses the same service properties as the package type Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  88. 88. How the Process Guard works • Most external processes require some level of configuration to run • This configuration is often platform independent • When a process should be started the process guard registers a service • Another example of using the whiteboard pattern • It uses the same service properties as the package type • Often implemented as a ManagedService or ManagedServiceFactory Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  89. 89. How the Process Guard works • Most external processes require some level of configuration to run • This configuration is often platform independent • When a process should be started the process guard registers a service • Another example of using the whiteboard pattern • It uses the same service properties as the package type • Often implemented as a ManagedService or ManagedServiceFactory • Automatically Inject/Delete the configuration for the process Process Guard Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  90. 90. How the Process Guard works • Most external processes require some level of configuration to run • This configuration is often platform independent • When a process should be started the process guard registers a service • Another example of using the whiteboard pattern • It uses the same service properties as the package type • Often implemented as a ManagedService or ManagedServiceFactory • Automatically Inject/Delete the configuration for the process Config Admin Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Process Guard Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  91. 91. How the Process Guard works • Most external processes require some level of configuration to run • This configuration is often platform independent • When a process should be started the process guard registers a service • Another example of using the whiteboard pattern • It uses the same service properties as the package type • Often implemented as a ManagedService or ManagedServiceFactory • Automatically Inject/Delete the configuration for the process Config Admin Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Process Guard Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  92. 92. The Packager Manager Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  93. 93. The Packager Manager Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  94. 94. The Packager Manager • Listens for matching Package Type and Process Guard Services Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  95. 95. The Packager Manager • Listens for matching Package Type and Process Guard Services • One Package Type may match many Process Guards Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  96. 96. The Packager Manager • Listens for matching Package Type and Process Guard Services • One Package Type may match many Process Guards • For every pair the packager manager starts an instance of the process Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  97. 97. The Packager Manager • Listens for matching Package Type and Process Guard Services • One Package Type may match many Process Guards • For every pair the packager manager starts an instance of the process • Configured by the Package Type with properties from the Process Guard Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  98. 98. The Packager Manager • Listens for matching Package Type and Process Guard Services • One Package Type may match many Process Guards • For every pair the packager manager starts an instance of the process • Configured by the Package Type with properties from the Process Guard • A ‘Watchdog’ monitors the process (using scripts from the package type) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  99. 99. The Packager Manager • Listens for matching Package Type and Process Guard Services • One Package Type may match many Process Guards • For every pair the packager manager starts an instance of the process • Configured by the Package Type with properties from the Process Guard • A ‘Watchdog’ monitors the process (using scripts from the package type) • Sends notifications to the Process Guard about the state of the process Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  100. 100. The Packager Manager • Listens for matching Package Type and Process Guard Services • One Package Type may match many Process Guards • For every pair the packager manager starts an instance of the process • Configured by the Package Type with properties from the Process Guard • A ‘Watchdog’ monitors the process (using scripts from the package type) • Sends notifications to the Process Guard about the state of the process • If either service is unregistered then the process is shut down Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  101. 101. Packager Interactions Package Type Packager Manager Process Guard Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  102. 102. Packager Interactions Package Type Register services Packager Manager Process Guard Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  103. 103. Packager Interactions Package Type Get Configuration Packager Manager Process Guard Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  104. 104. Packager Interactions Package Type Packager Manager Create Scripts and start! Process Guard Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  105. 105. Packager Interactions Package Type Packager Manager Monitor and notify Process Guard Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  106. 106. Packager Interactions Package Type Packager Manager Shutdown on unregistration Process Guard Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  107. 107. Building dynamically wired systems with Remote Services and Packager Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  108. 108. Publishing an Endpoint Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  109. 109. Publishing an Endpoint • How do you tell the rest of the framework that your external process has started, or where it is? Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  110. 110. Publishing an Endpoint • How do you tell the rest of the framework that your external process has started, or where it is? • The whiteboard pattern to the rescue again! Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  111. 111. Publishing an Endpoint • How do you tell the rest of the framework that your external process has started, or where it is? • The whiteboard pattern to the rescue again! • The Process Guard can register an “Endpoint” with a marker interface and a service property with a URI to the process Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  112. 112. Publishing an Endpoint • How do you tell the rest of the framework that your external process has started, or where it is? • The whiteboard pattern to the rescue again! • The Process Guard can register an “Endpoint” with a marker interface and a service property with a URI to the process • It can also make this remotely available... Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  113. 113. Publishing an Endpoint • How do you tell the rest of the framework that your external process has started, or where it is? • The whiteboard pattern to the rescue again! • The Process Guard can register an “Endpoint” with a marker interface and a service property with a URI to the process • It can also make this remotely available... • Suddenly the process is discoverable in every framework Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  114. 114. Dynamically building configurations Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  115. 115. Dynamically building configurations • Process Guard services can be very simple Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  116. 116. Dynamically building configurations • Process Guard services can be very simple • Static properties Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  117. 117. Dynamically building configurations • Process Guard services can be very simple • Static properties • Injection from Config Admin Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  118. 118. Dynamically building configurations • Process Guard services can be very simple • Static properties • Injection from Config Admin • They can also wait and listen for Endpoints (local and remote!) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  119. 119. Dynamically building configurations • Process Guard services can be very simple • Static properties • Injection from Config Admin • They can also wait and listen for Endpoints (local and remote!) • Trigger a ManagedServiceFactory with part of the configuration Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  120. 120. Dynamically building configurations • Process Guard services can be very simple • Static properties • Injection from Config Admin • They can also wait and listen for Endpoints (local and remote!) • Trigger a ManagedServiceFactory with part of the configuration • Listen for the Endpoint, complete the configuration Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  121. 121. Dynamically building configurations • Process Guard services can be very simple • Static properties • Injection from Config Admin • They can also wait and listen for Endpoints (local and remote!) • Trigger a ManagedServiceFactory with part of the configuration • Listen for the Endpoint, complete the configuration • Register the Process Guard! Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  122. 122. Dynamically building configurations (2) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  123. 123. Dynamically building configurations (2) • Replicating this out over multiple nodes lets you dynamically assemble large systems with little to no manual configuration input Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  124. 124. Dynamically building configurations (2) • Replicating this out over multiple nodes lets you dynamically assemble large systems with little to no manual configuration input • Java EE servers Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  125. 125. Dynamically building configurations (2) • Replicating this out over multiple nodes lets you dynamically assemble large systems with little to no manual configuration input • Java EE servers • Messaging infrastructure Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  126. 126. Dynamically building configurations (2) • Replicating this out over multiple nodes lets you dynamically assemble large systems with little to no manual configuration input • Java EE servers • Messaging infrastructure • NoSQL stores Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  127. 127. Dynamically building configurations (2) • Replicating this out over multiple nodes lets you dynamically assemble large systems with little to no manual configuration input • Java EE servers • Messaging infrastructure • NoSQL stores • Because OSGi services are dynamic we can track the service to see if the endpoint moves! Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  128. 128. Dynamically building configurations (2) • Replicating this out over multiple nodes lets you dynamically assemble large systems with little to no manual configuration input • Java EE servers • Messaging infrastructure • NoSQL stores • Because OSGi services are dynamic we can track the service to see if the endpoint moves! • Automatic reconfiguration can rewire the system if a node fails! Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  129. 129. Putting Packager to the test with Redis Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  130. 130. What is Redis? Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  131. 131. What is Redis? • Redis is an open source key-value store (http://redis.io) Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  132. 132. What is Redis? • Redis is an open source key-value store (http://redis.io) • Redis supports queries based on key or value data Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  133. 133. What is Redis? • Redis is an open source key-value store (http://redis.io) • Redis supports queries based on key or value data • Values can be rich objects like hashes, lists sets or sorted sets Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  134. 134. What is Redis? • Redis is an open source key-value store (http://redis.io) • Redis supports queries based on key or value data • Values can be rich objects like hashes, lists sets or sorted sets • Redis supports replication to read-only “slave” nodes Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  135. 135. What is Redis? • Redis is an open source key-value store (http://redis.io) • Redis supports queries based on key or value data • Values can be rich objects like hashes, lists sets or sorted sets • Redis supports replication to read-only “slave” nodes • Wouldn’t it be nice to automatically configure the slaves? Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  136. 136. Demo Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Oct 2013
  137. 137. Thanks! • For more about OSGi... • Specifications at http://www.osgi.org • Enterprise OSGi in Action • http://www.manning.com/cummins • For more about Packager... • http://www.bundlerepo.org:8090/display/SF110/Packager Questions? Dynamic Distributed Data Stores in OSGi Wednesday, 30 October 13 Copyright © 2005 - 2013 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. http://www.paremus.com info@paremus.com Oct 2013
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×