Mail Archive Home | gotm-commits List | July 2005 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Monday, July 18, 2005 @ 09:30:11
Author: rouvoy
Path: /cvsroot/gotm/gotm
Added: src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java
src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java
src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
Modified: src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal
src/fractal/org/objectweb/gotm/lib/logging/TpLoggingHOWL.fractal
src/java/org/objectweb/gotm/Gotm.java
src/java/org/objectweb/gotm/lib/CurrentHandler.java
src/java/org/objectweb/gotm/lib/CurrentManager.java
src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java
src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java
src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java
src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java
src/java/org/objectweb/gotm/lib/event/PublishASyncThread.java
src/java/org/objectweb/gotm/lib/logging/GenericLogger.java
src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java
src/java/org/objectweb/gotm/lib/logging/SimpleLogger.java
src/java/org/objectweb/gotm/lib/resource/ActionProvider.java
src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java
src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java
src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java
src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java
src/java/org/objectweb/gotm/lib/transaction/TransactionStateAuto.java
src/java/org/objectweb/gotm/lib/transaction/TransactionStateImpl.java
Removed: doc/technical/architecture.aux doc/technical/architecture.log
doc/technical/architecture.pdf
src/java/org/objectweb/gotm/lib/resource/AbstractActionProvider.java
src/java/org/objectweb/gotm/lib/resource/AbstractResourceManager.java
* Adding support for JTS compatibility,
* Introducing Local JTS JUnit tests as an example.
-------------------------------------------------------------------------+
doc/technical/architecture.aux |
81 ---
doc/technical/architecture.log |
220 ----------
doc/technical/architecture.pdf |
<<Binary file>>
src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal |
4
src/fractal/org/objectweb/gotm/lib/logging/TpLoggingHOWL.fractal |
2
src/java/org/objectweb/gotm/Gotm.java |
104 ++--
src/java/org/objectweb/gotm/lib/CurrentHandler.java |
163 +++----
src/java/org/objectweb/gotm/lib/CurrentManager.java |
24 -
src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java |
10
src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java |
12
src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java |
8
src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java |
30 -
src/java/org/objectweb/gotm/lib/event/PublishASyncThread.java |
12
src/java/org/objectweb/gotm/lib/logging/GenericLogger.java |
7
src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java |
19
src/java/org/objectweb/gotm/lib/logging/SimpleLogger.java |
12
src/java/org/objectweb/gotm/lib/resource/AbstractActionProvider.java |
78 ---
src/java/org/objectweb/gotm/lib/resource/AbstractResourceManager.java |
118 -----
src/java/org/objectweb/gotm/lib/resource/ActionProvider.java |
7
src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java |
82 +++
src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java |
57 ++
src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java |
57 ++
src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java |
104 ++--
src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java |
186 ++++++++
src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java |
46 --
src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java |
30 -
src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java |
26 -
src/java/org/objectweb/gotm/lib/transaction/TransactionStateAuto.java |
18
src/java/org/objectweb/gotm/lib/transaction/TransactionStateImpl.java |
12
29 files changed, 730 insertions(+), 799 deletions(-)
Index: gotm/doc/technical/architecture.aux
diff -u gotm/doc/technical/architecture.aux:1.1
gotm/doc/technical/architecture.aux:removed
--- gotm/doc/technical/architecture.aux:1.1 Wed Dec 8 15:00:32 2004
+++ gotm/doc/technical/architecture.aux Mon Jul 18 09:30:11 2005
@@ -1,81 +0,0 @@
-\relax
-\@writefile{toc}{\contentsline {section}{\numberline {1}Objectives}{1}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}Abstract
Objectives}{1}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}Concrete
Objectives}{1}}
-\@writefile{toc}{\contentsline {section}{\numberline {2}Description of
GoTM}{1}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}The general
architecture}{1}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.1.1}A Modular
and Extensible Framework}{1}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.1.2}A Set of
Kell Components}{2}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.1.3}A Set of
Plugins Components}{2}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.1.4}A Set of
Tools}{2}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}The kernel of
GoTM}{2}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.2.1}The
Transaction Component}{2}}
-\@writefile{toc}{\contentsline {paragraph}{The Transaction State}{2}}
-\@writefile{toc}{\contentsline {paragraph}{The Activation Feature}{2}}
-\@writefile{toc}{\contentsline {paragraph}{The Interruption Feature}{2}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.2.2}The Event
Component}{2}}
-\@writefile{toc}{\contentsline {paragraph}{The Enlistement Feature}{2}}
-\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces GoTM
Component Description}}{3}}
-\newlabel{fig:gotm-cpt}{{1}{3}}
-\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces
Transaction Component Description}}{4}}
-\newlabel{fig:transaction-cpt}{{2}{4}}
-\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Event
Component Description}}{5}}
-\newlabel{fig:event-cpt}{{3}{5}}
-\@writefile{toc}{\contentsline {paragraph}{The Notification Feature}{6}}
-\@writefile{toc}{\contentsline {paragraph}{The Listener Feature}{6}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.2.3}The
Coordination Component}{6}}
-\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces
Coordination Component Description}}{6}}
-\newlabel{fig:coordination-cpt}{{4}{6}}
-\@writefile{toc}{\contentsline {paragraph}{The Process Feature}{6}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.2.4}The State
Component}{7}}
-\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces State
Component Description}}{7}}
-\newlabel{fig:state-cpt}{{5}{7}}
-\@writefile{toc}{\contentsline {paragraph}{The State Feature}{7}}
-\@writefile{toc}{\contentsline {paragraph}{The State Connector}{7}}
-\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Flat
Transaction States Description}}{8}}
-\newlabel{fig:transaction-state}{{6}{8}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.2.5}The
Resource Component}{9}}
-\@writefile{toc}{\contentsline {paragraph}{The Enlistment Feature}{9}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.2.6}The XID
Component}{9}}
-\@writefile{toc}{\contentsline {paragraph}{The XID State}{9}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}The
extensions}{9}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.1}The
personalities}{9}}
-\@writefile{toc}{\contentsline {paragraph}{CORBA}{9}}
-\@writefile{toc}{\contentsline {subparagraph}{Object Transaction Manager}{9}}
-\@writefile{toc}{\contentsline {subparagraph}{Component Transaction
Manager}{9}}
-\@writefile{toc}{\contentsline {subparagraph}{Activity Transaction
Manager}{9}}
-\@writefile{toc}{\contentsline {paragraph}{J2EE}{9}}
-\@writefile{toc}{\contentsline {subparagraph}{Java Transaction API and Java
Transaction Service}{9}}
-\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces JTS
Component Description}}{10}}
-\newlabel{fig:jts-cpt}{{7}{10}}
-\@writefile{toc}{\contentsline {subparagraph}{Transaction Manager MBean}{11}}
-\@writefile{toc}{\contentsline {subparagraph}{Activity Transaction
Manager}{11}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.2}The
Plugins}{11}}
-\@writefile{toc}{\contentsline {paragraph}{Transaction Demarcation}{11}}
-\@writefile{toc}{\contentsline {paragraph}{Transaction Automaton}{11}}
-\@writefile{toc}{\contentsline {subparagraph}{Resource/Synchronization
Automaton}{11}}
-\@writefile{toc}{\contentsline {subparagraph}{Concurrency Automaton}{11}}
-\@writefile{toc}{\contentsline {paragraph}{Transaction Structures}{11}}
-\@writefile{toc}{\contentsline {subparagraph}{Transparent List/Map}{11}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline
{2.3.3}Distributed Architecture}{11}}
-\@writefile{toc}{\contentsline {paragraph}{Remote Transaction Framework}{11}}
-\@writefile{toc}{\contentsline {paragraph}{Distributed Transaction
Framework}{11}}
-\@writefile{toc}{\contentsline {section}{\numberline {3}The Tools}{11}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Design
Tool}{11}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Deployment
Tool}{11}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Administration
Tool}{12}}
-\@writefile{toc}{\contentsline {section}{\numberline {4}Experiments and
Results}{12}}
-\@writefile{toc}{\contentsline {subsection}{\numberline
{4.1}Description}{12}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Processor
Metrics}{12}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Memory
Metrics}{12}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {4.4}Today
Assessments}{12}}
-\@writefile{toc}{\contentsline {section}{\numberline {5}After GoTM?}{12}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Towards
Behavior Validation}{12}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.1.1}How to
Ensure a Transactional Behavior?}{12}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.1.2}How to
Ensure the Compliancy with a Standard?}{12}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {5.2}From Models to
Middleware}{12}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.2.1}A Model
for Transaction Frameworks}{12}}
-\@writefile{toc}{\contentsline {paragraph}{Features Description}{12}}
-\@writefile{toc}{\contentsline {paragraph}{Status Mapping}{12}}
-\@writefile{toc}{\contentsline {paragraph}{State/Behavior Description}{12}}
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.2.2}Towards
Automatic Generation/Assembly}{13}}
Index: gotm/doc/technical/architecture.log
diff -u gotm/doc/technical/architecture.log:1.1
gotm/doc/technical/architecture.log:removed
--- gotm/doc/technical/architecture.log:1.1 Wed Dec 8 15:00:32 2004
+++ gotm/doc/technical/architecture.log Mon Jul 18 09:30:11 2005
@@ -1,221 +0,0 @@
-This is pdfeTeXk, Version 3.141592-1.11a-2.1 (Web2C 7.5.2) (format=pdflatex
2004.1.12) 14 MAY 2004 15:39
-entering extended mode
- %&-line parsing enabled.
- (/usr/local/teTeX/share/texmf.tetex/web2c/cp8bit.tcx)
-**architecture.tex
-(./architecture.tex{/usr/local/teTeX/share/texmf.local/pdftex/config/pdftex.cfg
-}
-LaTeX2e <2001/06/01>
-Babel <v3.7h> and hyphenation patterns for american, french, nohyphenation,
loa
-ded.
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/base/article.cls
-Document Class: article 2001/04/21 v1.4e Standard LaTeX document class
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/base/size10.clo
-File: size10.clo 2001/04/21 v1.4e Standard LaTeX file (size option)
-)
-\c@part=\count79
-\c@section=\count80
-\c@subsection=\count81
-\c@subsubsection=\count82
-\c@paragraph=\count83
-\c@subparagraph=\count84
-\c@figure=\count85
-\c@table=\count86
-\abovecaptionskip=\skip41
-\belowcaptionskip=\skip42
-\bibindent=\dimen102
-)
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/psnfss/times.sty
-Package: times 2002/09/08 PSNFSS-v9.0a (SPQR)
-)
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/graphicx.sty
-Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
-
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/keyval.sty
-Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
-\KV@toks@=\toks14
-)
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/graphics.sty
-Package: graphics 2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR)
-
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/trig.sty
-Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
-)
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/config/graphics.cfg
-File: graphics.cfg 2001/08/31 v1.1 graphics configuration of teTeX/TeXLive
-)
-Package graphics Info: Driver file: pdftex.def on input line 80.
-
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/pdftex.def
-File: pdftex.def 2002/06/19 v0.03k graphics/color for pdftex
-\Gread@gobject=\count87
-))
-\Gin@req@height=\dimen103
-\Gin@req@width=\dimen104
-)
-(./architecture.aux)
-\openout1 = `architecture.aux'.
-
-LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 27.
-LaTeX Font Info: ... okay on input line 27.
-LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 27.
-LaTeX Font Info: ... okay on input line 27.
-LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 27.
-LaTeX Font Info: ... okay on input line 27.
-LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 27.
-LaTeX Font Info: ... okay on input line 27.
-LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 27.
-LaTeX Font Info: ... okay on input line 27.
-LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 27.
-LaTeX Font Info: ... okay on input line 27.
-LaTeX Font Info: Try loading font information for OT1+ptm on input line
27.
-
-(/usr/local/teTeX/share/texmf.tetex/tex/latex/psnfss/ot1ptm.fd
-File: ot1ptm.fd 2001/06/04 font definitions for OT1/ptm.
-)
-(/usr/local/teTeX/share/texmf.tetex/tex/context/base/supp-pdf.tex
-(/usr/local/teTeX/share/texmf.tetex/tex/context/base/supp-mis.tex
-loading : Context Support Macros / Missing
-\protectiondepth=\count88
-\scratchcounter=\count89
-\scratchtoks=\toks15
-\scratchdimen=\dimen105
-\scratchskip=\skip43
-\scratchmuskip=\muskip10
-\scratchbox=\box26
-\scratchread=\read1
-\scratchwrite=\write3
-\zeropoint=\dimen106
-\minusone=\count90
-\thousandpoint=\dimen107
-\emptytoks=\toks16
-\nextbox=\box27
-\nextdepth=\dimen108
-\everyline=\toks17
-\!!counta=\count91
-\!!countb=\count92
-\recursecounter=\count93
-)
-loading : Context Support Macros / PDF
-\nofMPsegments=\count94
-\nofMParguments=\count95
-\everyMPtoPDFconversion=\toks18
-)
-LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <12> on input line 37.
-LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <8> on input line 37.
-LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <6> on input line 37.
-LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <14.4> not available
-(Font) Font shape `OT1/ptm/b/n' tried instead on input line 40.
-LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <12> not available
-(Font) Font shape `OT1/ptm/b/n' tried instead on input line 45.
-LaTeX Font Info: Try loading font information for OMS+ptm on input line
47.
- (/usr/local/teTeX/share/texmf.tetex/tex/latex/psnfss/omsptm.fd
-File: omsptm.fd
-)
-LaTeX Font Info: Font shape `OMS/ptm/m/n' in size <10> not available
-(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 47.
-LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <7> on input line 65.
-LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <5> on input line 65.
-
-Overfull \hbox (1.93596pt too wide) in paragraph at lines 65--67
-[]$/cmr10/3$ /ptmr7t/lev-els ar-chi-tec-ture (GoTM com-po-nents,
Kell/Standard/
-Personality com-po-nents,
- []
-
-LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <10> not available
-(Font) Font shape `OT1/ptm/b/n' tried instead on input line 69.
-[1
-
-{/usr/local/teTeX/share/texmf.tetex/dvips/config/pdftex.map}]
-<GoTMComponent.pdf, id=15, 845.1575pt x 597.23125pt>
-File: GoTMComponent.pdf Graphic file (type pdf)
- <use GoTMComponent.pdf>
-Overfull \hbox (167.1496pt too wide) in paragraph at lines 104--104
- []
- []
-
-<TransactionComponent.pdf, id=16, 845.1575pt x 597.23125pt>
-File: TransactionComponent.pdf Graphic file (type pdf)
-
-<use TransactionComponent.pdf>
-Overfull \hbox (167.1496pt too wide) in paragraph at lines 119--119
- []
- []
-
-<EventComponent.pdf, id=17, 845.1575pt x 597.23125pt>
-File: EventComponent.pdf Graphic file (type pdf)
- <use EventComponent.pdf>
-Overfull \hbox (167.1496pt too wide) in paragraph at lines 151--151
- []
- []
-
-[2] [3 <./GoTMComponent.pdf>] [4 <./TransactionComponent.pdf>] [5
<./EventCompo
-nent.pdf>] <CoordinationComponent.pdf, id=66, 845.1575pt x 597.23125pt>
-File: CoordinationComponent.pdf Graphic file (type pdf)
-
-<use CoordinationComponent.pdf>
-Overfull \hbox (167.1496pt too wide) in paragraph at lines 180--180
- []
- []
-
-<StateComponent.pdf, id=67, 845.1575pt x 597.23125pt>
-File: StateComponent.pdf Graphic file (type pdf)
- <use StateComponent.pdf>
-Overfull \hbox (167.1496pt too wide) in paragraph at lines 197--197
- []
- []
-
-[6 <./CoordinationComponent.pdf>]
-<TransactionState.pdf, id=77, 845.1575pt x 597.23125pt>
-File: TransactionState.pdf Graphic file (type pdf)
-
-<use TransactionState.pdf>
-Overfull \hbox (224.05511pt too wide) in paragraph at lines 221--221
- []
- []
-
-
-LaTeX Warning: Float too large for page by 260.80768pt on input line 227.
-
-[7 <./StateComponent.pdf>] [8 <./TransactionState.pdf>]
-Overfull \hbox (3.39684pt too wide) in paragraph at lines 272--275
- /ptmb7t/Com-po-nent Trans-ac-tion Man-ager[] /ptmr7t/aims to pro-vide a
CORBA
-Com-po-nent Model
- []
-
-
-Overfull \hbox (4.62692pt too wide) in paragraph at lines 276--277
- /ptmb7t/Ac-tiv-ity Trans-ac-tion Man-ager[] /ptmr7t/aims to pro-vide an
im-ple
--men-ta-tion of the CORBA
- []
-
-<JTSComponent.pdf, id=108, 845.1575pt x 597.23125pt>
-File: JTSComponent.pdf Graphic file (type pdf)
- <use JTSComponent.pdf>
-Overfull \hbox (167.1496pt too wide) in paragraph at lines 287--287
- []
- []
-
-[9] [10 <./JTSComponent.pdf>] [11] [12] [13] (./architecture.aux) )
-Here is how much of TeX's memory you used:
- 1000 strings out of 95328
- 13066 string characters out of 1187693
- 60174 words of memory out of 1511701
- 4089 multiletter control sequences out of 10000+50000
- 16516 words of font info for 36 fonts, out of 1000000 for 2000
- 14 hyphenation exceptions out of 1000
- 25i,6n,21p,207b,255s stack positions out of 5000i,500n,6000p,200000b,40000s
- 130 PDF objects out of 300000
- 0 named destinations out of 131072
- 36 words of extra memory for PDF output out of 65536
-{/usr/local/
-teTeX/share/texmf.tetex/dvips/tetex/f7b6d320.enc}</usr/local/teTeX/share/texmf.
-tetex/fonts/type1/bluesky/cm/cmr10.pfb>{/usr/local/teTeX/share/texmf.tetex/dvip
-s/tetex/bbad153f.enc}</usr/local/teTeX/share/texmf.tetex/fonts/type1/bluesky/cm
-/cmsy10.pfb>{/usr/local/teTeX/share/texmf.tetex/dvips/psnfss/8r.enc}
-Output written on architecture.pdf (13 pages, 77148 bytes).
Index: gotm/doc/technical/architecture.pdf
cvs rdiff: failed to read diff file header /tmp/cvsbs5FbZ for
architecture.pdf,v: end of file
Index: gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal
diff -u
gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal:1.3
gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal:1.4
--- gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal:1.3
Mon Jul 11 10:27:04 2005
+++ gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal Mon
Jul 18 09:30:10 2005
@@ -30,8 +30,8 @@
<binding client="FcLogger.xid-provider"
server="this.xid-provider"/>
<binding client="FcCommitEngine.commit-decision"
server="this.sync-publish"/>
- <binding client="FcCommitEngine.prepare-decision"
server="this.async-publish"/>
- <binding client="FcCommitEngine.abort-decision"
server="this.async-publish"/>
+ <binding client="FcCommitEngine.prepare-decision"
server="this.sync-publish"/>
+ <binding client="FcCommitEngine.abort-decision"
server="this.sync-publish"/>
<binding client="FcCommitEngine.prepare-log" server="FcLogger.empty"/>
<binding client="FcCommitEngine.commit-log" server="FcLogger.empty"/>
Index: gotm/src/fractal/org/objectweb/gotm/lib/logging/TpLoggingHOWL.fractal
diff -u
gotm/src/fractal/org/objectweb/gotm/lib/logging/TpLoggingHOWL.fractal:1.1
gotm/src/fractal/org/objectweb/gotm/lib/logging/TpLoggingHOWL.fractal:1.2
--- gotm/src/fractal/org/objectweb/gotm/lib/logging/TpLoggingHOWL.fractal:1.1
Mon Jul 11 10:27:05 2005
+++ gotm/src/fractal/org/objectweb/gotm/lib/logging/TpLoggingHOWL.fractal
Mon Jul 18 09:30:10 2005
@@ -14,7 +14,7 @@
signature="org.objectweb.gotm.lib.xid.XidFeature"/>
<component name="FcProvider"
-
definition="org.objectweb.gotm.lib.logging.TpHOWLoggerProvider(log.txt,.)"/>
+
definition="org.objectweb.gotm.lib.logging.TpHOWLoggerProvider(log.txt,output)"/>
<component name="FcForceLogger"
definition="org.objectweb.gotm.lib.logging.TpGenericLogger(true)"/>
<component name="FcNoForceLogger"
Index: gotm/src/java/org/objectweb/gotm/Gotm.java
diff -u gotm/src/java/org/objectweb/gotm/Gotm.java:1.4
gotm/src/java/org/objectweb/gotm/Gotm.java:1.5
--- gotm/src/java/org/objectweb/gotm/Gotm.java:1.4 Mon Jan 10 17:16:06
2005
+++ gotm/src/java/org/objectweb/gotm/Gotm.java Mon Jul 18 09:30:11 2005
@@ -1,71 +1,84 @@
/*====================================================================
-GoTM: GoTM is an open Transaction Monitor
-Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
-Contact: gotm-team@xxxxxxxxxxxxx
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA
-
-Initial developer(s): Romain Rouvoy.
-Contributor(s): .
-
----------------------------------------------------------------------
-$Id: Gotm.java,v 1.4 2005/01/10 16:16:06 rouvoy Exp $
-====================================================================*/
+ GoTM: GoTM is an open Transaction Monitor
+ Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
+ Contact: gotm-team@xxxxxxxxxxxxx
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
+
+ Initial developer(s): Romain Rouvoy.
+ Contributor(s): .
+
+ ---------------------------------------------------------------------
+ $Id: Gotm.java,v 1.5 2005/07/18 07:30:11 rouvoy Exp $
+ ====================================================================*/
package org.objectweb.gotm;
-import java.util.HashMap;
import java.util.Map;
-import org.objectweb.fractal.adl.ADLException;
import org.objectweb.fractal.adl.Factory;
import org.objectweb.fractal.adl.FactoryFactory;
+import org.objectweb.fractal.api.Component;
+import org.objectweb.fractal.api.Interface;
+import org.objectweb.fractal.api.NoSuchInterfaceException;
+import org.objectweb.fractal.util.Fractal;
/**
* Constructor class
*
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class Gotm {
- private static GotmFactoryImpl factory ;
+
+ /** <code>cache</code> . */
+ protected static Component cache ;
- static {
- Factory ff = null;
+ /**
+ * @param desc
+ * @param context
+ * @return instance of component created.
+ */
+ public static Component create(String desc, Map context) {
+ if (cache != null) return cache;
try {
- ff = FactoryFactory.getFactory(FactoryFactory.JAVA_BACKEND);
- } catch (ADLException e) {
- e.printStackTrace();
+ Factory f =
FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND);
+ cache = (Component) f.newComponent(desc, context);
+ Fractal.getLifeCycleController(cache).startFc();
+ return cache;
+ } catch (Exception e) {
+ System.err.println(e);
+ throw new GoTMException(e);
}
- Map context = new HashMap();
- String back = System.getProperty("backend");
- context.put("backend",
back==null?FactoryFactory.FRACTAL_BACKEND:back);
- try {
- factory = (GotmFactoryImpl) ff.newComponent("FcGotmFactoryImpl",
- context);
- } catch (ADLException e1) {
- e1.printStackTrace();
- }
}
/**
- * @return the default instance of the factory.
+ * @param desc
+ * @param context
+ * @param itf
+ * @return interface named itf of the created component.
*/
- public static GotmFactory getFactory() {
- return factory ;
+ public static Interface create(String desc, Map context, String itf) {
+ Component c = create(desc,context);
+ try {
+ return (Interface) c.getFcInterface(itf);
+ } catch (NoSuchInterfaceException e) {
+ System.err.println(e);
+ throw new GoTMException(e);
+ }
}
}
Index: gotm/src/java/org/objectweb/gotm/lib/CurrentHandler.java
diff -u gotm/src/java/org/objectweb/gotm/lib/CurrentHandler.java:1.4
gotm/src/java/org/objectweb/gotm/lib/CurrentHandler.java:1.5
--- gotm/src/java/org/objectweb/gotm/lib/CurrentHandler.java:1.4 Mon
Jul 11 10:27:05 2005
+++ gotm/src/java/org/objectweb/gotm/lib/CurrentHandler.java Mon Jul 18
09:30:11 2005
@@ -23,10 +23,12 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: CurrentHandler.java,v 1.4 2005/07/11 08:27:05 rouvoy Exp $
+ $Id: CurrentHandler.java,v 1.5 2005/07/18 07:30:11 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib;
+import java.util.Stack;
+
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.IllegalCacheException;
@@ -41,8 +43,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 1 févr. 2005
- * @modified $Date: 2005/07/11 08:27:05 $
- * @version $Revision: 1.4 $
+ * @modified $Date: 2005/07/18 07:30:11 $
+ * @version $Revision: 1.5 $
* @fractal.itf name="factory" role="client"
* signature="org.objectweb.fractal.api.Component"
*/
@@ -55,7 +57,7 @@
/** <code>current</code> . */
private Component current = null;
- private Component cleared = null;
+ private Stack stack = new Stack();
/*
* (non-Javadoc)
@@ -80,126 +82,135 @@
}
}
- private Component getCleared() {
- if (this.cleared == null) {
+ /**
+ * @param c
+ */
+ private void backToStack(Component c) {
+ try {
+ FcCache.getCacheController(c).clearFc();
+ } catch (IllegalCacheException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e);
+ } catch (NoSuchInterfaceException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e);
+ }
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG,"Storing the component instance into the
stack.");
+ this.stack.push(c);
+ }
+
+ /**
+ * @return a component coming from the stack.
+ */
+ private Component loadFromStack() {
+ Component loaded = null;
+ if (this.stack.isEmpty()) {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Creating a new instance of cached
component.");
try {
- this.cleared = getFactory().newFcInstance();
- Fractal.getLifeCycleController(this.cleared).startFc();
+ loaded = getFactory().newFcInstance();
+ Fractal.getLifeCycleController(loaded).startFc();
} catch (InstantiationException e) {
- e.printStackTrace();
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e);
} catch (IllegalLifeCycleException e) {
if (getLogger().isLoggable(ERROR))
- getLogger().log(ERROR, e.getMessage());
+ getLogger().log(ERROR, e);
} catch (NoSuchInterfaceException e) {
if (getLogger().isLoggable(ERROR))
- getLogger().log(ERROR, e.getMessage());
+ getLogger().log(ERROR, e);
+ }
+ } else {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Loading an existing instance of
cached component.");
+ loaded = (Component) this.stack.pop();
+ try {
+ FcCache.getCacheController(loaded).initFc();
+ } catch (IllegalCacheException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e);
+ } catch (NoSuchInterfaceException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e);
}
}
- return this.cleared;
+ return loaded;
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.objectweb.fractal.api.control.LifeCycleController#getFcState()
+ */
+ public String getFcState() { return null; }
/*
* (non-Javadoc)
*
- * @see org.objectweb.gotm.lib.CurrentManager#getCurrentFc()
+ * @see org.objectweb.fractal.api.control.LifeCycleController#startFc()
*/
- public Component getCurrentFc() {
- return this.current;
+ public void startFc() {
+ backToStack(loadFromStack());
}
/*
* (non-Javadoc)
*
- * @see org.objectweb.gotm.lib.CurrentManager#createCurrentFc()
+ * @see org.objectweb.fractal.api.control.LifeCycleController#stopFc()
*/
- public void createCurrentFc() {
- // try {
- // this.current = this.cleared ;
- // Fractal.getLifeCycleController(this.current).startFc();
- // } catch (IllegalLifeCycleException e) {
- // if (getLogger().isLoggable(ERROR))
- // getLogger().log(ERROR,e.getMessage());
- // } catch (NoSuchInterfaceException e) {
- // // Ignored
- // }
+ public void stopFc() {
try {
- this.current = this.cleared;
- FcCache.getCacheController(this.current).initFc();
- } catch (IllegalCacheException e) {
+ Fractal.getLifeCycleController(this.current).stopFc();
+ } catch (IllegalLifeCycleException e) {
if (getLogger().isLoggable(ERROR))
getLogger().log(ERROR, e.getMessage());
} catch (NoSuchInterfaceException e) {
if (getLogger().isLoggable(ERROR))
getLogger().log(ERROR, e.getMessage());
}
+ this.stack.clear();
}
- /*
- * (non-Javadoc)
- *
- * @see
org.objectweb.gotm.lib.CurrentManager#setCurrentFc(org.objectweb.fractal.api.Component)
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.CurrentManager#loadCurrent()
*/
- public void setCurrentFc(Component c) {
- this.current = c;
- this.cleared = c;
+ public void loadCurrent() {
+ this.current = loadFromStack();
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.objectweb.gotm.lib.CurrentManager#clearCurrentFc()
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.CurrentManager#checkCurrent()
*/
- public void clearCurrentFc() {
- // try {
- // Fractal.getLifeCycleController(this.current).stopFc();
- // } catch (IllegalLifeCycleException e) {
- // getLogger().log(ERROR,e.getMessage());
- // } catch (NoSuchInterfaceException e) {
- // // Ignored
- // }
- try {
- FcCache.getCacheController(this.current).clearFc();
- } catch (IllegalCacheException e) {
- if (getLogger().isLoggable(ERROR))
- getLogger().log(ERROR, e.getMessage());
- } catch (NoSuchInterfaceException e) {
- if (getLogger().isLoggable(ERROR))
- getLogger().log(ERROR, e.getMessage());
- }
- this.current = null;
+ public boolean checkCurrent() {
+ return this.current != null;
}
/*
* (non-Javadoc)
*
- * @see
org.objectweb.fractal.api.control.LifeCycleController#getFcState()
+ * @see org.objectweb.gotm.lib.CurrentManager#getCurrentFc()
*/
- public String getFcState() {
- return null;
+ public Component getCurrentFc() {
+ return this.current;
}
/*
* (non-Javadoc)
*
- * @see org.objectweb.fractal.api.control.LifeCycleController#startFc()
+ * @see
org.objectweb.gotm.lib.CurrentManager#setCurrentFc(org.objectweb.fractal.api.Component)
*/
- public void startFc() {
- getCleared();
+ public void setCurrentFc(Component c) {
+ this.current = c;
}
/*
* (non-Javadoc)
*
- * @see org.objectweb.fractal.api.control.LifeCycleController#stopFc()
+ * @see org.objectweb.gotm.lib.CurrentManager#clearCurrentFc()
*/
- public void stopFc() {
- try {
- Fractal.getLifeCycleController(this.current).stopFc();
- } catch (IllegalLifeCycleException e) {
- getLogger().log(ERROR, e.getMessage());
- } catch (NoSuchInterfaceException e) {
- // Ignored
- }
- this.cleared = null;
+ public void clearCurrentFc() {
+ backToStack(this.current);
+ this.current = null;
}
-}
+}
\ No newline at end of file
Index: gotm/src/java/org/objectweb/gotm/lib/CurrentManager.java
diff -u gotm/src/java/org/objectweb/gotm/lib/CurrentManager.java:1.1
gotm/src/java/org/objectweb/gotm/lib/CurrentManager.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/CurrentManager.java:1.1 Fri
Feb 4 18:44:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/CurrentManager.java Mon Jul 18
09:30:11 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: CurrentManager.java,v 1.1 2005/02/04 17:44:33 rouvoy Exp $
+ $Id: CurrentManager.java,v 1.2 2005/07/18 07:30:11 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib;
@@ -32,14 +32,25 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 1 févr. 2005
- * @modified $Date: 2005/02/04 17:44:33 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:11 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="current"
*/
public interface CurrentManager {
/**
+ * Loads a current object.
+ */
+ public void loadCurrent();
+
+ /**
+ * Checks if a current is allocated.
+ * @return true if a current is available.
+ */
+ public boolean checkCurrent();
+
+ /**
* Provides the instance of the current component handled.
- * @return the current component.
+ * @return the current component (null if no current).
*/
public Component getCurrentFc();
@@ -49,11 +60,6 @@
*/
public void setCurrentFc(Component current);
- /**
- * Initialize the current instance of component.
- */
- public void createCurrentFc();
-
/**
* Clear the instance of the current component.
*/
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.2
gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.3
--- gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.2
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java Mon
Jul 18 09:30:11 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: AbortFeature.java,v 1.2 2005/07/11 08:27:04 rouvoy Exp $
+$Id: AbortFeature.java,v 1.3 2005/07/18 07:30:11 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -37,7 +37,7 @@
/**
* Implementation of the cancel process.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
* @fractal.itf
*/
public class AbortFeature
@@ -48,11 +48,13 @@
*/
public void process(Map context) {
if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG,"Processing Abort.");
+ getLogger().log(DEBUG,"Processing Abort...");
getTxState().setStatus(TransactionStatusRollingBack.status);
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG,"Sending abort decision...");
getLog().log(TransactionStatusRollingBack.status.getLabel().getBytes());
getPublisher().notify(ResourceEventRollback.event,context);
-
getLog().log(TransactionStatusRolledBack.status.getLabel().getBytes());
+//
getLog().log(TransactionStatusRolledBack.status.getLabel().getBytes());
getTxState().setStatus(TransactionStatusRolledBack.status);
}
}
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.3
gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.4
--- gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.3
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java
Mon Jul 18 09:30:11 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: CommitFeature.java,v 1.3 2005/07/11 08:27:04 rouvoy Exp $
+ $Id: CommitFeature.java,v 1.4 2005/07/18 07:30:11 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -43,7 +43,7 @@
/**
* One phase validation process.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
* @fractal.itf name="abort" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class CommitFeature
@@ -76,14 +76,18 @@
*/
public void process(Map context) {
if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG,"Processing Commit.");
+ getLogger().log(DEBUG,"Processing Commit...");
try {
getTxState().setStatus(TransactionStatusCommitting.status);
getLog().log(TransactionStatusCommitting.status.getLabel().getBytes());
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG,"Sending commit decision...");
getPublisher().notify(ResourceEventCommit.event,context);
-
getLog().log(TransactionStatusCommitted.status.getLabel().getBytes());
+//
getLog().log(TransactionStatusCommitted.status.getLabel().getBytes());
getTxState().setStatus(TransactionStatusCommitted.status);
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG,"Commit Feature: "+e.getMessage());
abort().process(context);
}
}
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java:1.1
gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java:1.1
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java Mon
Jul 18 09:30:11 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TimeoutImpl.java,v 1.1 2005/07/11 08:27:04 rouvoy Exp $
+ $Id: TimeoutImpl.java,v 1.2 2005/07/18 07:30:11 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -43,10 +43,11 @@
import
org.objectweb.transaction.lib.transaction.TransactionStatusNoTransaction;
import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionInactive;
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="coord-process" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class TimeoutImpl
@@ -63,6 +64,8 @@
public TimeoutImpl() {
ActionListener taskPerformer = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Timeout has expired!");
TimeoutImpl.this.getTerminator().process(new HashMap());
}
};
@@ -86,6 +89,7 @@
protected Event[] getEvents() {
return new Event[] {
TransactionStatusTransactionActive.status,
+ TransactionStatusTransactionInactive.status,
TransactionStatusNoTransaction.status,
TransactionStatusRolledBack.status,
TransactionStatusCommitted.status
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.3
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.4
--- gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.3
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java Mon
Jul 18 09:30:11 2005
@@ -23,13 +23,13 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TwoPCFeature.java,v 1.3 2005/07/11 08:27:04 rouvoy Exp $
+ $Id: TwoPCFeature.java,v 1.4 2005/07/18 07:30:11 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
+import java.util.ArrayList;
import java.util.Collections;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -50,8 +50,8 @@
* Implementation of a Two-Phase Commit Protocol.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 5 janv. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.3 $
+ * @modified $Date: 2005/07/18 07:30:11 $
+ * @version $Revision: 1.4 $
* @fractal.itf name="commit" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class TwoPCFeature
@@ -85,28 +85,32 @@
*/
public void process(Map context) {
if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG,"Processing Atomic 2 Phases Validation");
+ getLogger().log(DEBUG,"Processing Atomic 2 Phases
Validation...");
try {
getTxState().setStatus(TransactionStatusPreparing.status);
- context.put(ResourceVoteRollback.vote,
Collections.synchronizedList(new LinkedList()));
- context.put(ResourceVoteCommit.vote,
Collections.synchronizedList(new LinkedList()));
- context.put(ResourceVoteReadOnly.vote,
Collections.synchronizedList(new LinkedList()));
+ context.put(ResourceVoteRollback.vote,
Collections.synchronizedList(new ArrayList()));
+ context.put(ResourceVoteCommit.vote,
Collections.synchronizedList(new ArrayList()));
+ context.put(ResourceVoteReadOnly.vote,
Collections.synchronizedList(new ArrayList()));
-
getLog().log(TransactionStatusPreparing.status.getLabel().getBytes());
+//
getLog().log(TransactionStatusPreparing.status.getLabel().getBytes());
getPublisher().notify(ResourceEventVote.event, context);
+ List enf_rollback = (List)
context.get(ResourceVoteRollback.vote);
+ boolean decision = (enf_rollback.size() == 0);
getTxState().setStatus(TransactionStatusPrepared.status);
getLog().log(TransactionStatusPrepared.status.getLabel().getBytes());
- List enf_rollback = (List)
context.get(ResourceVoteRollback.vote);
- //List enf_commit = (List) context.get(ResourceVoteCommit.vote);
- if (enf_rollback.size() == 0) {
- // if (enf_commit.length != 0)
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG,"Commit decision = "+decision);
+ if (decision) {
commit().process(context);
} else {
abort().process(context);
}
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG,"Prepare Feature: "+e.getMessage());
abort().process(context);
+ throw e;
}
}
}
Index: gotm/src/java/org/objectweb/gotm/lib/event/PublishASyncThread.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/event/PublishASyncThread.java:1.1
gotm/src/java/org/objectweb/gotm/lib/event/PublishASyncThread.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/event/PublishASyncThread.java:1.1
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/event/PublishASyncThread.java Mon
Jul 18 09:30:11 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: PublishASyncThread.java,v 1.1 2005/07/11 08:27:04 rouvoy Exp $
+$Id: PublishASyncThread.java,v 1.2 2005/07/18 07:30:11 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.event;
@@ -37,8 +37,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 11 juil. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:11 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="subscriber-provider" role="client"
signature="org.objectweb.gotm.lib.event.SubscriberProvider"
*/
public class PublishASyncThread
@@ -66,15 +66,15 @@
if (getLogger().isLoggable(DEBUG))
getLogger().log(DEBUG,"Notification of the "+topic+" topic.");
for (Iterator i = getProvider().getTopic(topic).iterator();
i.hasNext();) {
- new NotifyAction((PublishFeature)i.next(),topic,context).start();
+ (new
NotifyAction((PublishFeature)i.next(),topic,context)).start();
}
}
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 11 juil. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:11 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
protected final class NotifyAction extends Thread {
Index: gotm/src/java/org/objectweb/gotm/lib/logging/GenericLogger.java
diff -u gotm/src/java/org/objectweb/gotm/lib/logging/GenericLogger.java:1.1
gotm/src/java/org/objectweb/gotm/lib/logging/GenericLogger.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/logging/GenericLogger.java:1.1 Mon
Jul 11 10:27:05 2005
+++ gotm/src/java/org/objectweb/gotm/lib/logging/GenericLogger.java Mon
Jul 18 09:30:10 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: GenericLogger.java,v 1.1 2005/07/11 08:27:05 rouvoy Exp $
+$Id: GenericLogger.java,v 1.2 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.logging;
@@ -38,8 +38,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 7 juil. 2005
- * @modified $Date: 2005/07/11 08:27:05 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="logger-provider" role="client"
signature="org.objectweb.gotm.lib.logging.LoggerProvider"
* @fractal.itf name="xid-provider" role="client"
signature="org.objectweb.gotm.lib.xid.XidFeature"
*/
@@ -81,7 +81,6 @@
*/
public void setForce(boolean value) {
this.force = value;
- System.out.println("--> force="+value);
}
/* (non-Javadoc)
Index: gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.1
gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.1
Mon Jul 11 10:27:05 2005
+++ gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java Mon
Jul 18 09:30:10 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: HOWLoggerProvider.java,v 1.1 2005/07/11 08:27:05 rouvoy Exp $
+$Id: HOWLoggerProvider.java,v 1.2 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.logging;
@@ -41,8 +41,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 7 juil. 2005
- * @modified $Date: 2005/07/11 08:27:05 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
public class HOWLoggerProvider
@@ -104,7 +104,7 @@
cfg.setLogFileDir(this.dirpath);
try {
this.logger = new Logger(cfg);
- this.open() ;
+// this.open() ;
} catch (Exception e) {
throw new IllegalLifeCycleException(e.getMessage());
}
@@ -140,5 +140,16 @@
*/
public Logger getLogging() {
return this.logger;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#finalize()
+ */
+ protected void finalize() throws Throwable {
+ try {
+ this.close() ;
+ } catch (Exception e) {
+ throw new IllegalLifeCycleException(e.getMessage());
+ }
}
}
Index: gotm/src/java/org/objectweb/gotm/lib/logging/SimpleLogger.java
diff -u gotm/src/java/org/objectweb/gotm/lib/logging/SimpleLogger.java:1.1
gotm/src/java/org/objectweb/gotm/lib/logging/SimpleLogger.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/logging/SimpleLogger.java:1.1 Mon
Jul 11 10:27:05 2005
+++ gotm/src/java/org/objectweb/gotm/lib/logging/SimpleLogger.java Mon
Jul 18 09:30:10 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: SimpleLogger.java,v 1.1 2005/07/11 08:27:05 rouvoy Exp $
+$Id: SimpleLogger.java,v 1.2 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.logging;
@@ -33,8 +33,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 7 juil. 2005
- * @modified $Date: 2005/07/11 08:27:05 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
public class SimpleLogger
@@ -53,7 +53,7 @@
* @see org.objectweb.transaction.api.logging.LoggerFeature#log(byte[])
*/
public void log(byte[] data) {
- if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG,"Logging data = "+new String(data));
- }
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG,"Logging data = "+new String(data));
+ }
}
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractActionProvider.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractActionProvider.java:1.2
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractActionProvider.java:removed
---
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractActionProvider.java:1.2
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/AbstractActionProvider.java
Mon Jul 18 09:30:11 2005
@@ -1,79 +0,0 @@
-/*====================================================================
-
-GoTM: GoTM is an open Transaction Monitor
-Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
-Contact: gotm-team@xxxxxxxxxxxxx
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA
-
-Initial developer(s): Romain Rouvoy.
-Contributor(s): .
-
----------------------------------------------------------------------
-$Id: AbstractActionProvider.java,v 1.2 2005/07/11 08:27:04 rouvoy Exp $
-====================================================================*/
-package org.objectweb.gotm.lib.resource;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.objectweb.fractal.lib.BindablePrimitive;
-import org.objectweb.transaction.api.event.Event;
-
-/**
- * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 4 juil. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.2 $
- * @fractal.itf
- */
-public abstract class AbstractActionProvider
- extends BindablePrimitive
- implements ActionProvider {
- /** list of available actions. */
- private final Map actions;
-
- /**
- * Default constructor.
- */
- protected AbstractActionProvider() {
- this.actions = declareActions();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.objectweb.gotm.lib.resource.ActionProvider#getEvents()
- */
- public Event[] getEvents() {
- Set events = this.actions.keySet();
- return (Event[]) events.toArray(new Event[events.size()]);
- }
-
- /**
- * Defines the list of available actions for the associated resource.
- *
- * @return the list of labelled actions.
- */
- protected abstract Map declareActions();
-
- /* (non-Javadoc)
- * @see org.objectweb.gotm.lib.resource.ActionProvider#getAction(int)
- */
- public Action getAction(Event name) {
- return (Action) this.actions.get(name);
- }
-}
\ No newline at end of file
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractResourceManager.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractResourceManager.java:1.3
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractResourceManager.java:removed
---
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractResourceManager.java:1.3
Mon Jul 11 10:27:04 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/AbstractResourceManager.java
Mon Jul 18 09:30:11 2005
@@ -1,119 +0,0 @@
-/*====================================================================
-
-GoTM: GoTM is an open Transaction Monitor
-Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
-Contact: gotm-team@xxxxxxxxxxxxx
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA
-
-Initial developer(s): Romain Rouvoy.
-Contributor(s): .
-
----------------------------------------------------------------------
-$Id: AbstractResourceManager.java,v 1.3 2005/07/11 08:27:04 rouvoy Exp $
-====================================================================*/
-package org.objectweb.gotm.lib.resource;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.objectweb.gotm.lib.event.SubscribablePrimitive;
-import org.objectweb.gotm.lib.transaction.InvalidStateException;
-import org.objectweb.transaction.api.event.Event;
-import org.objectweb.transaction.api.event.PublishFeature;
-import org.objectweb.transaction.api.event.SubscribeFeature;
-import org.objectweb.transaction.api.transaction.TransactionState;
-import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
-
-/**
- * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 4 juil. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.3 $
- * @fractal.itf name="action-provider" role="client"
signature="org.objectweb.gotm.lib.resource.ActionProvider"
- * @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
- */
-public abstract class AbstractResourceManager
-extends SubscribablePrimitive
-implements ResourceManager,PublishFeature {
-
- /** list of registered observers for this kind of wrapper. */
-// protected final Collection observers =
Collections.synchronizedCollection(new ArrayList());
- protected final Collection observers = new ArrayList();
-
- /* (non-Javadoc)
- * @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
- */
- protected String[] clientFc() {
- return new String[] {
- SubscribeFeature.SUBSCRIBE_FEATURE,
- ActionProvider.ACTION_PROVIDER,
- TransactionState.TRANSACTION_STATE
- };
- }
-
- protected ActionProvider actionProvider() {
- return (ActionProvider)
fcBindings.get(ActionProvider.ACTION_PROVIDER);
- }
-
- protected TransactionState txState() {
- return (TransactionState)
fcBindings.get(TransactionState.TRANSACTION_STATE);
- }
-
- /* (non-Javadoc)
- * @see org.objectweb.gotm.lib.event.SubscribablePrimitive#getEvents()
- */
- protected Event[] getEvents() {
- return actionProvider().getEvents();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.objectweb.fractal.api.control.CacheController#clearFc()
- */
- public void clearFc() {
- this.observers.clear();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
org.objectweb.gotm.lib.event.Resource#addResource(java.lang.Object)
- */
- public void addResource(final Object wrapped) {
- if (txState().getStatus()==TransactionStatusTransactionActive.status)
- synchronized (this.observers) {
- this.observers.add(wrapped);
- }
- else
- throw new InvalidStateException(txState().getStatus());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
org.objectweb.gotm.lib.resource.ResourceManager#delResource(java.lang.Object)
- */
- public void delResource(final Object wrapped) {
- if (txState().getStatus()==TransactionStatusTransactionActive.status)
- synchronized (this.observers) {
- this.observers.remove(wrapped);
- }
- else
- throw new InvalidStateException(txState().getStatus());
- }
-}
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java
diff -u gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java:1.2
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java:1.3
--- gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java:1.2
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java Mon
Jul 18 09:30:10 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ActionProvider.java,v 1.2 2005/07/11 08:27:04 rouvoy Exp $
+$Id: ActionProvider.java,v 1.3 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
@@ -33,8 +33,8 @@
* Interface providing all the actions handled by a kind of resource.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 4 juil. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.2 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.3 $
* @fractal.itf name="action-provider"
*/
public interface ActionProvider {
@@ -47,7 +47,6 @@
* @return the action associated to the transaction status.
*/
Action getAction(Event name);
-
/**
* Provides the list of transaction status handled.
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java:1.1
--- /dev/null Mon Jul 18 09:30:11 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
Mon Jul 18 09:30:10 2005
@@ -0,0 +1,82 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: ActionProviderAbstract.java,v 1.1 2005/07/18 07:30:10 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.resource;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.objectweb.fractal.lib.BindablePrimitive;
+import org.objectweb.transaction.api.event.Event;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 4 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf
+ */
+public abstract class ActionProviderAbstract
+ extends BindablePrimitive
+ implements ActionProvider {
+
+ /** list of available actions. */
+ private final Map actions;
+
+ /**
+ * Default constructor.
+ */
+ protected ActionProviderAbstract() {
+ actions = declareActions();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.objectweb.gotm.lib.resource.ActionProvider#getEvents()
+ */
+ public Event[] getEvents() {
+ Set events = this.actions.keySet();
+ return (Event[]) events.toArray(new Event[events.size()]);
+ }
+
+ /**
+ * Defines the list of available actions for the associated resource.
+ *
+ * @return the list of labelled actions.
+ */
+ protected abstract Map declareActions();
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.resource.ActionProvider#getAction(int)
+ */
+ public Action getAction(Event name) {
+ Action a = (Action) this.actions.get(name);
+ if (a == null ) throw new NoActionAvailableException(name);
+ return a;
+ }
+}
\ No newline at end of file
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java:1.1
--- /dev/null Mon Jul 18 09:30:11 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java
Mon Jul 18 09:30:10 2005
@@ -0,0 +1,57 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: ResourceDelistEvent.java,v 1.1 2005/07/18 07:30:10 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.resource;
+
+import org.objectweb.transaction.api.event.Event;
+import org.objectweb.transaction.lib.event.EventAbstract;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 13 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.1 $
+ */
+public class ResourceDelistEvent
+ extends EventAbstract {
+ /** Object value for the event <i>Resource Delistment</i>. */
+ public final static Event event = new ResourceDelistEvent();
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return "Resource delistment" ;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.transaction.lib.event.EventAbstract#getEvent()
+ */
+ public Event getEvent() {
+ return event;
+ }
+}
\ No newline at end of file
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java:1.1
--- /dev/null Mon Jul 18 09:30:11 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java
Mon Jul 18 09:30:10 2005
@@ -0,0 +1,57 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: ResourceEnlistEvent.java,v 1.1 2005/07/18 07:30:10 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.resource;
+
+import org.objectweb.transaction.api.event.Event;
+import org.objectweb.transaction.lib.event.EventAbstract;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 13 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.1 $
+ */
+public class ResourceEnlistEvent
+ extends EventAbstract {
+ /** Object value for the event <i>Resource Enlistment</i>. */
+ public final static Event event = new ResourceEnlistEvent();
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return "Resource enlistment" ;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.transaction.lib.event.EventAbstract#getEvent()
+ */
+ public Event getEvent() {
+ return event;
+ }
+}
\ No newline at end of file
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java:1.1
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java
Mon Jul 18 09:30:10 2005
@@ -1,63 +1,60 @@
/*====================================================================
-GoTM: GoTM is an open Transaction Monitor
-Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
-Contact: gotm-team@xxxxxxxxxxxxx
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA
-
-Initial developer(s): Romain Rouvoy.
-Contributor(s): .
-
----------------------------------------------------------------------
-$Id: ResourceManagerASync.java,v 1.1 2005/07/11 08:27:04 rouvoy Exp $
-====================================================================*/
+ GoTM: GoTM is an open Transaction Monitor
+ Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
+ Contact: gotm-team@xxxxxxxxxxxxx
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
+
+ Initial developer(s): Romain Rouvoy.
+ Contributor(s): .
+
+ ---------------------------------------------------------------------
+ $Id: ResourceManagerASync.java,v 1.2 2005/07/18 07:30:10 rouvoy Exp $
+ ====================================================================*/
package org.objectweb.gotm.lib.resource;
-import java.util.Iterator;
import java.util.Map;
-import org.objectweb.transaction.api.event.Event;
-
/**
-* Implementation of a wrapper.
-*
-* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
-* @created 22 déc. 2004
-* @modified $Date: 2005/07/11 08:27:04 $
-* @version $Revision: 1.1 $
-* @fractal.itf
-*/
-public abstract class ResourceManagerASync
- extends AbstractResourceManager {
- /*
- * (non-Javadoc)
- * @see
org.objectweb.transaction.api.event.PublishFeature#notify(int,java.util.Map)
- */
- public void notify(Event topic, Map context) {
- Action action = actionProvider().getAction(topic);
- for (Iterator i = this.observers.iterator(); i.hasNext();) {
- try {
- Thread t = new RunnableAction(action, context, i.next());
- t.start();
- } catch (Exception ex) {
- if (getLogger().isLoggable(ERROR))
- getLogger().log(ERROR, "ResourceManagerWithThread.notify:
", ex);
- }
- }
- }
+ * Implementation of a wrapper.
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 22 déc. 2004
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.2 $
+ * @fractal.itf
+ */
+public class ResourceManagerASync
+ extends ResourceManagerAbstract {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.objectweb.gotm.lib.resource.ResourceManagerAbstract#execute(org.objectweb.gotm.lib.resource.Action,
+ * java.lang.Object, java.util.Map)
+ */
+ protected void execute(Action action, Object resource, Map context1) {
+ try {
+ Thread t = new RunnableAction(action, context1, resource);
+ t.start();
+ } catch (Exception ex) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger()
+ .log(ERROR, "ResourceManagerWithThread.notify: ",
ex);
+ }
+ }
}
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java:1.1
--- /dev/null Mon Jul 18 09:30:11 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
Mon Jul 18 09:30:10 2005
@@ -0,0 +1,186 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: ResourceManagerAbstract.java,v 1.1 2005/07/18 07:30:10 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.resource;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.objectweb.gotm.lib.event.SubscribablePrimitive;
+import org.objectweb.gotm.lib.transaction.InvalidStateException;
+import org.objectweb.transaction.api.event.Event;
+import org.objectweb.transaction.api.event.PublishFeature;
+import org.objectweb.transaction.api.event.SubscribeFeature;
+import org.objectweb.transaction.api.transaction.TransactionState;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 4 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf name="action-provider" role="client"
signature="org.objectweb.gotm.lib.resource.ActionProvider"
+ * @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
+ */
+public abstract class ResourceManagerAbstract
+extends SubscribablePrimitive
+implements ResourceManager,PublishFeature {
+
+ /** <code>RESOURCE_ADDED</code> . */
+ public static final String RESOURCE_ADDED = "resource-added";
+ /** <code>RESOURCE_REMOVED</code> . */
+ public static final String RESOURCE_REMOVED = "resource-removed";
+
+ /** list of registered added for this kind of wrapper. */
+// protected final Collection added =
Collections.synchronizedCollection(new ArrayList());
+ protected final Collection added = new ArrayList();
+ protected final Collection removed = new ArrayList();
+ protected final Map context = new HashMap();
+ protected Action enlist ;
+ protected Action delist ;
+
+
+ /**
+ * Default constructor.
+ */
+ public ResourceManagerAbstract() {
+ this.context.put(RESOURCE_ADDED,this.added);
+ this.context.put(RESOURCE_REMOVED, this.removed);
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
+ */
+ protected String[] clientFc() {
+ return new String[] {
+ SubscribeFeature.SUBSCRIBE_FEATURE,
+ ActionProvider.ACTION_PROVIDER,
+ TransactionState.TRANSACTION_STATE
+ };
+ }
+
+ protected ActionProvider actionProvider() {
+ return (ActionProvider)
fcBindings.get(ActionProvider.ACTION_PROVIDER);
+ }
+
+ protected TransactionState txState() {
+ return (TransactionState)
fcBindings.get(TransactionState.TRANSACTION_STATE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.event.SubscribablePrimitive#getEvents()
+ */
+ protected Event[] getEvents() {
+ return actionProvider().getEvents();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.objectweb.fractal.api.control.CacheController#initFc()
+ */
+ public void initFc() {
+ try {
+ this.enlist =
actionProvider().getAction(ResourceEnlistEvent.event);
+ } catch (NoActionAvailableException e) {
+ // ignored
+ }
+ try {
+ this.delist =
actionProvider().getAction(ResourceDelistEvent.event);
+ } catch (NoActionAvailableException e) {
+ // ignored
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.objectweb.fractal.api.control.CacheController#clearFc()
+ */
+ public void clearFc() {
+ this.added.clear();
+ this.removed.clear();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.objectweb.gotm.lib.event.Resource#addResource(java.lang.Object)
+ */
+ public void addResource(final Object wrapped) {
+ if
(txState().getStatus()==TransactionStatusTransactionActive.status) {
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG, "Enlisting a resource.");
+ synchronized (this.added) {
+ this.added.add(wrapped);
+ }
+ if (enlist != null) execute(enlist, wrapped, this.context);
+ } else
+ throw new InvalidStateException(txState().getStatus());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.objectweb.gotm.lib.resource.ResourceManager#delResource(java.lang.Object)
+ */
+ public void delResource(final Object wrapped) {
+ if
(txState().getStatus()==TransactionStatusTransactionActive.status) {
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG, "Delisting a resource.");
+ synchronized (this.added) {
+ this.added.remove(wrapped);
+ }
+ synchronized (this.removed) {
+ this.removed.add(wrapped);
+ }
+ if (delist != null) execute(delist, wrapped, this.context);
+ } else
+ throw new InvalidStateException(txState().getStatus());
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.transaction.api.event.PublishFeature#notify(int,
java.util.Map)
+ */
+ public void notify(Event topic, Map context1) {
+ Action action = actionProvider().getAction(topic);
+ for (Iterator i = this.added.iterator() ; i.hasNext() ;)
+ execute(action, i.next(), context1);
+ for (Iterator i = this.removed.iterator() ; i.hasNext() ;)
+ execute(action, i.next(), context1);
+ }
+
+ /**
+ * @param action
+ * @param resource
+ * @param context1
+ */
+ protected abstract void execute(Action action, Object resource, Map
context1) ;
+}
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java:1.2
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java:1.3
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java:1.2
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java
Mon Jul 18 09:30:10 2005
@@ -23,52 +23,34 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: ResourceManagerImpl.java,v 1.2 2005/07/11 08:27:04 rouvoy Exp $
+ $Id: ResourceManagerImpl.java,v 1.3 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
-import java.util.Iterator;
import java.util.Map;
import org.objectweb.gotm.GoTMException;
-import org.objectweb.transaction.api.event.Event;
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 1 févr. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.2 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.3 $
* @fractal.itf
*/
public class ResourceManagerImpl
- extends AbstractResourceManager{
-
- /*
- * (non-Javadoc)
- *
- * @see
org.objectweb.gotm.lib.topic.PublishFeature#notify(java.lang.String,
- * java.util.Map)
+ extends ResourceManagerAbstract{
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.gotm.lib.resource.ResourceManagerAbstract#execute(org.objectweb.gotm.lib.resource.Action,
java.lang.Object, java.util.Map)
*/
- public void notify(final Event topic, final Map context) {
- Action action = actionProvider().getAction(topic);
- if (getLogger().isLoggable(ERROR))
- getLogger().log(DEBUG, "Propagating " + topic);
- // Object[] listeners = this.observers.toArray();
- // for (int i=0 ; i < listeners.length ; i++) {
- // try {
- // action.execute(context,listeners[i]);
- for (Iterator i = this.observers.iterator(); i.hasNext();) {
- try {
- action.execute(context, i.next());
- } catch (NullPointerException ex) {
- if (getLogger().isLoggable(ERROR))
- getLogger().log(ERROR, "ResourceManager.notify: ", ex);
- throw new NoActionAvailableException(topic);
- } catch (Exception ex) {
- if (getLogger().isLoggable(ERROR))
- getLogger().log(ERROR, "ResourceManager.notify: ", ex);
- throw new GoTMException(ex);
- }
+ protected void execute(Action action, Object resource, Map context1) {
+ try {
+ action.execute(context1, resource);
+ } catch (Exception ex) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, "ResourceManager.notify: ", ex);
+ throw new GoTMException(ex);
}
}
}
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java:1.1
Mon Jul 11 10:27:04 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java
Mon Jul 18 09:30:10 2005
@@ -23,15 +23,13 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ResourceManagerWithPool.java,v 1.1 2005/07/11 08:27:04 rouvoy Exp $
+$Id: ResourceManagerWithPool.java,v 1.2 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
-import java.util.Iterator;
import java.util.Map;
-import org.objectweb.transaction.api.event.Event;
import org.objectweb.transaction.api.event.SubscribeFeature;
import org.objectweb.util.thread.api.RunnableManager;
@@ -39,12 +37,12 @@
* Implementation of a wrapper.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 22 déc. 2004
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="runnable-manager" role="client"
signature="org.objectweb.util.thread.api.RunnableManager"
*/
-public abstract class ResourceManagerWithPool
- extends AbstractResourceManager
+public class ResourceManagerWithPool
+ extends ResourceManagerAbstract
{
/* (non-Javadoc)
* @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
@@ -64,18 +62,12 @@
return (RunnableManager)
fcBindings.get(RunnableManager.RUNNABLE_MANAGER);
}
- /* (non-Javadoc)
- * @see org.objectweb.transaction.api.event.PublishFeature#notify(int,
java.util.Map)
- */
- public void notify(Event topic, Map context) {
- Action action = actionProvider().getAction(topic);
- for (Iterator i = this.observers.iterator() ; i.hasNext() ;) {
- try {
- getRunnableManager().submitRunnable(new
RunnableAction(action, context, i.next()));
- } catch (Exception ex) {
- if (getLogger().isLoggable(ERROR))
- getLogger().log(ERROR,"ResourceManagerWithPool.notify:
",ex);
- }
+ protected void execute(Action action, Object resource, Map context1) {
+ try {
+ getRunnableManager().submitRunnable(new RunnableAction(action,
context1, resource));
+ } catch (Exception ex) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR,"ResourceManagerWithPool.notify: ",ex);
}
}
}
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java:1.1
Mon Jul 11 10:27:04 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java
Mon Jul 18 09:30:10 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: ResourceManagerWithThread.java,v 1.1 2005/07/11 08:27:04 rouvoy Exp $
+ $Id: ResourceManagerWithThread.java,v 1.2 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
@@ -40,23 +40,23 @@
*
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 22 déc. 2004
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
-public abstract class ResourceManagerWithThread
- extends AbstractResourceManager {
+public class ResourceManagerWithThread
+ extends ResourceManagerAbstract {
/*
* (non-Javadoc)
* @see
org.objectweb.transaction.api.event.PublishFeature#notify(int,java.util.Map)
*/
- public void notify(Event topic, Map context) {
+ public void notify(Event topic, Map context1) {
Action action = actionProvider().getAction(topic);
Collection threads = new ArrayList();
- for (Iterator i = this.observers.iterator(); i.hasNext();) {
+ for (Iterator i = this.added.iterator(); i.hasNext();) {
try {
- Thread t = new RunnableAction(action, context, i.next());
+ Thread t = new RunnableAction(action, context1, i.next());
t.start();
threads.add(t);
} catch (Exception ex) {
@@ -72,6 +72,16 @@
if (getLogger().isLoggable(ERROR))
getLogger().log(ERROR,
"ResourceManagerWithThread.notify: ", e);
}
+ }
+ }
+
+ protected void execute(Action action, Object resource, Map context1) {
+ try {
+ Thread t = new RunnableAction(action, context1, resource);
+ t.start();
+ } catch (Exception ex) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, "ResourceManagerWithThread.notify: ",
ex);
}
}
}
Index:
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateAuto.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateAuto.java:1.2
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateAuto.java:1.3
---
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateAuto.java:1.2
Mon Jul 11 10:27:05 2005
+++
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateAuto.java
Mon Jul 18 09:30:10 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: TransactionStateAuto.java,v 1.2 2005/07/11 08:27:05 rouvoy Exp $
+$Id: TransactionStateAuto.java,v 1.3 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.transaction;
@@ -42,12 +42,13 @@
import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
import
org.objectweb.transaction.lib.transaction.TransactionStatusRollingBack;
import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionInactive;
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 29 juin 2005
- * @modified $Date: 2005/07/11 08:27:05 $
- * @version $Revision: 1.2 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.3 $
* @fractal.itf
*/
public class TransactionStateAuto
@@ -83,11 +84,16 @@
});
addTransitions(TransactionStatusTransactionActive.status,
new TransactionStatus[] {
- TransactionStatusNoTransaction.status,
+ TransactionStatusTransactionInactive.status,
TransactionStatusMarkedRollback.status,
TransactionStatusRollingBack.status,
TransactionStatusPreparing.status
});
+ addTransitions(TransactionStatusTransactionInactive.status,
+ new TransactionStatus[] {
+ TransactionStatusTransactionActive.status,
+ TransactionStatusMarkedRollback.status
+ });
addTransitions(TransactionStatusPreparing.status,
new TransactionStatus[] {
TransactionStatusMarkedRollback.status,
@@ -95,6 +101,7 @@
});
addTransitions(TransactionStatusMarkedRollback.status,
new TransactionStatus[] {
+ TransactionStatusTransactionInactive.status,
TransactionStatusMarkedRollback.status,
TransactionStatusRollingBack.status
});
@@ -118,6 +125,9 @@
*/
public void setStatus(TransactionStatus status) {
Collection c = (Collection) this.transitions.get(getStatus());
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG, getStatus()+" --> "+status+" ?
("+c+")");
+ if (c== null) throw new InvalidTransitionException(getStatus(),
status);
if (!c.contains(status)) throw new
InvalidTransitionException(getStatus(), status);
super.setStatus(status);
}
Index:
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateImpl.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateImpl.java:1.11
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateImpl.java:1.12
---
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateImpl.java:1.11
Mon Jul 11 10:27:05 2005
+++
gotm/src/java/org/objectweb/gotm/lib/transaction/TransactionStateImpl.java
Mon Jul 18 09:30:10 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TransactionStateImpl.java,v 1.11 2005/07/11 08:27:05 rouvoy Exp $
+ $Id: TransactionStateImpl.java,v 1.12 2005/07/18 07:30:10 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.transaction;
@@ -43,8 +43,8 @@
*
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 5 janv. 2005
- * @modified $Date: 2005/07/11 08:27:05 $
- * @version $Revision: 1.11 $
+ * @modified $Date: 2005/07/18 07:30:10 $
+ * @version $Revision: 1.12 $
* @fractal.itf
*/
public class TransactionStateImpl
@@ -52,7 +52,6 @@
implements TransactionState, TransactionStatusFeature,
CacheController {
// The status of a transaction
protected TransactionStatus status_ = TransactionStatusUnknown.status;
- protected Map old = new HashMap(1);
/* (non-Javadoc)
* @see org.objectweb.fractal.api.control.CacheController#getLoadState()
@@ -79,9 +78,10 @@
* @see
org.objectweb.gotm.api.transaction.TransactionState#setStatus(org.objectweb.gotm.api.transaction.Status)
*/
public void setStatus(TransactionStatus status) {
- this.old.put("previous-status",this.status_);
+ Map context = new HashMap();
+ getPublisher().notify(this.status_.getLeavingEvent(), context);
this.status_ = status;
- getPublisher().notify(status, this.old);
+ getPublisher().notify(status, context);
}
/* (non-Javadoc)
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.