1 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
The JBoss Extensible Server
Marc Fleury
The JBoss Group, LLC
y Francisco Reverbel
CS Department, University of São Paulo
Outline
Introduction JMX Foundation Service Components
Meta-Level Architecture for Generalized EJBs Ongoing and Future Work
Related Work
Concluding Remarks
3 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Introduction
Application Servers
Middleware platforms for development and deployment of component-based software Application component models
J2EE (Servlets/JSP and EJB), .NET, CCM
Component-based techniques should not be applied on user applications only
Component-based application servers
Dynamically deployable middleware components
Two kinds of components
Middleware components and application components
5 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
JBoss
Extensible, reflective, and dynamically reconfigurable Java application server
At the confluence of research areas such as
Component-based software development
Reflective middleware
Aspect-oriented programming
Open-source and free (LGPL)
2M downloads in 2002, 1.5M so far in 2003
Includes a set of components that implement the J2EE specification
JBoss: Open-Ended Middleware
Users can extend middleware services by dynamically deploying new components into a running server
The foundation
Java Management Extensions (JMX) specification
Architecture for dynamic management of application, system or network resources
The building
Service components
A JMX-based model for middleware components
The EJB subsystem
Invokers, containers, dynamic proxies, and interceptors
7 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
JMX Foundation
JMX Architecture
Java Virtual Machine
Agent Level Instrumentation
Level
Mgmt Client
Browser
Distributed Services Level
Connector
Protocol Adapter
Agent Services (as MBeans)
Managed Resources (as MBeans)
MBean
Server
9 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
The JMX Component Model
The instrumentation and agent levels define an in-process component model
The MBean server provides a registry for JMX components (MBeans)
Each MBean is assigned an object name that is unique in the context of the MBean server Clients use object names to refer to MBeans MBean operation invocations always go through the MBean server
Method invocation on a dynamic MBean
Java Virtual Machine
Client
!
!""#$#$ %%&&'(*)+'(*)+,,%-.)
%-.)// ''00
1 23 1 2344 5687:9
5687:9 ;<=*<;<=*<>>@?? AA
BCDBCDEEFG8H:IKJEGFFG8H:IKJEGFLL CMND*O
CMND*OPP
MBean Registry MBean Server
MBean
EFQR SO EFQR SOTTUBCD
BCDEEFGFG RRVVOD*LC
OD*LCEERFWLRFWLXX OO
YY
Z [\
Z [\OO ]C8H:I
]C8H:I VLD*L VLD*LXX@JJ
YY
BCD
BCDEEFG8H:IKJEGFFG8H:IKJEGFLL CMND*O
CMND*OPP
^
The client holds no direct Java references to the MBean
^
It does not need to know the MBean’s Java class/interfaces
^
This very simple arrangement favors adaptation
11 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Dynamic and Standard MBeans
JMX defines two kinds of MBeans
A dynamic MBean implements a predefined Java interface and relies on metadata to specify its management interface
A standard MBean implements a Java interface defined after – and determined by – the MBean’s management interface
The kind of an MBean is an implementation detail hidden from clients
Dynamic MBeans
!"!"$##%%
&&''(*)(*)(((,+
(,+*--././((''10032(,+
2(,+*--4&4& 566566,77385
8599:: ;=<;=<
>>???,@
?,@*AABC?BC?DDEA
EAFF?? GG D?
D?*>>H???? @*AB@*ABCC?D
?DFF,IJ?IJ?,@@AKAK
GG LNM
LNM OPOPPP QQRROS$TOS$TUU
V=W V=W
XX$YYZ[
Z[ \]^\]^*__H^^^^,`` ZaZabb
^]
^]1ccd__^^^,` Z
^,`
Zaab
^
b ^]] e ^
e
^^^ `` f=gf=g
__^^^,`
^,`
ZZab
^
ab ^]]h Z
h Z
\\^^
\\]^
]^*__H^^^^ `` ZaZabb
^]^]\\,ci_^ci_^^^1`` ZZaab
^
b
^]]h
Z
h Z \\^^ e
^^
e
^^,``j\\
f=g f=g
kk
aal
]
l ]$mm^^
nnoo*p$qp$qrrs1ts1tuuv,w
v,w*nnooxx yz
yz{{ |}|}~~jyjy$}
}${{
NN ,
,
* NN
$
$
$=$=
¡¡ ¢¢ $££ ¡
¡ ¤¤¥¥§¦¦
¨¨
©
The metadata class MBeanInfo supports MBean introspection
©
Management attributes and operations does not need to
correspond to Java fields and methods
13 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Standard MBeans
! !""$#&%#&%''("
(" )) ****++-,
"
,
"''
..
!!
//01201233454511
6&798 6&798
::
33;<
;< = 01
=
012234
34551
6
1 6
;;5151 >> 77?88
<<334@4@AA00
BBCCDCDCEEFGFGHHIJ
IJKKMLLONNCJKCJK PQ
PQSRRTQ
E
Q E U9VU9V
WW
X
The FooMBean interface follows JavaBean-like rules to represent management attributes and operations
X
A standard MBean exposes its management attributes and operations by
implementing a Java interface named after the MBean’s Java class, with the suffix MBean
MBean Server Interface
YTZ\[ ]^`_Oa bT]
YTZ\[ ]^`_Oa bT] cd&ecd&eOffg&hTeikjeig&hTeikjei ll
mn&oTpTqOrsTtTu\rTv
mn&oTpTqOrsTtTu\rTvttOqTpqTp w`xOyzT{w`xOyzT{\||xxww~}&xO &TxTO|
}&xO &TxTO| &TTO&TTO OT O OO
O OO \OT-\OT-
¡\¢
¡\¢ £T¤¥`¦O§¨
£T¤¥`¦O§¨T©©&ª ¦¥¬«&¦O®¤ª ¦¥¬«&¦O®¤¯¯k°°±±O²T¦T³Oª ´O®Oµ¦
²T¦T³Oª ´O®Oµ¦
¤\®Oµ¦
¤\®Oµ¦T¶¶S··
¸T¸T¸¸T¸T¸
¹º&»T¼T½O¾
¹º&»T¼T½O¾ ¿ ÀOÁÿ ÀOÁÃÂÁÁ ÁÄÃÅTÆTÇ\Á ÀÈÁÄÃÅTÆTÇ\Á ÀÈÉÉÆÆ&ÊÊ ÀTËOÁ ÌOÍOÎÀ
ÀTËOÁ ÌOÍOÎÀ Ï
ÍOÎÀ-ÐÒÑOÁÄÃÅ
Ï ¿
Ï
ÍOÎÀ-ÐÒÑOÁÄÃÅ
Ï ¿ ÍÍTÁÁ ÁÁÄÄÓÌOÍOÎÀ ÌOÍOÎÀ Ô-ÕÔ-Õ
Ö×TרÃÙTÚTÛ\× ÜÝOÙ
Ö×TרÃÙTÚTÛ\× ÜÝOÙTÞÞ&×× ß ÜO×ÃÖ×T×
ß
ÜO×ÃÖ×TרØ\ÙÙTÚÚ Û\× ÜÞàáÚ&âTÜTãO× äOå
Û\× ÜÞàáÚ&âTÜTãO× äOåOææÜÜ ç\èOéê-ëç\èOéê-ëíììTîîïï\ðTç\ñòôó
ðTç\ñòôó
èTîTîï`õOèOéèTîTîï`õOèOéêêöö
÷-ø
÷-ø
ù ú ð\û
ù ú ð\û ö&êOîÃüîTî
ö&êOîÃüîTîïï\ðTýTþ\î êÿýðTýTþ\î êÿýêêTî õOèOéê
î õOèOéê
ç\èOéê-ë ü
ç\èOéê-ë üîîîïÃðTýTþ\î êîïÃðTýTþ\î ê èèîîTîîïï
÷-ø
÷-ø
üîTîïÃðTýTþ\î êOð
üîTîïÃðTýTþ\î êOðTöö&îî ö&êOîÃüîTîö&êOîÃüîTîïï\ððTýý þ\î êöÿýTêOî õOè
þ\î êöÿýTêOî õOèOééêê
ç\èOéê-ëç\èOéê-ë üüîîTîîïÃðTýTþ\î êOðTö\î
ïÃðTýTþ\î êOðTö\î èTîèTîTîîïÃöïÃö
÷-ø
÷-ø
ýTêOî ýTêOî
! #"$
! #"$ %% &(')+*-,./&(')+*-,./$&&0011,2)
,2) 33
456
)7.
456
)7.988;:: ',#*-,2(<',#*-,2(<
3!=
.#*$/0
3!=
.#*$/0>>?8@:A</>0,
8@:A</>0,..(BB(**)CD)CD
E(F
),0G0H&
E(F
),0G0H& >>)).
E(F
),0G0
.
E(F
),0G0HH&&JII 456
)7.1,2) 456
)7.1,2) 0, 0,22()CD)CD
KK
15 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Service Components
Issues not covered by JMX
Dependencies between MBeans Service lifecycle
Packaging and deployment of MBeans
JBoss addresses these issues with the notions
of service MBean and deployable MBean
17 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
The JBoss Component Model
Service MBeans:
MBeans whose management interfaces include service lifecycle operations
Also called service components
Deployable MBeans:
Service MBeans packaged according to EJB-like conventions, in deployment units called service archives (SARs)
A SAR includes a service descriptor, an XML file that conveys information needed at deployment time
Also called deployable services
They are a JBoss - specific extension to JMX
Service Lifecycle
A service component may be in the stopped state or in the started state
At each state transition one of the following lifecycle operations is invoked on the MBean:
F
UH
D
W
H
V
WD
UW
V
WR
S
G
HV
W
U
R\
19 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
A Service Descriptor File (1 of 3)
! " #!$ %&('
! " #!$ %&(' )))) **
++ , -! &, -! & ./#0./#0#11-23
23457698;:<457698;:<=44?>>>>@8BA?C<D8FEC<GC5H?I
8BA?C<D8FEC<GC5H?IJJ#CC KK
L(M-N L(M-N
CC-O
K
O K PQ=RSSDTPQ=RSSDTUSS-VVWW7X?YZV
X?YZV [[ \
VQ]VWX?Y
\
VQ]VWX?YZZ#VV
^`_
^`_
a#bccd=ef
a#bccd=efggc#hji(b-khlc#hji(b-khlmmnnpooqd7c?m`rs-t#su`a-vbcc
d7c?m`rs-t#su`a-vbccddefg(c#hrefg(c#hr
a#bccd=ef
a#bccd=efggc#hji(b-khl
c#hji(b-khlmm ww-xxyz{x#|}#~ yz{x#|}#~ {{|
| ` #` #
--|
=
-|
=
-
-
-| z
-| z
((-----
- - ¡¢#£
¡¢#£
-¤¥
¤¥¦§7¨9©;ª«¦§7¨9©;ª«=¦¦?¬¬¬¬@©®-¯°©B±²(³?´pµ#¶--¦§©®-¯°©B±²(³?´pµ#¶--¦§··
¸¸
¹
µ-¯
¹
µ-¯ºº-»
¸
» ¸ ª«=¦¬¬D¼ ª«=¦¬¬D¼U¬¬-ºº§§7½?²¶º
½?²¶º
»» ±²(³?´pµ#¶--¦±²(³?´pµ#¶--¦§§7··
¸`¾
¸`¾
¿
µ§=²«
¿
µ§=²«ÀÀ#º
¹
µ-¯º»
#º
¹
µ-¯º»
¸¸ÁÁ µµ#³
¸`¾
§=Àº
¿-Â
µ§
³
¸`¾
§=Àº
¿-Â
µ§=²²«À(#º
¾
«À(#º
¾
¿-Â
¿-Â
¯«º-µ
¹
¯«º-µ
¹ ¾¾
©©©
©©©
A Service Descriptor File (2 of 3)
©©©
©©©
¿Ã
¿ÃÄÄÄÄ ÅDÆ7Ç ÈÉÅDÆ7Ç ÈÉ(ÇÇÊ-Ë Ì=ÍÈÏÎ#ÇÊ-Ë Ì=ÍÈÏÎ#Ç ÈÈÇÇÐÐÑÆ
ÑÆ ÒÒÒÒ ÓÓ
ÔÔ ÎÕÑ-Ç ÈÎÕÑ-Ç È ÊÍ#ÖÊÍ#Ö#ÑÑ-ר
ר
ÍÆ7Ð9Ù;ÚÕÍÆ7Ð9Ù;ÚÕ=ÍÍ?ÉÉÉÉ@Ù®Ë-ΰÙFÅDÆ7Ç ÈÉ(Ç#Ê-Ë Ì
Ù®Ë-ΰÙFÅDÆ7Ç ÈÉ(Ç#Ê-Ë Ì=ÍÍ?È=Û#Ç È(ÇÐ#ÑÆÈ=Û#Ç È(ÇÐ#ÑÆ`ÜÜ#ÑÑÆÆÝ?ÌÊÑ
Ý?ÌÊÑ
ØØ
È(Ç-Î
È(Ç-ÎÑÑ-רר ÚÕ=ÍÉÉDÞÚÕ=ÍÉÉDÞUÉÉ-ÑÑÆÆ7Ý?ÌÊÑÝ?ÌÊÑ ×× ÅDÆ7Ç ÈÉ(Ç#Ê-ËÅDÆ7Ç ÈÉ(Ç#Ê-Ë ÌÌ(ÍÈ=Û#Ç È(ÇÐ#ÑÍÈ=Û#Ç È(ÇÐ#ÑÆÆ ØØ ÓÓ
Ô ÇËËÆ=ÌÕ
Ô ÇËËÆ=ÌÕßßË#ÑjÈ(Ç-ÎÑ×
Ë#ÑjÈ(Ç-ÎÑרØ
ÅÅDÆÆ`Ç ÈÉ(Ç#Ê-Ë Ì=ÍÈ`ÅÌ=ÎÑ
Ç ÈÉ(Ç#Ê-Ë Ì=ÍÈ`ÅÌ=ÎÑÍÍ?ß(Ëß(Ë
Ø
Óàpáá
Ô
Ø
Óàpáá
Ô-ââ ÇÇËË#ËÆ=ÌÕß(Ë#Ñ
Ó
ËÆ=ÌÕß(Ë#Ñ
Ó
Ô
Ö#ÑãÑÈ(Ö
Ô
Ö#ÑãÑÈ(Ö ÉÉäÍã(Ë Ì=ÍÈ(ÇÍã(Ë Ì=ÍÈ(Ç#åå
ÒÒ
ÇÇ#ËËÆ=ÌÕß(Ë#ÑjÈ(Ç-ÎÑËËÆ=ÌÕß(Ë#ÑjÈ(Ç-ÎÑ××ØØææ Ì(Ö?çpÇ#Ê-ËÌ(Ö?çpÇ#Ê-Ë-ÍÍDÆÆèè Ø Ó Ø Ó
ÚÕ=ÍÉÉDÞUÉÑÚÕ=ÍÉÉDÞUÉÑÆÆÝÝ?ÌÌÊÑ
ÊÑ
×× æ
Ì(Ö?çpÇ#Ê-Ë-ÍÆè
æ
Ì(Ö?çpÇ#Ê-Ë-ÍÆè ÔÔââ Ö#ÑãÑÈ(Ö ÉÖ#ÑãÑÈ(Ö É
ÓÓ
Ô-â Ô-â ÎÕÑ-Ç ÈÎÕÑ-Ç È
ÓÓ
Ôé Ôé
ÒÒ ÒÒ ê-ëì
ê-ëì íí#îî ïðñòîóïðñòîó ôôôô
õõ
öö
÷ø
î-ù ú
÷ø
î-ù ú û ñ#í
û
ñ#í#îî-üý
üý ñó7þ9ÿ
ø
ñó7þ9ÿ
ø
ññ@ÿ;î
ø ÿ ê-ëì îïðñ
ÿ;î
ø ÿê-ëì îïðñòò îó
îó
ýý
ú(ù
÷
ú(ù
÷
îî-üýüý
ø
ñDÿ
ø
ñDÿ;îî øø
îó
û î îó
û î üü ê-ëì
ê-ëì îî ïðñòîóïðñòîó ý õ ý õ
ö
ùó
ø
ö
ùó ø
#îjú(ù
÷
îü
#îjú(ù
÷
îüýý !!
"$#
%&
"$#
%&('')) *%
#
*%
#
&++
&++,!!
## -
*!!/.0!
-
*!!/.0!112
2 33 4
5),!)2( ,
4
5),!)2( ,6),)78
6),)78
&&''+++,!
#
+,!
#
&++
&++,!!
## -
*!!/.0!
-
*!!/.0!1122 33 9
*:812
9
*:812 &('++&('++,!!
##
&('
&(' *(),*(),
##
;;;
;;;
21 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
A Service Descriptor File (3 of 3)
! "
! " ## $$!%'&%'&(*),+.-
(*),+.- ////0+1+1 # 2"3+.-
#
2"3+.-' 4
+1/5'6"
4 +1/5'6"'++1! '! '
&&
!%'&
%'&
- //37 - //371//!'*
#
# %% ''8 ''8922: 4 : 4 %% -' 4-' 4 &&
22
22 ;;
2< 5%
2< 5%'&&
=
- # 2(*2
= - # 2(*2 >@?>@?AAAAA!B!CEDFF
AAA!B!CEDFFGGHHIIEJFK5?JFK5?
BLKEM5KENL
BLKEM5KENL"OO?? P IQOO3R1O
P IQOO3R1O5KKGG6SSH5TKH5TK UU V
G*D"NODT!F"H
V
G*D"NODT!F"HQQNWD"NDXK'GNWD"NDXK'G
BBCCELLEKEM5KENL"O?
KEM5KENL"O?
B!C B!C YY I5K!D"NI5K!D"N ??
B!CO5K'G6S"K'GZ?
B!CO5K'G6S"K'GZ?
[
Note the “depends” elements
[
JBoss manages dependencies between deployable MBeans
Dependency Management
\
JBoss employs a variant of the component configurator pattern to control the lifecycle of deployable services
[
Deployment of SAR files with service MBeans are handled by a 6
]$5
^`_
'
a
H
bS
cOR
dfe\
gH
bU
hi
The 6
]$5
^`_
'
a
HS
bjcO
dR
e\
gH
bU
hplays the role of component configurator
i
A 6
kH
lUY
mnL
oFH
pql&
r
R
s
Q
tWU
uvmR
s
O
wO
wH
lU
mplays the role of component repository
x
Deployment/undeployment events drive the
lifecycle of deployable services
23 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Deployment and Undeployment
A 0
D
L
Q
'
H
S
O
R \H
U
handles all deployment units (SARs, JARs, EJB-JARs, WARs, RARs, etc.) by delegating the actual deployment tasks to sub-deployers:
6
$5
'
H
S
OR
\
H
U
, -
$
5
'
HS
O R
!
\
"
H
U
#, (
$-
%%'
&('H
)S
*O
+R\
,.-
HU
)0/, …
1
The set of sub-deployers is open-ended
1
Sub-deployers are service MBeans
2
They register themselves with the
3547698;:3747698;:=<<?>9@BA>9@CAEDD5<GF<.F
, which is also a service MBean
H
354=6=8;:9<=>3547698;:9<=>9@@IA?D5<A?DJ<GFF
,
KKMLLGNN;OO9P9Q9RBS?TJPP9Q9RCSETJPGUU
, and
VVXWZY;[9\W.Y;[9\=]]?^B_?`5\.a^B_?`J\Gaare not deployable components
b
All other deployers are deployable MBeans
Management interface of the MainDeployer
LQ
c5dW
eH
fU
gID
h=iF
j.kf0D
l i
L
cQ
d'H
m(fSO
n5oR
p\
qH
fU0
gl
%
rH
fD
iQ
dH
s
[
t
W
uH
sQG
v?wyxz
6H
{5s
UY
|~}L
F
H
s0%
G
H
s
D
Q
v^
Y
R
L
G
D
G
G
'H
5S
O
R\
7HU
6
X
E'
?H
S
O
R\
=H
U
G
HS
(O
R
\
HU
Y
R
L
G
U
H
P
RY
?¡
H
'
¢HS
£OR
¤E ¥\ H
U
6
¦M§X
¨E
©'
¢HS
J£O
¤R
\H
¥ U
G
ªH
S
£OR
¤? ¥\ H
U
«¬&
®
R
O
¤OH
¤9F
¯W
°L
±²³ ´O
¤LV
±5µW'
° ¢H
S
£O
¤R\
¥
H
U
V
µ ¦X«¬Y
¡
R
L
±G
ªG
¶H
·S
¸OR
¹Eº\
»
¼85
½(¾/
¿X
ÀU
ÁO
¹ ÂÃY
Ä
R
º
L
ÅG
¶X
ÀQ
ÆG
¶HS
·J¸O
¹R
º\
» ¼85
½J¾/
¿X
ÀUO
ÁI¹ Â ÃE
ÇR
ºR
ºOH
¹=·D
ÈQ
ÆLV
Å7É'
ÊH
·SO
¸5¹R\
º »H
·G
¶ ¼85
½J¾/
¿X
ÀUO
ÁI¹ Â Ã&
Ë
R
º
O
¹OH
¹9·F
ÌW
ÍL
ÅÎϺ ÆO
¹LV
Å5ÉW'
Í ÊH
·S
¸O
¹R\
º»
H
·
G
¶ ¼ ÂÃ Ð Ð7Ð`
Ñ25 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Hot Deployment
Just drop deployment units into a well-known directory
A '
H
S
O
R
\
P
H
Q
W6 F
D
Q
Q
HU
monitors the files in this directory
The '
HS
O
R\
D
P
H
QW6
F
DQ Q
H
U
!is a deployable MBean itself
A thread started by this MBean repeatedly scans the deployment directory and invokes the
0
"
DL
$#
Q
'
H
SO
%R
\H
&U
!whenever it detects a change
Class visibility is a function of time!
Class Loading Issues
A number of application servers use variants of a class loading approach that could be called loader-per-deployment
This approach creates a namespace per deployment unit
It hinders local interactions between separately deployed parts
Acceptable for application components
Unsuitable for the dynamically deployed parts of an
extensible system such as JBoss
27 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
What is bad about the Parent Delegation Model?
Middleware components need to share non- system classes in order to interact within a VM So they must be loaded by a set of class
loaders with a common ancestor, which loads the classes they share
This leads to a hierarchical deployment process (a “deployment tree”)
Cumbersome in dynamic environments
Does not match the DAG nature of component dependencies
Unified Class Loaders
A collection of unified class loaders acts as a single class loader
It places in a single (flat) namespace all classes it loads
This is a significant departure from the hierarchical class loading model introduced in JDK 1.2
Instances of 8QL
I
L
H
G &
O
D
V
V
/
R
D
GH U
are registered with a 8
Q
L
I
L
H
G /
R
D
G HU
5
H
S
R
V
L
W
R
U\
They behave as a single 8
5
/&
O
D
V
V/
R DG
"!HU
#%$that
allows its collection of URLs to be updated at any time
29 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Dynamic Proxy Usage
A dynamic proxy is an object adapter that converts the type-independent interface of its invocation handler into a list of interfaces specified at runtime
Dynamic proxies bridge the gap between the interfaces that are application-specific and those exposed by middleware components
The Dynamic Stub Idiom
In Java RMI:
Serializable types are normally passed by value
Remote types are normally passed by reference
What about a remote object that is also serializable?
If it has not been exported through the RMI system, then it will be passed by value (in serialized form)
This allows the creation of custom stubs, which interact over a custom protocol with the remote objects they represent
JBoss uses dynamic proxies as custom stubs
The dynamic proxy implements application interfaces
Its customized part is the invocation handler
31 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Meta-Level Architecture for Generalized EJBs
Meta-Level Architecture
Server Virtual Machine
MBean Server
Container MBean
Server-Side Interceptors
EJB Component Client Virtual Machine
Client-Side Interceptors
Invocation Handler
Dynamic Proxy
EJB Client
Invoker Proxy
EJB Container Invoker
MBean Client-Side
Proxy
Meta Level
Base Level
33 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Reified Method Invocations
No interface along the reified invocation path depends on base-level application types
!""#%$
%$
&
&
(''
)*
)*++
)*
)*++#
-,/.-,/.
0$
0$1""
2233546
467789:89:*663*;3*;6639
39<<=9=9 ::335467
467889:9:*663*;63*;6339<
9<==99 >>
??
8848
48 @@BA9:A9:CCD@FE@FE88GG GG8H
8HCC6688I
>
I >
??
884848 @@BA9:A9:CCD@FE
@FE88GG JJK1LK1L0MMKK1LLONJP
NJPQQRJRJSS TT
UUUU VVW0XW0X5YYZZWW[[\
[[\]] ^^5__`ba
`ba``cc
dd
__e_e_ ffBghaghaiiDfFj
fFj__kk hhml1_
l1_nn``aaonh
onh5ppOk_k_qqri*s_i*s_tt uuwvvvv
nnshx`shx`oonh
nhbhhssbsshyohyo0ll
zz{{r||
}}}}}}w~~~b
~b
* * *x **0**0
Invoker Architecture (1 of 3)
A powerful and flexible remote invocation architecture
EJB containers expose a type-independent LQ
Y
RN
H
operation
Protocol-specific invoker MBeans make this operation accessible to remote clients through various protocols (JRMP, IIOP, HTTP, SOAP)
Client-side stubs are dynamic proxy instances
They convert calls to the typed interfaces seen by clients into LQ
Y
R
N
H
calls on remote invokers
35 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Invoker Architecture (2 of 3)
Each client-side proxy has an invocation handler that performs remote calls on a given invoker, over the protocol supported by the invoker
Client side proxies and their invocation handlers are instantiated by the server and dynamically sent out to clients as serialized objects
Interface exposed by the JRMP invoker:
!! ""$##%%'&&(()##+**,,&&--..,,
//
00113225446677
8899::<;;99==?>>@99==5AABB@CCD::EEFFGG99
HHJIILKK
MMNNOOPPQQRR
SSTTVUUWW@XX PPYY5ZZ
TTDUUWW QQ[[RR
SSWW<TT
SSTTVUUWW QQ[[RR
SSDWWTT\\^]]
__
Invoker Architecture (3 of 3)
`
A client-side proxy (or, more precisely, its invocation handler) must “know a remote invoker”
`
This knowledge is protocol-specific
`
It is encapsulated within an invoker proxy
`
A local invoker handles the case of in-process calls in an optimized way
`
IIOP is treated as a special case in JBoss
a
Reason: interoperability with clients written in other
languages
37 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Generalized EJB Containers
A container MBean is created when an EJB is deployed
It provides middleware services to its EJB
(instance pooling, instance caching, persistence, security, transactions...)
… by merely aggregating aspects that do the real work
Container configurations (XML files)
For standard kinds of EJBs
For JBoss-specific extensions
Customized containers for generalized EJBs
Interceptors
Weavable aspects
Interceptor chains interposed at the client-side and at the server side
Client-side interceptors
Aspects that involve some form of context propagations (e.g., transactions and security)
Handle certain invocations that can be fully processed at the client side
Server-side interceptors
Transaction, security, logging, gathering of statistical data, entity instance locking, detection of reentrant calls,
management of relationships between entities
39 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Ongoing and Future Work
Ongoing Work and Next Steps
EJB 2.1 compliance
Performance optimizations AOP framework (JBoss 4.0)
Class, method, field, and constructor pointcuts can be dynamically attached to any POJO
Extensions to the meta-object protocol
supported by generalized EJB containers
41 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel
Related Work
JBoss owes a lot to many systems…
Flexinet (Hayton et al)
Flexible remote invocation paths
Dynamic stubs
Yasmin (Deri)
Hot-deployable components (“droplets”)
OpenCOM (Clarke et al)
Lightweight component model
Based on a subset of COM