2. 62605GiCommunity
Bowl1010
129 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Agenda
OSGi and Java Enterprise ā who needs
who?
The Culture Clash
Apache Aries
Whatās Next in Aries and Enterprise OSGi?
Aries and WebSphere Application Sever
3. 62605GiCommunity
Bowl1010
A
jpt.
229 Sep 2010
Ian Robinson (c) IBM Corp, 2010
IDL JDBC JNDI JAXP JAAS JMX RMI-IIOP
Enterprise APIs in Java SE (Required for Java EE)
Servlet JSP
Web Container
JavaM
ail
JAF
JAX-
RPC
JAX-
WS
Web
Service
s
WS
Metada
ta
JMS
JTA
JACC
JAXR
Manag
ement
JPA
EJB
SAA
J
HTTP/
SSL
Direct dependency
Optional dependencies
JSTL
JSF
JAX
B
JCA
Deb
ug
Com
mon
Anno
tation
s
Java EE Web technologies
StAX
Indirect (soft) dependency
JAX-
RS
JASPI
C
CDI&
DI
OSGi and Java Enterprise ā who needs who?
HTTP Session Replication Connection Management Persistence Providers User Registries Event Mgmt
Logging and Tracing MBean Server
Admin Console
and scripting
DataSources Messaging Engines Security
Transport Channels Workload Management
HTTP Serving
and routing
High Availability
Management
Transaction Logging
and Recovery
Thread management Classloading Provisioning Monitoring
Policy and SLA
mgmt Configuration
ā¦
4. 05G1
kwo
Applications
(bundles) Services
Life Cycle
Module
Java Execution Env
OS + Hardware
329 Sep 2010
Ian Robinson (c) IBM Corp, 2010
OSGi and Java Enterprise ā who needs who?
IDL JDBC JNDI JAXP JAAS JMX RMI-IIOP
Enterprise APIs in Java SE (Required for Java EE)
Servlet JSPWeb Container
Ja
va
M
ail
J
A
F
JA
X-
R
P
C
JA
X-
W
S
W
eb
Se
rvi
ce
s
W
S
M
et
ad
at
a
J
M
S
JT
A
JA
C
C
JA
X
R
M
an
ag
e
m
en
t
JP
A
EJ
B
S
A
A
J
H
T
T
P/
S
SL
Direct dependency
Optional dependencies
JS
TL
JS
F
J
A
X
B
J
C
A
D
e
b
u
g
C
o
m
m
o
n
A
n
n
o
t
a
t
i
o
n
s
Java EE Web technologies
S
t
A
X
Indirect (soft) dependency
JA
X-
R
S
J
A
S
PI
C
C
DI
&
DI
HTTP Session ReplicationConnection ManagementPersistence ProvidersUser Registries Event Mgmt
Logging and TracingMBean Server
Admin Console
and scripting
DataSourcesMessaging Engines Security
Transport ChannelsWorkload Management
HTTP Serving
and routing
High Availability
Management
Transaction Logging
and Recovery
Thread managementClassloading Provisioning Monitoring
Policy and SLA
mgmt Configuration
Java EE App Server
Applications
Enterprise
Services
Metadata and
enterprise service-enablement
Three ways of looking at Enterprise OSGi technologies
1
2
3
5. 12' 05G.Community
Bowl1010
429 Sep 2010
Ian Robinson (c) IBM Corp, 2010
The Culture Clash
Java EE OSGi
An application is a collection of
wars/jar modules scoped by an
EAR
There is no multi-bundle
āapplicationā scope other than an
OSGi framework
Applications are isolated from
one another in a server
Bundle exports are visible
throughout the framework
Container-centric. Distinct
contracts for containers and
applications
All bundles are created equal.
Defines complete enterprise
programming model (JTA, JPA,
Web, JMX, Web, EJB, JAX-WSā¦)
OSGi Enterprise Specification
V4.2 defines services-based
access to Java EE technologies
6. 62605GiCommunity
Bowl1010
529 Sep 2010
Ian Robinson (c) IBM Corp, 2010
OSGi Enterprise Specification
Released 22 March 2010
ā The product of the OSGi Enterprise Expert Group (EEG)
Brings Enterprise technologies and OSGi together
Using existing Java SE/EE specifications:
ā JTA, JPA, JNDI, JMX, WebAppsā¦
Plus Spring-derived Blueprint component model and DI
container
Java EE provides the core enterprise application
programming model
Deploying modules as OSGi bundles simplifies reuse
between applications, provides versioning, encourages
(and enforces) modular design and enables dynamic
module updates.
7. 62605Gi-
Ezn
Apache
ARIES
629 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Enterprise OSGi in Apache Aries
Apache Aries Project started in Sep 2009
http://incubator.apache.org/aries/
ā Delivering a set of pluggable Java components enabling an enterprise
OSGi application programming model.
ā Implementations and extensions of application-focused
specifications defined by the OSGi Alliance Enterprise Expert Group
(EEG) and an assembly format for multi-bundle applications, for
deployment to a variety of OSGi based runtimes.
ā to build a broad development community to encourage implementation
and adoption of EEG specs
Just delivered 2nd (incubator) release.
ā OSGi Compliance Tests published
for each release.
Aries componentry supporting an enterprise OSGi
programming model has been integrated into both
Geronimo and WebSphere Application Server.
ā As well as Apache Felix Karaf, JBossOSGi and others
Project was 1 year old last week
9. O
MBean Serve
O
Ā«MBean>>
Bundle State
MBean
1111111111111111111111111111111111111111111111111
.1111111111111111111111111111111111111111111111111111111111111111111
""""""""."""""""""""""""""""""""".
Ā«MBeanĀ»
Package St ate
MBean
Immimmimmimmimmimmimmimmimmim
'1111111111111111
Ā«M3ean>>
Fram ework
MBean
1111111111111111111111111111111111111111111111111111111111111111111
Ā«M3ean>>
Service St ate
MBean
11111111111111111111111111111111111111111111111111111111111111111111
111AV /āNC
!VIC 1 ICI 661
um
ll
ummummummummummummummum
<4V1BeanĀ»
D.rrn:e
91111111111111111111111111111111111111111111111111111111111111111111
W III 1151. PL./ 11
Ad min MBean
"I11111111111111111111111111111111111111111111111111111111111111111111
11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,1111..........
Ā«MBeanĀ»
Provisi onin g
ServiceM Bean
"mmimmimmimmimmimmimmimmimmimm
Ā«MBeanĀ»
User Adm in
MBean
"111111111111111111111111111111111111111111111111111111111111111111111.....
1
jax,.., 829 Sep 2010 6'605GCommunity
Event 1:10
Aries )MX Integration
Implementation of OSGi JMX specification.
o Aries JMX bundle automatically registers the JMX
MBeans into any
javax.management.MBeanServer service in the
OSGi Service Registry.
PermissionAdrnin
Cnnficriratinn Admin
Provisioning Service
User Adrrin
Ian Robinson (c) IBM Corp, 2010
829 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Aries JMX Integration
Implementation of OSGi JMX specification.
Aries JMX bundle automatically registers the JMX
MBeans into any
javax.management.MBeanServer service in the
OSGi Service Registry.
JMX OSGi
Manager
<<MBean>>
Framework
MBean
<<MBean>>
Bundle State
MBean
<<MBean>>
Service St ate
MBean
<<MBean>>
Package St ate
MBean
<<MBean>>
Configuration
Admin MBean
<<MBean>>
Permission
Admin MBean
<<MBean>>
Provisioning
ServiceMBean
<<MBean>>
User Admin
MBean
PermissionAdmin
Configuration Admin
Provisioning Service
User Admin
MBean Server
<<MBean>>
Blue print
MBean
Framework MBeans
Compendium MBeans
Additional Aries MBeans
10. XA Protocol
7
[TA Provider
Transaction
Synchroni: ation
Registry
((interfaceĀ»
XAResource
an aged
Application Imp!
Application
Container Impl
-source
onager Impl
XAResource Imp!
User Transaction
Transaction Manager
62605GiCommunity
Ewen!2010
.7* a resource specific service
929 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Aries JTA integration
Apache Aries integrates the OSGi Transaction
Service Ref Impl from Apache Geronimo.
This spec is a good
example of the
OSGi/Java EE
culture clash:
ā Different services
for application and
container
11. 62605GiCarrfflnunity
Bowl1010
bond e service bund:e
jax,.. 1029 Sep 2010
Ian Robinson (c) IBM Corp, 2010
OSGi Services ā No Java EE analog
Services registered in Service Registry.
Services are dynamic
Clients (bundle B) need to cope with them going
away
There is no analog for dynamic services in Java EE.
S
12. 12' 05G.Community
Bowl1010
1129 Sep 2010
Ian Robinson (c) IBM Corp, 2010September 8th 2010
Using Services can be hard
private BundleContext ctx;
private AtomicReference<LogService> ls = new AtomicReference<LogService>();
private AtomicReference<ServiceReference> lr = new AtomicReference<ServiceReference>();
public void start(BundleContext ctx) throws InvalidSyntaxException
{
this.ctx = ctx;
ctx.addServiceListener(this, "(objectClass=org.osgi.service.log.LogService)");
ServiceReference ref = ctx.getServiceReference(LogService.class.getName());
if (ref != null) {
ls.set((LogService) ctx.getService(ref));
lr.set(ref);
}
}
@Override
public void serviceChanged(ServiceEvent event)
{
ServiceReference ref = event.getServiceReference();
if (ls.get() == null && event.getType() == ServiceEvent.REGISTERED) {
ls.set((LogService) ctx.getService(ref));
} else if (ls.get() != null && event.getType() == ServiceEvent.UNREGISTERING &&
ref == lr.get()) {
ref = ctx.getServiceReference(LogService.class.getName());
if (ref != null) {
ls.set((LogService) ctx.getService(ref));
lr.set(ref);
}
}
}
14. 62605GiCommunity
Bowl1010
1329 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Aries Blueprint Container
XML Blueprint definition describes component configuration and
scope
ā Optionally publish and consume components to/from OSGi service
registry.
Simplifies unit test outside either Java EE or OSGi r/t.
The Aries BP container
implementation is highly extensible:
ā Namespace handlers supported to
extend the Blueprint definitions
ā Bean interceptors can be
registered by handlers
Other Aries components contribute
handlers ā ājpaā and ājtaā handlers.
dependencies injected
consumes
servicepublishes
service
A static assembly
and configuration
of components
(POJOs)
Blueprint bundle
OSGI-INF/blueprint/
blueprint.xml
15. 62605GiCommunity
Bowl1010
1429 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Container managed JPA support integrated with
Aries Blueprint container:
ā @PersistenceUnit or @PersistenceContext (managed)
ā or <jpa:unit>, <jpa:context> bean property injection
ā Familiar development experience for JPA developers
ā Load-time enhancement of Entity classes (WebSphere)
Same container managed transaction attributes as
EJBs:
ā Required, RequiresNew, Mandatory, NotSupported,
Supports, Never
<blueprint>
<bean id=āshopā class=āorg.example.ecomm.ShopImplā>
<jpa:context property="em" unitname="myUnit"/>
<tx:transaction method="*" value="Required"/>
</bean>
</blueprint>
Aries Blueprint Extensions
16. 62605GiCommunity
Bowl1010
jax 1529 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Aries JNDI integration
Provides JNDI-based access to OSGi Service
Registry
<blueprint xmlns=...>
<bean id="bloggingServiceComponent"
class="org.apache.aries.BloggingServiceImpl">
</bean>
<service ref="bloggingServiceComponent"
interface="org.apache.aries.samples.blog.api.BloggingService"/>
...
</blueprint>
registerService
InitialContext ic = new InitialContext();
BloggingService blog= ic.lookup("osgi:services/"
+ BloggingService.class.getName());
getService
A way for a Web component to
access a Blueprint component
OSGi
Service Registry
JNDI Context
17. 62605GiCommunity
Bowl1010
1629 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Application-level Metadata and Archive
Apache Aries defines the notion of an
āenterprise bundle archiveā (EBA) to
represent a multi-bundle application.
Constituent bundles may be
contained (āby-valueā) or referenced
from a bundle repository.
Config by exception - absence of
APPLICATION.MF metadata means:
ā¢ application content is the set of bundles
contained
by-value plus any repository-hosted
dependencies identified during
deployment.
Application
EntitiesEntities
BlueprintBlueprint
Web componentsWeb components
<web.xml />
<persistence.xml/>
<blueprint.xml/>
APPLICATION.MF
18. 62605GiCommunity
Bowl1010
1729 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Aries Application Assembly and Deploy
āapplicationā project: resolve and deploy .eba archives
ā bundle converter extn point e.g for war to wab
conversion
ā application resolver extn point for different type of
repository e.g Felix OBR
ā application context extn point for runtime specific
installation and management of bundles
Manifest-Version: 1.0
Application-ManifestVersion: 1.0
Application-Name: Blog Application
Application-SymbolicName: aries.sample.blog
Application-Version: 1.0
Application-Content:
aries.sample.blog; version=1.0.0,
aries.sample.blog-api; version=1.0.0,
aries.sample.blog-persistence; version=1.0.0,
aries.sample.blog-servlet; version=1.0.0
Uses APPLICATION.MF metadata
Metadata can be generated from
POM configuration or authored
Eclipse-based tools for authoring
19. I
62605Gi-
Ezn
1829 Sep 2010
Ian Robinson (c) IBM Corp, 2010
RAD V8
OSGi App Devt Tool
WAS v7 OSGi FeP
Test Environment
WAS v7 OSGi FeP
Test Environment
Eclipse
WTP 3.6WTP 3.6 PDEPDE
Graphical
Application Editor
Graphical
Application Editor
Developer Productivity
(e.g. content assist, validation, re-factoring)
Developer Productivity
(e.g. content assist, validation, re-factoring)
Graphical Creation
Wizards
Graphical Creation
Wizards
Creation / Import /
Export Tools
Creation / Import /
Export Tools
Tutorials and
Documentation
Tutorials and
Documentation
Publish and Run
WAS v7 Server
Support
WAS v7 Server
Support
Free Eclipse Plugin for OSGi Applications
Graphical tools to develop OSGi applications and
bundles
Includes features that increase developer productivity
Creates OSGi Applications for any Aries-based server
runtime.
Eclipse WTP 3.6 (Helios) required
http://marketplace.eclipse.org/content/ibm-rational-
development-tools-osgi-applications
OSGi Application Development Tools
Blueprint Graphical
Editor
Blueprint Graphical
Editor
Bundle ExplorerBundle Explorer
SCA / OSGi
Integration
SCA / OSGi
Integration
OSGi Application Support in RAD V8
Provide integrated development and test of
OSGi Applications on the WebSphere platform
Integrated with Web Tools, JEE productivity tools, and
other capabilities in RAD
Supports deployment to WAS v7 OSGi FeP and
includes the FeP in the WAS Test Environment
SCA support for OSGi Applications
Additional OSGi tools:
Graphical and wiring editor for Blueprint
Bundle Explorer
Tools for WAS OSGi extensions / Value-add
http://www-01.ibm.com/software/awdtools/developer
/application/index.html
20. ibm.vo.ehe.example.blog.app
1.0
Aries Slag
Gen eraIInformation
Spedfiesthegeneralinformation for this application,
Symbolic Name (ID):
Version:
Name:
e005GiCommunity
Ewen!2010
--s--20 Import DR'.
OSGi Application Import
rImport an OSGi application into theworkspace.
EBA file: DS COM.ibm.ws.eba.example.blag.eba v Browse...
Project name: com.ibm.ws.eba.example.blog.app
Target runtime: <None> E [
New... 1
Bundlesdoindude:
MIiii.com.ibm.ws.eba.exampk.blog.ap(1.0.0)
El 4:rcom.ibm.ws.eba.exampk.blog.persistence (1.0.0)
SelectAll
ClearAllMI *com.ibm.ws.eba.exampk.blog.web(1.0.0)
El *com.ibm.ws.eba.exampk.blog(1.0.0)
< Back 1 Next > I Finish [ Cancel
[ILIProject Explorer E-.3-'"__
'Workspace]
com.ibm.json.java
āŖ com.ibm.ws.eba.example.blog
āŖ com.ibm.ws.eba.example.blog.api
āŖ1=,com.ibm.ws.eba.example.blog.app
4.Manifest: Aries Slog
8-2?META-INF
APPLICATION,MF
permissions.perm
..ibm.ws.eba.example.blog.
OSGi Application Manifest
Contained Bundles
Spedfies the OSGi bundles indudedinthis appliption.
o
,
f0com.ibm.ws.eba.example.blog.persistence
O com.ibm.ws.eba.example.blog.web
Add...
[ Remove
Properties...
[ New...
[ Up
sExplicitly Sha red Bundles
Spedfies the OSGibundles induded from the shared
runtimearea.(Use-bundle header)
ā¢ bm.json.java 1.0.0 Add...
Overview APPLICATION.MF
ā¢ COM.ibm.os.eba.example.blog.api
com.ibm.ws.eba.example.blog.persisi
com.ibm.ws.eba.example.blog.web 1
com. ws.eba. example.blog 1.0.0
L.5_1
1929 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Development Support for EBAs
OSGi App Dev Tool supports import, creation, and
export of applications
Form-based editor for application manifest
Validation of manifest syntax and
properties
21. OSGi Bundle Project
Create a sthndalone OSGi bundle project or add it to a
new or existing applimtion.
Projectname NewBundle
trdl We defaultloustion
Location: Browse...C: 'yedipse 36Vorkspace',NewBundle
New Si Bundle Project_ _
Project lomtion
Target runtimeL New Runtime.,,
rConfiguration
OSGiWebConfiguration
<None>
Modify...
< Back. Next > Finish Cancel
<custom>
Default Configuration
JavaServer Faces v1.1 Project
JavaServer Faces v1.2 Project
JavaServer Faces v2.0 Project
Minimal Configuration
OSGi PA Configuration
OSGi Web Configuration
65005GiCommunity
Bowl2310
YJ
YJ
2029 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Development Support for Web and JPA Bundles
Create OSGi bundle projects with Web or JPA configurations
Can convert existing JEE Web or JPA projects into bundles:
ā Creates or updates a valid bundle manifest
ā Adds a Web-ContextPath or Meta-Persistence header
ā Adds package imports based on current
module contents
Graphical manifest editor for OSGi metadata.
Project build paths respect OSGi visibility rules
ā Supports and enforces modular characteristics
from design through to execution
Plus in RAD: Comprehensive support for
Web and JPA. These tools can continue to
be used as-is in OSGi projects, including:
ā New wizards (Servlet, JSP, etc.)
ā Page designer and other web editors
ā Persistence.xml editor
22. Details
ID:
Class:
1E1 [17
bloggingServiceComponent
com.ibm.ws.eba.example.blog.BloggingServiceImpl Browse...
Activation:
Scope:
Description:
1:1
1
ilefgrepc.5gttingj
0 Method references
1Nr.Blueprint
blogAuthorManager (Bean)
blogCommentManager (Bean)
blogEniryManager (Bean)
;FE,bloggingServiceComponent (Beal,
blogAuthorManager (Property)
blogCommentManager (Property.
blogEntryManager (Property)
com.ibm .ws.eba e xample b log . api.B
commentPersistenceService (Refere
persistenceManager (Reference)
1 <1
blueprint. xr721
e..Blueprint XML Editor
Overview
type filter text
3
[ Add...
[ Remove
r
I Down
Design Scum
Community
Ewen!2010
62605Gi 2129 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Development Support for Blueprint Bundles
Blueprint creation wizard
ā Supports extension schema including JPA and transactions
A blueprint editor, including:
ā Source page with syntax highlighting, content assist
ā Form-based editing similar to Java EE deployment
descriptors (RAD)
ā Syntax and reference validation
ā Hyperlinking to impl
classes
ā Refactoring support
24. Apache
AR1 ES
62605GiCarrfflnunity
Bowl1010
2329 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Application exploitation of OSGi in
WebSphere
OSGi has been used internally in WAS since V6.1
and in Eclipse since R3.
Application-level exploitation is introduced in
the WebSphere Application Server V7 Feature
Pack for OSGi Applications and JPA 2.0
http://www.ibm.com/websphere/was/osgi
ā Generally available since May 2010
ā Early Program available since Nov 2009
Tools support in RAD V8:
http://www.ibm.com/software/awdtools/developer/application/
25. Community
Ewen!2010
1
1
s
I I
62605Gi 2429 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Modular Deployment
Common bundles factored out of the applications and used at specific
versions
webA.jar
WEB-INF/classes/servletA.class
WEB-INF/web.xml
META-INF/MANIFEST.MF
webA.jar
WEB-INF/classes/servletA.class
WEB-INF/web.xml
META-INF/MANIFEST.MF
webA.jar
WEB-INF/classes/servletA.class
WEB-INF/web.xml
META-INF/MANIFEST.MF
webA.jar
WEB-INF/classes/servletA.class
WEB-INF/web.xml
META-INF/MANIFEST.MF
webA.jar
WEB-INF/classes/servletA.class
WEB-INF/web.xml
META-INF/MANIFEST.MF
webA.jar
WEB-INF/classes/servletA.class
WEB-INF/web.xml
META-INF/MANIFEST.MF
Bundle Repository
Bundle Repository
Import-Package
webA.jar
WEB-INF/classes/servletA.class
WEB-INF/web.xml
META-INF/MANIFEST.MF
webA.jar
WEB-INF/classes/servletA.class
WEB-INF/web.xml
META-INF/MANIFEST.MF
webA.war
WEB-INF/classes/servletA.class
WEB-INF/web.xml
WEB-INF/lib/ā¦
webA.war
WEB-INF/classes/servletA.class
WEB-INF/web.xml
WEB-INF/lib/ā¦
logging f/w jar
persistence f/w jar
MVC f/w jar
DI f/w jar
webA.war
WEB-INF/classes/servletA.class
WEB-INF/web.xml
WEB-INF/lib/ā¦
webA.war
WEB-INF/classes/servletA.class
WEB-INF/web.xml
WEB-INF/lib/ā¦
logging f/w jar
persistence f/w jar
MVC f/w jar
DI f/w jar
webA.war
WEB-INF/classes/servletA.class
WEB-INF/web.xml
WEB-INF/lib/ā¦
webA.war
WEB-INF/classes/servletA.class
WEB-INF/web.xml
WEB-INF/lib/ā¦
logging f/w jar
persistence f/w jar
MVC f/w jar
DI f/w jar
webA.war
WEB-INF/classes/servletA.class
WEB-INF/web.xml
WEB-INF/lib/ā¦
webA.war
WEB-INF/classes/servletA.class
WEB-INF/web.xml
WEB-INF/lib/ā¦
logging f/w jar
persistence f/w jar
MVC f/w jar
DI f/w jar
logging f/w jar
persistence f/w jar
MVC f/w jar
DI f/w jar
ā¢ Manage multiple
versions of libraries
across an enterprise
ā¢ Isolate application
dependencies from the
server runtime
ā¢ Centralized location to
deliver critical fixes
ā¢ Flexibility to update to
new versions one app at
a time
26. IDTroubleshooting
['Service integration
I=1 UDDI
62605GiCommunity
Ewing2010
Integrated Solutions Console Welcome Help ILogout
Cell=irobinsNodeOlCell, Profile=AppSni01
View: IAll tasks
Close page
s Welcome
E l Guided Activities
E+ Servers
['Applications
I=1 Services
E l Resources
E+ Security
El Environment
Internal bundle repository
Internal bundle repository> comibmjson.java
The internal bundle repository is used to store bundles that are referenced by OSGi applications running in
WebSphere Application Server. When an OSGi application is imported as an assetr the provisioner attempts to
satisfy all its dependencies by using the contents of the asset, the contents of the internal bundle repository,
and the contents of any available external bundle repositories.
Configuration
Exported packages
com.ibm.json.javawersion=ā1.0.0"
Virtual hosts
Update global Web server plu
configuration
s WebSphere variables
s Shared libraries
s Replication domains
E Naming
OSGi bundle repositories
s
s Internal bundle repository
E System a MFIIT3Dam.rri
ID Users and Groups
I=1 Monitoring and Tuning,
General Properties
Bundle symbolic name
CO.T. Ibm.json jays
Bundle version
1.0.0
Bundle name
JSCIN4J
Bundle description
Imported packages
2529 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Modular Deployment in WAS
27. ___-------
___-----
_ ā -
bundle 6
Bundle C
Bundle
__-------
d'uOSGi
Even,1010
2629 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Details: Isolated and Shared Bundles
In Java EE, modules are isolated within an application
and applications are isolated from one another.
ā Makes sharing modules difficult
OSGi 4.2 all bundles have shared visibility to the
externals of all others bundles within an OSGi
framework (JVM)
ā Makes isolating applications difficult
Java EE App Server
Everything isolated Everything shared
EAR 1
Module A
Module B
Module C
EAR 2
Module A
Module G
Module C
OSGi v4.2 Framework
Isolation
Sharing
28. J
62605GiCommunity
Bowl1010
2729 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Details: Isolated and Shared Bundles
Equinox 3.5 ānested frameworkā support enables
ācomposite bundlesā to run in isolated child
frameworks
ā WebSphere installs each OSGi Application into an isolated
child framework.
ā Shared bundles are installed into the (single) parent
framework.
Everything isolated Everything shared
OSGi v4.2 Framework
Java EE App Server
EAR 1
Module A
Module B
Module C
EAR 2
Module A
Module B
Module C
Java EE App Server
EAR 1
Module A
Module B
Module C
EAR 1
Module A
Module B
Module C
EAR 2
Module A
Module B
Module C
EAR 2
Module A
Module B
Module C
WAS V7 OSGi App FeP
EBA 1
Bundle A
Bundle B
Bundle C
EBA 2
Bundle A
Bundle G
Isolated
framework
Isolated
framework
Shared framework
29. tt.own.ibm.ws.eba.example.bloghapp
Manifest-Version: 1.0
Application-ManifestVersion: 2.0
Application-Name: Aries Blog
Application-SymbolicName: com.ibm.ws.eba.example.blog.app
Application-Version: 1.0 44
Application-Content: com.ibm.ws.eba.example.blog.apivrtersion=1.0.0,
com.ibm.ws.eba.example.blog.persistence:7ersion=1.0.0,
com.ibm.ws.eba.example.blog.webvriersior=1.0.0,
com.ibm.ws.eba.example.blog:version=2.0.0
Use-Bundle: com.ibm.json.java;version=1.0.0
i<1
OverviewAPPLICATION.MF
r
0 -0-
O
62605GiCommunity
Bowl1010
2829 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Example āBlogā Application
Blogging
Service
Blog
Persistence
Service
blog-servlet
Web application bundle
META-INF/
persistence.xml
WEB-INF/
web.xml OSGI-INF/blueprint/
blueprint.xml
OSGI-INF/blueprint/
blueprint.xml
JNDI EM
blog.eba
blog
blog-persistence
blog-api
isolated content
shared content
30. ID
0
1
1
wsadmin>list()
Framework Version Node Server
SharedBundles 7.0.0 irobinsNode01 serverl
com.ibm.ws.eba.example.blog.app 1.0.0 irobinsNode01 serverl
wsaā¢min connec u
CWSAJ0035I: Connecting to framework SharedBundles_7.0.0 on node irobinsNode01 an
cprvpr qprup.r1
401WSAJ0036I: Successfully connected to framework SharedBundles_7.0.0.
wsadmin>ss()
ID State Bundle
0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
1 ACTIVE shared.bundle.framework_0.0.0
2 ACTIVE com.ibm.json.java_1.0.0
ACTIVE com.ibm.ws.eba.example.blog.app_1.0.0 ./
wsadmin>connect(1)
CWSAJ0035I: Connecting to framework com.ibm.ws.eba.example.blog.app_1.0.0 on
e innhinANnHt.01 And Apbrypq- Ap.mit.r1
ASAJ0036I: Successfully connected to framework com.ibm.ws.eba.example.blog.ap
1.0.0.
wsadmin>ss()
ID State Bundle
0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
1 ACTIVE com.ibm.ws.eba.example.blog.app_1.0.0
2 ACTIVE com.ibm.ws.eba.example.blog_1.0.0
3 ACTIVE com.ibm.ws.eba.example.blog.web_1.0.0
4 ACTIVE com.ibm.ws.eba.example.blog.persistence_1.0.0
Indmin> ACTIVE
com.ibm.ws.eba.example.blog.api_1.0.0
2929 Sep 2010
Ian Robinson (c) IBM Corp, 2010
JMX and Isolated Frameworks in Action
31. 12' 05G.Community
Bowl1010
3029 Sep 2010
Ian Robinson (c) IBM Corp, 2010
OSGi Application
BundleBundle
Bundle
POJO
POJOs assembled using a Blueprint
context and scoped by an OSGi Bundle.
OSGi Bundles assembled in an OSGi
Application and integrated through
services in the OSGi service registry
SCA Composite assembled from
heterogeneous components including an
OSGi Application component, and
integrated through SCA services with
configurable bindings (JMS, web
servicesā¦).
POJO
POJO
OSGi Applications and SCA:
the assembly food chain
SCA Composite
Component
EARPOJO
32. 62605GiCommunity
Bowl1010
3129 Sep 2010
Ian Robinson (c) IBM Corp, 2010
Summary
Java EE and OSGi are good for each other.
ā Java EE defines standard enterprise technologies with
contracts for applications and runtimes
ā OSGi encourages and enforces modular design and
enables modular deployment
The Apache Aries project delivers enterprise OSGi
technologies that have been integrated into a
number of runtimes.
ā As well as experimental implementation of new EEG
RFPs to inform the specs.
WAS V7 and RAD integration of Aries provides
complete develop-test-deploy-manage environment
for modular enterprise applications.
33. 62605GiCommunity
Bowl1010
3229 Sep 2010
Ian Robinson (c) IBM Corp, 2010
References
Apache Aries
http://incubator.apache.org/aries/
Apache Geronimo v3.0-M1:
http://geronimo.apache.org/
WAS V7 Feature Pack for OSGi Applications and JPA 2.0
http://www.ibm.com/websphere/was/osgi
OSGi Application Development Plugin:
http://marketplace.eclipse.org/content/ibm-rational-
development-tools-osgi-applications
Rational Application Developer V8:
http://www.ibm.com/software/awdtools/developer/application/