This document discusses clustering OSGi applications using distributed shared memory. It proposes using distributed shared memory to replicate OSGi services across multiple platforms. This allows services to be clustered without reengineering. The approach is validated using several use cases including event propagation and state sharing for mobile games. Future work includes enhancing the Terracotta container and supporting dynamic updates of clustered services.
OSGi Applications Clustering using Distributed Shared Memory
1. Context Contribution Validations Perspectives
OSGi Applications Clustering using Distributed
Shared Memory
Anthony Gelibert1 Walter Rudametkin2 Didier Donsez2
S´bastien Jean1
e
1 GrenobleInstitute of Technology,
LCIS Laboratory, CTSYS Team
Valence, France
firstname.lastname@lcis.grenoble-inp.fr
2 Grenoble University,
LIG Laboratory, ADELE Team
Grenoble, France
firstname.lastname@imag.fr
11th Annual International Conference on New Technologies
of Distributed System
1 / 25
2. Context Contribution Validations Perspectives
Agenda
1 Context
OSGi
OSGi and Distribution
Distributed Shared Memory
2 Contribution
Proposition
Use Cases
Toolchain
Example
3 Validations
Event Admin
Cilia
uGASP
4 Perspectives
2 / 25
3. Context Contribution Validations Perspectives
OSGi
De facto Module System
Bundle 1 Bundle 2 Bundle N
(“bundle”) for Java
(Eclipse IDE & RCP,
OSGi Framework JavaEE, OSGiME).
Java Virtual Machine
Dependency management.
Operating System
Hardware Service Oriented
Architecture with Direct
References.
Figure: OSGi & System-Layering
3 / 25
5. Context Contribution Validations Perspectives
Remote Method Invocations
Use a stub to call methods
Client Server exported by a remote
skeleton.
Stub Skeleton
RRL RRL
Many solutions for OSGi :
Transport Layer R-OSGi
ROSE
Extended ServiceBinder
Figure: Remote Method Invocation SCA
Remote Services
5 / 25
6. Context Contribution Validations Perspectives
Distributed Deployment
Several bundle repositories.
Bundle offering the same functionalities on each.
Deployment optimizing non-functional parameters.
Use a P2P overlay.
6 / 25
7. Context Contribution Validations Perspectives
Distributed Shared Memory
P0 P1 P2
••• Pn-1
MEM MEM MEM MEM
Network
Software DSM Layer
Figure: Software Distributed Shared Memory
7 / 25
9. Context Contribution Validations Perspectives
Proposition
Distributed Shared Clustered (i.e. Replicated)
Memory
Services.
Apply DSO to Services
Module Clustered Module Clustered Module
published in distributed
A Service B Service C
[OSGi / JVM] platforms.
OSGi OSGi
Avoid the re-engenerring
JVM JVM
gymnastic to distribute
OSGi services.
Figure: Clustered Service
Clustered Bundles:
Bundles containing servants providing and consuming local
and clustered services
9 / 25
10. Context Contribution Validations Perspectives
Pitfalls
Versioning of Clustered Bundles
Dynamic Updates of clustered bundles1
1
Synchronous vs. Asynchronous
10 / 25
11. Context Contribution Validations Perspectives
Use Cases
Traditional targets of distributed shared memory
State sharing
Message bus
Re-engineering of existing solutions
Parallelization of services
Original data access paradigm
11 / 25
13. Context Contribution Validations Perspectives
Example
Enabling the delegation of class loading
Annotations for Terracotta
Figure: Annotations in the source code
13 / 25
14. Context Contribution Validations Perspectives
Example (cont.)
APT Maven plugin
Terracotta Configuration File
Figure: Build process
14 / 25
15. Context Contribution Validations Perspectives
Validations
Various use cases validated.
Chosen pieces:
Event Admin
Cilia
uGasp
15 / 25
16. Context Contribution Validations Perspectives
Event Admin
Producer Consumer
of Bridge Bridge of
events events
OSGi Platform OSGi Platform
Distributed Shared
Memory
Indicates a propagation
of events
Figure: Propagation of events across multiple platforms
16 / 25
18. Context Contribution Validations Perspectives
uGASP
Migration of the players
from A to B
Player Player Player Player Player Player
without any loss of data
on the server A on the server A on the server A previously previously previously
on the server A on the server A on the server A
Game Server A Game Server B
(u)GASP + Bluetooth antenna (u)GASP + Bluetooth antenna
Distributed Shared Memory
Figure: State share for a DTN application
18 / 25
19. Context Contribution Validations Perspectives
Future works
Terracotta container
Extension of the container:
Enhance Terracotta integration
Add persistence, cache. . .
Dynamic update
Dynamically update clustered services at run-time
Run-time compliance & Update policies
Update without stopping the bundle.
19 / 25
20. Context Contribution Validations Perspectives
Thank you for your attention!
———————
Contact: anthony.gelibert@lcis.grenoble-inp.fr
20 / 25