Upload
qiana
View
49
Download
1
Embed Size (px)
DESCRIPTION
Abstraction of Transaction Demarcation in Component-Oriented Middleware. Romain Rouvoy - Philippe Merle Jacquard INRIA Project LIFL – USTL {Romain.Rouvoy, Philippe.Merle}@lifl.fr Second ObjectWeb Consortium conference, Paris, November 28 - 29th, 2002. Outline. Context Challenges - PowerPoint PPT Presentation
Citation preview
www.objectweb.org
Abstraction of Transaction Demarcation in
Component-Oriented Middleware
Romain Rouvoy - Philippe MerleJacquard INRIA Project
LIFL – USTL
{Romain.Rouvoy, Philippe.Merle}@lifl.fr
Second ObjectWeb Consortium conference,
Paris, November 28 - 29th, 2002
www.objectweb.org (JOTM) - D2 - 07/10/2002
Outline
Context
Challenges
Solution
Current experimentations
Conclusion
www.objectweb.org (JOTM) - D3 - 07/10/2002
Context
Under sun lights of middleware for components Enterprise Java Beans (EJB) CORBA Components (CCM) Next best things as .NET, Web Services, etc.
“Container” is the key technological artifact Transparent integration of extra functionalities
Transaction, security, persistency, server scalability, etc.
Various approaches Generated interception code, Fractal component membranes, AOP,
MOP, …
Many business components require “Transaction Demarcation (TD)” as fundamental extra functionality
All/any containers should/will address TD
www.objectweb.org (JOTM) - D4 - 07/10/2002
EJB Transaction Demarcation
EJB Container
Java Transaction Service (JTA)
6 TD policies:
- SUPPORTS- NEVER- MANDATORY- REQUIRED- NOT SUPPORTED- REQUIRES NEW
Integration already done by JOnASand any other EJB platforms
www.objectweb.org (JOTM) - D5 - 07/10/2002
Technical Challenge n°1
EJB Platform6 TD policies
ObjectTransaction
Service (OTS)
JavaTransaction
Service(JTA)
Next BestThings
(e.g. JOTM)
Not done by JOnAS, is it? Few EJB platforms could do this!
www.objectweb.org (JOTM) - D6 - 07/10/2002
Technical Challenge n°1
EJB Platform6 TD policies
ObjectTransaction
Service (OTS)
JavaTransaction
Service(JTA)
Next BestThings
(e.g. JOTM)
Requires abstraction of the TM integration!
www.objectweb.org (JOTM) - D7 - 07/10/2002
Technical Challenge n°2
Java OpenTransaction
Manager(JOTM)
CCM / OpenCCM EJB / JOnAS Next Best Things6 TD policies 6 TD policies 6 TD policies
Who addresses this factorization?
www.objectweb.org (JOTM) - D8 - 07/10/2002
Technical Challenge n°2
Java OpenTransaction
Manager(JOTM)
Requires abstraction of the 6 TD policies!
CCM / OpenCCM EJB / JOnAS Next Best Things
www.objectweb.org (JOTM) - D9 - 07/10/2002
Technical Challenge n°3
Java OpenTransaction
Manager(JOTM)
Abstraction of the 6 TD policies
CCM / OpenCCM EJB / JOnAS Next Best Things
How adding new TD policies?e.g. requires new sub transaction
www.objectweb.org (JOTM) - D10 - 07/10/2002
Technical Challenge n°4
Java OpenTransaction
Manager(JOTM)
Adding new TD policiese.g. requires new sub transaction
CCM / OpenCCM EJB / JOnAS Next Best Things
Requires independence between TD and TM!
ObjectTransaction
Service (OTS)
Next BestThings
(e.g. JOTM)
www.objectweb.org (JOTM) - D11 - 07/10/2002
Scientific Challenge
Abstraction of transaction demarcation in component-oriented middleware
Mastering what transaction demarcations are
Mastering what transaction managers are
Defining the Open Transaction Demarcation Framework (OTDF)
www.objectweb.org (JOTM) - D12 - 07/10/2002
Framework Challenge
CCM / OpenCCM EJB / JOnAS Next Best Things
ObjectTransaction
Service (OTS)
JavaTransaction
Service(JTA)
Next BestThings
(e.g. JOTM)
Open Transaction Demarcation Framework(OTDF)
www.objectweb.org (JOTM) - D13 - 07/10/2002
Software Challenge
Provides the Java Open Transaction Demarcation Framework (JOTDF)
Modular and extensible Aspect- and component-oriented Memory and CPU predictability No performance degradation
JOTDF should include UML diagrams Java interfaces Java classes Fractal components
www.objectweb.org (JOTM) - D14 - 07/10/2002
What is OTDF ?E
JB P
latf
orm OTS
JTS
JOTM
OTDF
CC
M P
latf
orm ?
www.objectweb.org (JOTM) - D15 - 07/10/2002
Technical Challenges n°1 :Transaction Manager Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Fac
tor
Poi
ntDefine a logical factorization
www.objectweb.org (JOTM) - D16 - 07/10/2002
Technical Challenges n°1 :Transaction Manager Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Fac
tor
Poi
ntNeed a common protocol
www.objectweb.org (JOTM) - D17 - 07/10/2002
Technical Challenges n°1 :Transaction Manager Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDFF
acto
r P
oint
Wrapper
Wrapper
Wrapper
Provide a TM abstraction
?
?
?
What is this abstraction ?
www.objectweb.org (JOTM) - D18 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Extract the policies
CC
M P
latf
orm
6 T
D p
olic
ies
6 T
D p
olic
ies
www.objectweb.org (JOTM) - D19 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
Switch(td) { case Supports :
… case Required :
… case NotSupported :
… case RequiresNew :
… case Mandatory :
… case Never :
…}
<<interface>>TransactionPolicy
Supports Required
NotSupported RequiresNew
Mandatory Never
JOnAS OTDF
Command Design Pattern
www.objectweb.org (JOTM) - D20 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Provide interfaces
CC
M P
latf
orm
6 T
D p
olic
ies
6 T
D p
olic
ies
www.objectweb.org (JOTM) - D21 - 07/10/2002
Required OTS
Not Supported OTS
Never OTS
Mandatory OTS
Supports OTS
Requires New OTS
Required JTS
Not Supported JTS
Never JTS
Mandatory JTS
Supports JTS
Requires New JTS
6 TD Policies :- SUPPORTS- NEVER- MANDATORY- REQUIRED- NOT SUPPORTED- REQUIRES NEW
Technical Challenges n°2 :Transaction Demarcation Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Technical code extraction
CC
M P
latf
orm
6 TD Policies :- SUPPORTS- NEVER- MANDATORY- REQUIRED- NOT SUPPORTED- REQUIRES NEW
www.objectweb.org (JOTM) - D22 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Technical code extraction
CC
M P
latf
orm
Required OTS
Not Supported OTS
Never OTS
Mandatory OTS
Supports OTS
Requires New OTS
Required JTS
Not Supported JTS
Never JTS
Mandatory JTS
Supports JTS
Requires New JTS
Not Supported JTS
Requires New JTS
Required JTS
Never JTS
Mandatory JTS
Supports JTS
Not Supported OTS
Requires New OTS
Required OTS
Never OTS
Mandatory OTS
Supports OTS
www.objectweb.org (JOTM) - D23 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Technical code extraction
CC
M P
latf
orm
Not Supported JTS
Requires New JTS
Required JTS
Never JTS
Mandatory JTS
Supports JTS
Not Supported OTS
Requires New OTS
Required OTS
Never OTS
Mandatory OTS
Supports OTS
www.objectweb.org (JOTM) - D24 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Technical code extraction
CC
M P
latf
orm
Not Supported JTS
Requires New JTS
Required JTS
Never JTS
Mandatory JTS
Supports JTS
Not Supported OTS
Requires New OTS
Required OTS
Never OTS
Mandatory OTS
Supports OTS
Requires New
Required
Mandatory
Not Supported
Never
Supports
www.objectweb.org (JOTM) - D25 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTMOTDF
Technical code extraction
CC
M P
latf
orm
JTS
JTS
JTS
JTS
JTS
JTS
Not Supported
Not Supported OTS
Requires New
Requires New OTS
Required
Required OTS
Never
Never OTS
Mandatory
Mandatory OTS
Supports
Supports OTS
www.objectweb.org (JOTM) - D26 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
EJB
Pla
tfo
rm
OTS
JTS
JOTMOTDFOnly demarcation code
CC
M P
latf
orm
JTS
Not Supported
Not Supported
Requires New
Requires New
Required
Required
Never
Never
Mandatory
Mandatory
Supports
SupportsOTS
Same demarcation type
?
www.objectweb.org (JOTM) - D27 - 07/10/2002
Technical Challenges n°3 :Adding new TD policies
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
CC
M P
latf
orm
JTS
Requires New
Requires New
OTS
Requires New
JOTM
Using actual demarcation type
www.objectweb.org (JOTM) - D28 - 07/10/2002
Technical Challenges n°3 :Adding new TD policies
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
CC
M P
latf
orm
JTS
Requires New
Requires New
OTS
Requires New
JOTM
Using actual demarcation type
No dependance
www.objectweb.org (JOTM) - D29 - 07/10/2002
Technical Challenges n°3 :Adding new TD policies
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Defining new demarcation type
CC
M P
latf
orm
JTS
Requires New
Requires New
Supports
SupportsOTS
Requires New SubRequires New Sub
www.objectweb.org (JOTM) - D30 - 07/10/2002
Technical Challenges n°3 :Adding new TD policies
EJB
Pla
tfo
rm
OTS
JTS
JOTM
OTDF
Defining new demarcation type
CC
M P
latf
orm
JTS
Requires New
Requires New
Supports
SupportsOTS
Requires New Sub
Requires New Sub
No dependance
www.objectweb.org (JOTM) - D31 - 07/10/2002
OTDF
Not Supported
Technical Challenges n°3 :Adding new TD policies
EJB
Pla
tfo
rm
OTS
JTS
JOTM
Composing existing policies
CC
M P
latf
orm
JTSRequired
Supports
Mandatory
OTS
Co
ord
ina
tor
Required
Not Supported
Never
www.objectweb.org (JOTM) - D32 - 07/10/2002
OTDF
Not Supported
Technical Challenges n°3 :Adding new TD policies
EJB
Pla
tfo
rm
OTS
JTS
JOTM
Composing existing policies
CC
M P
latf
orm
JTSRequired
Supports
Mandatory
OTS
Co
ord
ina
tor
Required
Not Supported
Never
www.objectweb.org (JOTM) - D33 - 07/10/2002
OTDF
Technical Challenges n°4 :Independence between TD and TM
EJB
Pla
tfo
rm
OTS
JTS
JOTM
Only demarcation code
CC
M P
latf
orm
JTS
Not Supported
Requires New
Required
Never
Mandatory
Supports
OTS
JOTM
?
www.objectweb.org (JOTM) - D34 - 07/10/2002
OTDF
Technical Challenges n°4 :Independence between TD and TM
EJB
Pla
tfo
rm
OTS
JTS
JOTM
Abstraction
CC
M P
latf
orm Not Supported
Requires New
Required
Never
Mandatory
SupportsTM OTS
TM
TM
JTS
JOTM
Ind
epen
den
ce
www.objectweb.org (JOTM) - D35 - 07/10/2002
Technical Challenges n°2 :Transaction Demarcation Abstraction
public interface UserTransaction { public int get_status (); public void begin (); public void commit (); public void rollback (); public void set_rollback_only (); public void set_transaction_timeout (int seconds);}
public interface TransactionManager extends UserTransaction { public Transaction get_transaction (); public Transaction suspend (); public void resume (Transaction tx);}
TMOTS
<<interface>>UserTransaction
<<interface>>TransactionManager
www.objectweb.org (JOTM) - D36 - 07/10/2002
OTDF
Technical Challenges n°4 :Independence between TD and TM
CC
M P
latf
orm
OTS
JTS
JOTM
Instance
EJB
Pla
tfo
rm
Not Supported
Requires New
Required
Never
Mandatory
Supports
TM OTS
TM
TM
JTS
JOTM
Not Supported
Requires New
Required
Never
Mandatory
Supports
www.objectweb.org (JOTM) - D37 - 07/10/2002
OTDF
New Technical Challenge :Organisation of the TD
OTS
JTS
JOTM
How to structure the policies ?
Not Supported
Requires New
Required
Never
Mandatory
SupportsTM OTS
TM
TM
JTS
JOTM
Org
aniz
atio
n ?
www.objectweb.org (JOTM) - D38 - 07/10/2002
InterruptionActivationInterrogation
New Technical Challenge :Organization of the TD
Not Supported
Required
Never
Mandatory
Supports
Requires New
No hierarchy/organization in the policies !Observing policies to define a structureMapping between policies and the structure
www.objectweb.org (JOTM) - D39 - 07/10/2002
Domain
OTDF
New Technical Challenge :Organization of the TD
OTS
JTS
JOTM
?
TM OTS
TM
TM
JTS
JOTM
Supports
Mandatory
Never
Required
Not Supported
Requires New
Interrogation
Interrogation
Activation
Interruption
Interruption
Activation
www.objectweb.org (JOTM) - D40 - 07/10/2002
New Technical Challenge :Organization of the TD
public interface DomainInterrogation extends DomainProtocol { public int get_status(RequestCallContext ctx) ;}
public interface DomainActivation extends TransactionStatus { public void begin(RequestCallContext ctx) ; public void commit(RequestCallContext ctx) ;}
public interface DomainInterruption extends TransactionStatus { public void suspend(RequestCallContext ctx) ; public void resume(RequestCallContext ctx) ; }
<<interface>>DomainInterrogation
<<interface>>DomainProtocol
<<interface>>DomainActivation
<<interface>>DomainInterruption
www.objectweb.org (JOTM) - D41 - 07/10/2002
Domains TMTD
Domain
OTDF
New Technical Challenges :Organization of the TD
OTS
JTS
JOTM
TM OTS
TM
TM
JTS
JOTM
Interrogation
Interruption
Activation
Supports
Mandatory
Never
Required
Not Supported
Requires New
www.objectweb.org (JOTM) - D42 - 07/10/2002
New Technical Challenges :Organization of the TD
public class RequiredPolicyImpl extends AbstractActivationPolicy implements RequiredPolicy {
public RequiredPolicyImpl(TransactionActivation ta) { super(ta); }
public void preinvoke(RequestCallContext ctx) { if (ta.get_status(ctx)==Status.STATUS_NO_TRANSACTION) ta.begin(ctx); }
public void postinvoke(RequestCallContext ctx) { ta.commit(ctx); }}
<<abstract>>ActivationPolicyImpl
ActivationPolicy
<<interface>>RequiredPolicy
RequiredPolicyImpl
www.objectweb.org (JOTM) - D43 - 07/10/2002
The ODTF Framework
OTDF
TM OTS
TM
TM
JTS
JOTM
Domain
Not Supported
Required
Never
Mandatory
Supports
Not Supported
Required
Never
Mandatory
Required
Never
Mandatory
Requires New
Requires New
Requires New
Not Supported
Interrogation
Activation
Interruption
Domain
Interrogation
Activation
Interruption
Domain
Interrogation
Activation
Interruption
Mul
ti-pl
atef
orm
Mul
ti-T
rans
actio
n M
anag
er
Ext
ensi
ons
Org
anis
atio
n
Adaptability Configuration
www.objectweb.org (JOTM) - D44 - 07/10/2002
Class Evaluation
Before (without ODTF)Nb Classes = Nb TD x Nb TME.g. = 6 TD x 3 TM = 18 Classes
After (with ODTF)Nb Classes = Nb TD + Nb Domaines + Nb TME.g. : 6 TD + 3 Domains + 3 TM = 12 Classes
www.objectweb.org (JOTM) - D45 - 07/10/2002
Context of the experimentation
Specifications :Computer :
Type : DELL Optiflex GX240CPU : Intel Pentium 4 2.00GHzRAM : 1024 MoBogomips : 3971.48OS : Linux DebianKernel : 2.4.19-686
JDK : Version : 1.4.1_01
JOnAS : Version : 2.5.3 (from CVS)
JOTDF :Using Fractal : noFramework Level : 2
www.objectweb.org (JOTM) - D46 - 07/10/2002
Context of the experimentation
Experimentation :JOnAS example : sbInvocation : method buy()Type :
1000 invocations inside a transaction1000 invocations outside a transaction
Measure :global execution timenumber :
–10 on JOnAS platform
–10 on JOnAS platform with JOTDF
www.objectweb.org (JOTM) - D47 - 07/10/2002
The JOnAS’s JODTF Framework
JTS
Not Supported
Required
Never
Mandatory
Requires New
JOnA
S (
EJB
) P
latf
orm
JTS
Supports
Interrogation
Activation
Interruption
JOTDF
www.objectweb.org (JOTM) - D49 - 07/10/2002
Time EvaluationBlack Box
Policies JOnAS JOnAS & JODTF Variation
None - - -
Supports 36.475 sec 37.560 sec 102.97 %
Required 53.047 sec 53.190 sec 100.27 %
Not Supported 27.994 sec 28.563 sec 102.03 %
Requires New 56.590 sec 57.563 sec 101.02 %
Mandatory 127.221 sec 127.514 sec 100.2 %
Never 109.610 sec 110.438 sec 100.8 %
Average 101.26 %
www.objectweb.org (JOTM) - D50 - 07/10/2002
Theoric EvaluationWhite Box
Policies
(Test or Invocation)
JOnAS
(Pre) + (Post)
JOnAS & JODTF
(Pre) + (Post)
None - -
Supports 5 + 3 1 + 1
Required 5 + 5 2 + 2
Not Supported 5 + 3 2 + 2
Requires New 5 + 4 2 + 2
Mandatory 3 + 0 2 + 0
Never 2 + 0 2 + 0
Average 4.16 + 2.5 1.83 + 1.16
www.objectweb.org (JOTM) - D51 - 07/10/2002
Conclusion
We could abstract transaction demarcation in middleware platforms for components with high added values
Modular and extensible Aspect- and component-oriented Better memory and CPU predictability No performance degradation
The framework and its code base are available UML diagrams Java interfaces and classes Fractal components
Seamless JOnAS integration done By removing transactional code in JOnAS ;-) By adding adaptation code for our framework ;-( Better integration = Think JOnAS containers as clients of our
framework
www.objectweb.org (JOTM) - D52 - 07/10/2002
Return to The Future
Apply our approach to some other extra functionalities dealt by containers
Distributed logging? Security access control? Others?
Need for a generic and common way for integration/interposition in “containers”
Fractal and ASM bytecode generation? Java Aspect Components (JAC)? Meta Object Protocol (MOP)? Interaction service from I3S? Or other adaptation techniques?
www.objectweb.org (JOTM) - D53 - 07/10/2002
Questions