osgi and the enterprise a match made in a box? · pdf fileseptember 23rd 2010 11 java vm log4j...
TRANSCRIPT
OOOOOOSSSSSSGGGGGGiiiiii aaaaaannnnnndddddd tttttthhhhhheeeeee EEEEEEnnnnnntttttteeeeeerrrrrrpppppprrrrrriiiiiisssssseeeeeeAAAAAA mmmmmmaaaaaattttttcccccchhhhhh mmmmmmaaaaaaddddddeeeeee iiiiiinnnnnn aaaaaa .................. bbbbbbooooooxxxxxx??????
Holly [email protected] StuttgartSept 23, 2010
2September 23rd 2010
AAAAAA ((((((vvvvvveeeeeerrrrrryyyyyy)))))) bbbbbbrrrrrriiiiiieeeeeeffffff hhhhhhiiiiiissssssttttttoooooorrrrrryyyyyy ooooooffffff pppppprrrrrrooooooggggggrrrrrraaaaaammmmmmmmmmmmiiiiiinnnnnnggggggIn the beginning, there were bits ...
0101011101001001010010010011011101101101101
3September 23rd 2010
AAAAAA ((((((vvvvvveeeeeerrrrrryyyyyy)))))) bbbbbbrrrrrriiiiiieeeeeeffffff hhhhhhiiiiiissssssttttttoooooorrrrrryyyyyy ooooooffffff pppppprrrrrrooooooggggggrrrrrraaaaaammmmmmmmmmmmiiiiiinnnnnnggggggThen came words ...
mov ah,9mov dx,offset hello_messageint 21h
4September 23rd 2010
AAAAAA ((((((vvvvvveeeeeerrrrrryyyyyy)))))) bbbbbbrrrrrriiiiiieeeeeeffffff hhhhhhiiiiiissssssttttttoooooorrrrrryyyyyy ooooooffffff pppppprrrrrrooooooggggggrrrrrraaaaaammmmmmmmmmmmiiiiiinnnnnngggggg... functions and libraries ...
#include <stdio.h>main() {
printf ("Hello World!\n");}
5September 23rd 2010
AAAAAA ((((((vvvvvveeeeeerrrrrryyyyyy)))))) bbbbbbrrrrrriiiiiieeeeeeffffff hhhhhhiiiiiissssssttttttoooooorrrrrryyyyyy ooooooffffff pppppprrrrrrooooooggggggrrrrrraaaaaammmmmmmmmmmmiiiiiinnnnnngggggg... objects ...
public class HelloWorldSayer {
public void sayHello() { System.out.println("Hello, world!\n"); }}
6September 23rd 2010
AAAAAA ((((((vvvvvveeeeeerrrrrryyyyyy)))))) bbbbbbrrrrrriiiiiieeeeeeffffff hhhhhhiiiiiissssssttttttoooooorrrrrryyyyyy ooooooffffff pppppprrrrrrooooooggggggrrrrrraaaaaammmmmmmmmmmmiiiiiinnnnnngggggg... and now - Enterprise OSGi
<service ref="helloservice" interface="helloworld.HelloWorldService" />
public class HelloWorldClient {HelloWorldService service =
null;public void startUp() {
service.hello();}
}
7September 23rd 2010
WWWWWWhhhhhhaaaaaatttttt wwwwwwaaaaaassssss wwwwwwrrrrrroooooonnnnnngggggg wwwwwwiiiiiitttttthhhhhh wwwwwwhhhhhheeeeeerrrrrreeeeee wwwwwweeeeee wwwwwweeeeeerrrrrreeeeee??????A question of scale
8September 23rd 2010
IDL JDBC JNDI JAXP JAAS JMX RMI-IIOP
EEEEEEnnnnnntttttteeeeeerrrrrrprprprprprpriiiiiisssssseeeeee AAAAAAPIsPIsPIsPIsPIsPIs iiiiiinnnnnn JaJaJaJaJaJavvvvvvaaaaaa (R(R(R(R(R(Reeeeeeqqqqqquuuuuuiiiiiirrrrrreeeeeedddddd f f f f f foooooorrrrrr JaJaJaJaJaJavvvvvvaaaaaa EEEEEEEEEEEE))))))
Servlet JSP
WWWWWWeeeeeeb b b b b b CCCCCCoooooonnnnnnttttttaaaaaaiiiiiinnnnnneeeeeerrrrrr
Java
JA
F
JAX-
RPC
JAX-
WS
Web
Ser
vices
WS
Met
adat
a
JMS
JTA
JACC
JAXR
Man
agem
ent
JPA
EJB
SAAJ
HTTP
/SSL
Direct dependency
Optional dependencies
JSTL JSF
JAXB
JCA
Deb
ug
Com
mon
An
nota
tions
JaJaJaJaJaJavvvvvvaaaaaa EEEEEEEEEEEE WWWWWWeeeeeeb b b b b b tttttteeeeeecccccchhhhhhnnnnnnolololololologogogogogogiiiiiieeeeeessssss
StAX
Indirect (soft) dependencyJA
X-RS
JASP
IC
CDI &
DI
9September 23rd 2010
IDL JDBC JNDI JAXP JAAS JMX RMI-IIOP
EEEEEEnnnnnntttttteeeeeerrrrrrpppppprrrrrriiiiiisssssseeeeee A A A A A APPPPPPIIIIIIssssss iiiiiinnnnnn JJJJJJaaaaaavvvvvvaaaaaa SSSSSSEEEEEE ((((((RRRRRReeeeeeqqqqqquuuuuuiiiiiirrrrrreeeeeedddddd ffffffoooooorrrrrr JJJJJJaaaaaavvvvvvaaaaaa EEEEEEEEEEEE))))))
Servlet JSP WWWWWWeeeeeebbbbbb CCCCCCoooooonnnnnnttttttaaaaaaiiiiiinnnnnneeeeeerrrrrr
Java
Mai
l JA
F
JAX-
RPC
JAX-
WS
Web
Se
rvic
es
WS
Met
adat
a JMS
JTA
JACC
JAXR
Man
age
men
t
JPA
EJB
SAAJ
HTT
P/SS
L
Direct dependencyOptional dependencies
JSTL JSF
JAXB
JCA
Debu gCom
mon
An
nota
tion
s
JJJJJJaaaaaavvvvvvaaaaaa EEEEEEEEEEEE WWWWWWeeeeeebbbbbb tttttteeeeeechchchchchchnnnnnnoooooollllllooooooggggggiiiiiieeeeeessssss
StAX
Indirect (soft) dependencyJA
X-RS
JASP
IC
CDI &
DI
((((((ccccccaaaaaappppppaaaaaabbbbbbiiiiiilllllliiiiiittttttyyyyyy ============ bbbbbbllllllooooooaaaaaatttttt))))))??????
HTTP Session Replication Connection Management Persistence Providers User Registries Event Mgmt
Logging and Tracing MBean Server Admin Consoleand scripting
DataSources Messaging Engines Security
Transport Channels Workload Management HTTP Servingand routing
High AvailabilityManagement
Transaction Loggingand Recovery
Thread management Classloading Provisioning Monitoring Policy and SLAmgmt Configuration
………………
10September 23rd 2010
I DL J DBC J NDI J AX P J A AS J MX RMI - I I OP
EEEEEEnnnnnntttttteeeeeerrrrrrprprprprprpriiiiiisesesesesese AAAAAAPPPPPPIIIIIIs s s s s s inininininin JJJJJJaaaaaavvvvvvaaaaaa SSSSSSEEEEEE ((((((RRRRRReeeeeeqqqqqquuuuuuiiiiiirerererereredddddd ffffffor or or or or or JJJJJJaaaaaavvvvvvaaaaaa EEEEEEEEEEEE))))))
S e r vl e t J S P
WWWWWWeeeeeeb b b b b b CCCCCCononononononttttttaaaaaainininininineeeeeerrrrrr
Ja
vaM
ai
l
JA
F
JA
X-
RP
C
JA
X-
WS
Web
Se
rvi
ce
s
WS
Me
ta
da
ta
JM
S
JT
A
JA
CC
JA
XR
Ma
na
ge
me
nt
JP
A
EJ
B
SA
AJ
HT
TP
/SS
L
D i r e c t de pe n de n c y
Op t i on a l de pe n d e n c i e s
JS
TL
JS
F
JA
XB
JC
A
De
bu
g
Co
mm
on
An
no
ta
ti
on
s
JJJJJJaaaaaavvvvvvaaaaaa EEEEEEEEEEEE WWWWWWeeeeeebbbbbb tttttteeeeeecccccchhhhhhnnnnnnolololololologogogogogogiiiiiieeeeeessssss
St
AX
I n d i r e c t ( s o f t ) d e pe n de n c y
JA
X-
RS
JA
SP
IC
CD
I &
DI
BBBBBBeeeeeeyyyyyyoooooonnnnnndddddd JJJJJJaaaaaavvvvvvaaaaaa EEEEEEEEEEEE………………
HTTP Session Replication Connection Management Persistence Providers User Registries Event Mgmt
Logging and Tracing MBean Server Admin Consoleand scripting
DataSources Messaging Engines Security
Transport Channels Workload Management HTTP Servingand routing
High AvailabilityManagement
Transaction Loggingand Recovery
Thread management Classloading Provisioning Monitoring Policy and SLAmgmt Configuration
………………
Batch Telephony BPM DynamicScripting
SCA BusinessRules
Complex EventProcessing
………………
11September 23rd 2010
JJJJJJaaaaaavvvvvvaaaaaa VVVVVVMMMMMM
lllllloooooogggggg444444jjjjjj
bbbbbbaaaaaarrrrrrccccccooooooddddddeeeeee444444jjjjjj
aaaaaaxxxxxxiiiiiissssss
bbbbbbaaaaaattttttiiiiiikkkkkk
ccccccoooooommmmmmmmmmmmoooooonnnnnnssssss
ddddddeeeeeerrrrrrbbbbbbyyyyyy
ffffffoooooopppppp
eeeeeezzzzzzmmmmmmoooooorrrrrrpppppphhhhhh
ffffffrrrrrreeeeeeeeeeeemmmmmmaaaaaarrrrrrkkkkkkeeeeeerrrrrr
hhhhhhttttttttttttppppppuuuuuunnnnnniiiiiitttttt
jjjjjjaaaaaakkkkkkaaaaaarrrrrrttttttaaaaaa
jjjjjjccccccllllll
jjjjjjssssssoooooonnnnnn
jjjjjjddddddbbbbbbmmmmmm
jjjjjjddddddoooooommmmmm
jjjjjjeeeeeennnnnnkkkkkkssssss
jjjjjjppppppoooooossssss111111888888
jjjjjjyyyyyytttttthhhhhhoooooonnnnnn
llllllooooooooooookkkkkkssssss
lllllluuuuuucccccceeeeeennnnnneeeeee
mmmmmmaaaaaaiiiiiillllll
mmmmmmxxxxxx444444jjjjjj
nnnnnnaaaaaammmmmmiiiiiinnnnnngggggg
jjjjjjeeeeeettttttttttttyyyyyy
ppppppooooooiiiiii
rrrrrreeeeeessssssoooooollllllvvvvvveeeeeerrrrrr
rrrrrroooooommmmmmeeeeee
sssssseeeeeerrrrrriiiiiiaaaaaalllllliiiiiizzzzzzeeeeeerrrrrr
sssssseeeeeerrrrrrvvvvvvlllllleeeeeettttttssssss
ttttttoooooommmmmmccccccaaaaaatttttt
vvvvvveeeeeelllllloooooocccccciiiiiittttttyyyyyy
wwwwwwssssss------ccccccoooooommmmmmmmmmmmoooooonnnnnnssssss
xxxxxxaaaaaallllllaaaaaannnnnn
wwwwwwssssssddddddllllll444444jjjjjj
xxxxxxeeeeeerrrrrrcccccceeeeeessssss
xxxxxxmmmmmmllllllggggggrrrrrraaaaaapppppphhhhhhiiiiiiccccccssssss
xxxxxxmmmmmmllllllrrrrrrppppppcccccc
xxxxxxmmmmmmllllllaaaaaappppppiiiiiissssss
............
ggggggeeeeeerrrrrroooooonnnnnniiiiiimmmmmmoooooo
bbbbbbsssssshhhhhh
bbbbbbssssssffffff
gggggguuuuuuiiiiiiaaaaaapppppppppppp
hhhhhhhhhhhhffffffaaaaaacccccciiiiiilllllliiiiiittttttyyyyyy
mmmmmmaaaaaannnnnnuuuuuuffffffaaaaaacccccctttttt......
mmmmmmaaaaaarrrrrrkkkkkkeeeeeettttttiiiiiinnnnnngggggg
mmmmmmiiiiiinnnnnneeeeeerrrrrrvvvvvvaaaaaa
aaaaaaccccccccccccoooooouuuuuunnnnnnttttttiiiiiinnnnnngggggg
aaaaaasssssssssssseeeeeettttttmmmmmmaaaaaaiiiiiinnnnnntttttt
bbbbbbaaaaaasssssseeeeee
bbbbbbiiiiii
ccccccaaaaaattttttaaaaaalllllliiiiiinnnnnnaaaaaa
ccccccoooooommmmmmmmmmmmoooooonnnnnn
ooooooaaaaaaggggggiiiiiissssss
oooooorrrrrrddddddeeeeeerrrrrr
eeeeeebbbbbbaaaaaayyyyyy
ccccccoooooonnnnnntttttteeeeeennnnnntttttt
ddddddaaaaaattttttaaaaaaffffffiiiiiilllllleeeeee
eeeeeeccccccoooooommmmmmmmmmmmeeeeeerrrrrrcccccceeeeee
eeeeeennnnnnttttttiiiiiittttttyyyyyy
ggggggoooooooooooogggggglllllleeeeeebbbbbbaaaaaasssssseeeeee
ooooooffffffbbbbbbiiiiiizzzzzz
wwwwwwiiiiiiddddddggggggeeeeeetttttt
mmmmmmiiiiiinnnnnniiiiiillllllaaaaaannnnnngggggg
ppppppaaaaaarrrrrrttttttyyyyyy
ppppppoooooossssss......
pppppprrrrrroooooodddddduuuuuucccccctttttt
wwwwwwoooooorrrrrrkkkkkkeeeeeeffffffffffffoooooorrrrrrtttttt
wwwwwwoooooorrrrrrkkkkkkfffffflllllloooooowwwwww
………………
ssssssuuuuuunnnnnnjjjjjjcccccceeeeee______pppppprrrrrroooooovvvvvv......
pppppplllllluuuuuuggggggiiiiiinnnnnn
jjjjjjsssssssssssseeeeee
jjjjjjcccccceeeeee
rrrrrrtttttt
ddddddnnnnnnssssssnnnnnnssssss
............
………………CCCCCCllllllaaaaaassssssssssssNNNNNNooooootttttt
FFFFFFoooooouuuuuunnnnnnddddddEEEEEExxxxxxcccccceeeeeeppppppttttttiiiiiioooooonnnnnn
BBBBBBeeeeeeggggggiiiiiinnnnnnBBBBBBeeeeeeggggggiiiiiinnnnnnHHHHHHeeeeeerrrrrreeeeeeHHHHHHeeeeeerrrrrreeeeee
TTTTTThhhhhheeeeee GGGGGGlllllloooooobbbbbbaaaaaallllll CCCCCCllllllaaaaaassssssssssssppppppaaaaaatttttthhhhhh
12September 23rd 2010
OOOOOOSSSSSSGGGGGGiiiiii ttttttoooooo tttttthhhhhheeeeee rrrrrreeeeeessssssccccccuuuuuueeeeee!!!!!!
• OSGi is almost essential in this kind of situation
13September 23rd 2010
OOOOOOSSSSSSGGGGGGiiiiii BBBBBBuuuuuunnnnnnddddddlelelelelelessssss aaaaaarrrrrreeeeee ddddddiiiiiiffffffffffffeeeeeerrrrrreeeeeennnnnntttttt
• A Bundle is a special jar• Each bundle has a classloader• Bundles define
• required packages• provided packages
• Packages can be versioned
Bundle
14September 23rd 2010
TTTTTThhhhhheeeeee NaNaNaNaNaNarrrrrrrrrrrroooooowwwwww CCCCCCllllllaaaaaassssssssssssppppppaaaaaatttttthhhhhh
• Bundles wired together• Following a wire is quick• If an endpoint isn't there you
know about it!
DDDDDDeeeeeeccccccllllllaaaaaarrrrrreeeeeedddddd ppppppaaaaaacccccckkkkkkagagagagagageeeeee
rrrrrreeeeeeqqqqqquuuuuuiiiiiirrrrrreeeeeemmmmmmeeeeeennnnnntttttt
Useful library B
Useful library A
De c lar e d pac k ag e r e q u ir e m e n t
DDDDDDeeeeeeccccccllllllarearearearearearedddddd ppppppacacacacacackkkkkkaaaaaaggggggeeeeee
rererererereqqqqqquuuuuuiiiiiirrrrrreeeeeemmmmmmeeeeeennnnnntttttt
Ourjar
15September 23rd 2010
MMMMMMoooooorrrrrreeeeee ttttttrrrrrroooooouuuuuubbbbbblllllleeeeee wwwwwwiiiiiitttttthhhhhh lllllliiiiiibbbbbbrrrrrraaaaaarrrrrriiiiiieeeeeessssss
web app
Useful library A
Useful library B
common library v1
common library v2
16September 23rd 2010
AAAAAAnnnnnndddddd aaaaaatttttt rrrrrruuuuuunnnnnnttttttiiiiiimmmmmmeeeeee ..................
web app
Useful library A
Useful library B
common library v1
common library v2
17September 23rd 2010
OOOOOOSSSSSSGGGGGGiiiiii mmmmmmaaaaaakkkkkkeeeeeessssss rrrrrruuuuuunnnnnnttttttiiiiiimmmmmmeeeeee wwwwwwoooooorrrrrrkkkkkk lllllliiiiiikkkkkkeeeeee tttttthhhhhheeeeee bbbbbbuuuuuuiiiiiilllllldddddd ((((((kkkkkkiiiiiinnnnnndddddd ooooooffffff))))))
web app
Useful library B
common library v1
common library v2
Useful library A
18September 23rd 2010
EEEEEEAAAAAARRRRRRssssss aaaaaannnnnndddddd cccccclalalalalalassssssssssssppppppaaaaaatttttthhhhhhssssss• Run multiple apps on a server• Common libraries in each war
wwwwwweeeeeebbbbbbAAAAAA......wwwwwwaaaaaarrrrrrWEB-INF/classes/servletA.classWEB-INF/lib/a.jarWEB-INF/lib/b.jarWEB-INF/lib/junit.jar…
wwwwwweeeeeebbbbbbBBBBBB......wwwwwwaaaaaarrrrrrWEB-INF/classes/servletB.classWEB-INF/lib/a.jarWEB-INF/lib/b.jarWEB-INF/lib/junit.jar…
wwwwwweeeeeebbbbbbC.C.C.C.C.C.wwwwwwaaaaaarrrrrrWEB-INF/classes/servletC.classWEB-INF/lib/a.jarWEB-INF/lib/b.jarWEB-INF/lib/c.jar…
19September 23rd 2010
EEEEEEAAAAAARRRRRRssssss aaaaaannnnnndddddd cccccclalalalalalassssssssssssppppppaaaaaatttttthhhhhhssssss .................. wwwwwwiiiiiitttttthhhhhh OOOOOOSSSSSSGGGGGGiiiiii• Shared libraries provisioned
wwwwwweeeeeebbbbbbAAAAAA......wwwwwwaaaaaarrrrrrWEB-INF/classes/servletA.class
wwwwwweeeeeebbbbbbBBBBBB......wwwwwwaaaaaarrrrrrWEB-INF/classes/servletB.class
wwwwwweeeeeebbbbbbC.C.C.C.C.C.wwwwwwaaaaaarrrrrrWEB-INF/classes/servletC.class
20September 23rd 2010
LLLLLLoooooooooooosssssseeeeee ccccccoooooouuuuuupppppplllllliiiiiinnnnnngggggg
• Modern enterprise architectures are all loosely coupled• In some way or another!
• JNDI• Web services• Dependency injection• OSGi services
21September 23rd 2010
OOOOOOSSSSSSGGGGGGiiiiii SSSSSSeeeeeerrrrrrvvvvvviiiiiicccccceeeeeessssss
• Services registered in Service Registry. • Services are dynamic
S
22September 23rd 2010
BBBBBBuuuuuutttttt ..................
• Historically OSGi and JEE have not played well together• Had to choose one and stick to it
23September 23rd 2010
OOOOOOSSSSSSGGGGGGiiiiii EEEEEEnnnnnntttttteeeeeerrrrrrpppppprrrrrriiiiiisssssseeeeee SSSSSSppppppeeeeeecccccciiiiiiffffffiiiiiiccccccaaaaaattttttiiiiiioooooonnnnnn
• Release date – 22 March 2010• The product of the OSGi Enterprise Expert Group (EEG)
• Brings popular Java EE technologies and OSGi together• Web Apps - Servlets + OSGi• JPA
• Adds Spring-derived component model and DI container• Blueprint
24September 23rd 2010
WWWWWWhhhhhhaaaaaatttttt ddddddooooooeeeeeessssss eeeeeennnnnntttttteeeeeerrrrrrpppppprrrrrriiiiiisssssseeeeee OOOOOOSSSSSSGGGGGGiiiiii ggggggiiiiiivvvvvveeeeee yyyyyyoooooouuuuuu??????
• Integrations for • Dependency injection (“blueprint”)• Dependency injection of OSGi services• JPA• JTA• JMX• JNDI
• Open source extensions include ...• Container-managed transactions• Application assembly• Application deployment
September 23rd 2010
BBBBBBlllllluuuuuueeeeeepppppprrrrrriiiiiinnnnnntttttt
public class Bean {
private LogService log;void setLog(LogService logService) {
log = logService;}
void process(Order o) {log.log(LOG_INFO, “processing: “ + o);}
}
<blueprint> <bean id=”shop” class=”org.example.ecomm.Bean”> <property name=”log”> <reference interface=”org.osgi.service.log.LogService”/> </property> </bean></blueprint>
26September 23rd 2010
OOOOOOppppppeeeeeennnnnn SSSSSSoooooouuuuuurrrrrrcccccceeeeee AAAAAAccccccttttttiiiiiivvvvvviiiiiittttttiiiiiieeeeeessssssApache “Aries” Projecthttp://incubator.apache.org/aries/• Implementations and extensions of Enterprise OSGi
specifications• Just completed 2nd release. • Project was 1 year old last week!
Eclipse “Gemini” Enterprise Modules Projecthttp://www.eclipse.org/gemini/• Modular implementations of Enterprise OSGi
specifications
27September 23rd 2010
OOOOOOSSSSSSGGGGGGiiiiii AAAAAApppppppppppplllllliiiiiiccccccaaaaaattttttiiiiiioooooonnnnnn TTTTTToooooooooooolslslslslsls
28September 23rd 2010
DDDDDDeeeeeemmmmmmoooooo
29September 23rd 2010
OOOOOOnnnnnn lllllluuuuuucccccckkkkkk ..................
“I'm a great believer in luck and I find the harder I work, the more I have of it.”
■ Thomas Jefferson
30September 23rd 2010
DDDDDDeeeeeemmmmmmoooooo((((((mmmmmmaaaaaayyyyyybbbbbbeeeeee))))))
31September 23rd 2010
DDDDDDeeeeeemmmmmmoooooo((((((mmmmmmaaaaaayyyyyybbbbbbeeeeee))))))
32September 23rd 2010
33September 23rd 2010
In the near future…all major Java
enterprise runtimes will support Apps
deployed as bundles
34September 23rd 2010
FFFFFFoooooorrrrrr ffffffuuuuuurrrrrrtttttthhhhhheeeeeerrrrrr iiiiiinnnnnnffffffoooooorrrrrrmmmmmmaaaaaattttttiiiiiioooooonnnnnn vvvvvviiiiiissssssiiiiiitttttt::::::iiiiiibbbbbbmmmmmm......ccccccoooooommmmmm/W/W/W/W/W/WeeeeeebbbbbbSSSSSSpppppphhhhhheeeeeerrrrrreeeeee//////ddddddeeeeeevvvvvv