• Nenhum resultado encontrado

The JBoss Extensible Server

N/A
N/A
Protected

Academic year: 2022

Share "The JBoss Extensible Server"

Copied!
23
0
0

Texto

(1)

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

(2)

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

(3)

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

(4)

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

(5)

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

(6)

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{{ |}|}~~jy€jy€$}‚

}‚${{ ƒƒ

„„†…‡

…‡ˆˆ‰‰ŠŠŒ‹N‹N ŽŽ,

,‘’‘’

ƒƒ

““Š



Š

*””••–– ‹N‹N

’’”–”–••

Š$—



Š$—



ˆ$˜=™ˆ$˜=™

šš››œ

œžžŸž Ÿž ¡¡ ¢¢ œœ$£š£š››œœžžŸŸžž ¡

 ¡ ¤¤¥¥§¦¦

¨¨

©

The metadata class MBeanInfo supports MBean introspection

©

Management attributes and operations does not need to

correspond to Java fields and methods

(7)

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€‚„ƒ…&†TxT‡O|

}&xO€‚„ƒ…&†TxT‡O| ˆˆ‰&ŠT‹TŒOŽ‰&ŠT‹TŒOŽ ‘‘O’’T““ ”O• –O—O˜“

”O• –O—O˜“ ™\šO›œT-ž™\šO›œT-ž

Ÿ  ¡\¢

Ÿ  ¡\¢ £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

(8)

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

(9)

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\

(10)

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 &('++&('++,!!

##

&('

&(' *(),*(),

##

;;;

;;;

(11)

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

b

S

c

OR

dfe

\

g

H

b

U

h

i

The 6

]

$5

^`_

'

a

HS

bjc

O

d

R

e

\

g

H

b

U

h

plays the role of component configurator

i

A 6

k

H

l

UY

mn

L

o

FH

pql

&

r

R

s

Q

t

WU

uvm

R

s

O

w

O

w

H

l

U

m

plays the role of component repository

x

Deployment/undeployment events drive the

lifecycle of deployable services

(12)

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?TJP

P9Q9RCSETJPGUU

, and

VVXWZY;[9\W.Y;[9\=]]?^B_?`5\.a^B_?`J\Ga

are not deployable components

b

All other deployers are deployable MBeans

Management interface of the MainDeployer

LQ

c5d

W

e

H

f

U

g

ID

h=i

F

j.kf

0D

l i

L

c

Q

d

'H

m(f

SO

n5o

R

p

\

q

H

f

U0

g

l

%

r

H

f

D

i

Q

d

H

s

[

t

W

u

H

s

QG

v?wyx

z

6H

{5s

UY

|~}

L



F

€

H

s

0%

G‚

H

s

D

ƒ

Q

v

^

„

Y

…

R

†

L

‡

G

ˆ

D

‰

G

Š

G

Š

'H

‹5Œ

S



O

Ž

R\

7

HU

Œ’‘

“

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

¤9ž

F

¯

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Ð

`

Ñ

(13)

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

(14)

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

(15)

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

(16)

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

(17)

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

(18)

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

(19)

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

(20)

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

(21)

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

Dependence management, reconfiguration, method

call interception

(22)

43 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel

Concluding Remarks

JBoss...

Demonstrates that application servers can be built out of dynamically deployed components that provide middleware services to application components

Brings reflective middleware to the world of

mainstream computing

(23)

45 Middleware 2003 – Rio de Janeiro – June 2003 Marc Fleury & Francisco Reverbel

Thank you for your attention!

Q & A ...

Marc Fleury

[email protected]

Francisco Reverbel

[email protected]

http://www.jboss.org

Referências

Documentos relacionados

(E) Exploração Sexual, Abuso sexual verbal e Violência Psicológica. 23) O abuso sexual é uma situação em que uma criança ou adolescente é usado para prazer sexual

Esses dados poderão ser mantidos por até 5 (cinco) anos, caso você venha a contratar um nano-empréstimo por meio da plataforma, com a finalidade de comprovação de

Em 31 de dezembro de 2013, o valor em risco dos derivativos detidos pela Braskem, definido como a maior perda que se pode ocasionar em um mês e em 95% dos casos, em condições

→ O comprimento máximo da clearway não pode ser superior à metade da pista nem a metade da distância horizontal percorrida pelo avião no  Lift Off   até atingir

O SAF-4 não foi viável técnica e financeiramente, situação resultante das condições impróprias do solo em que se encontra e da composição (espécies e espaçamentos). O

Se uma das tensões de fase do gerador ficar abaixo deste limite durante a alimentação da carga, um alarme de desligamento GENSET LOW VOLTAGE (BAIXA VOLTAGEM DO GERADOR) irá ocorrer

A Application Migration Tool também pode migrar aplicativos dos servidores de aplicativos Oracle ou JBoss para WebSphere Application Server V8.0, habilitando os padrões mais

Objetivo Capacitar o líder para enfrentar novos desafios e gerir pessoas e resultados, criar na equipe um clima de colaboração, motivação, aprendizagem e estimulador