Produced by Araxis Merge on 12/13/2018 10:35:31 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\fw\service\transaction | ConfigurableTransactionProxyFactoryBean.java | Fri Dec 7 17:36:38 2018 UTC |
| 2 | v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\fw\service\transaction | ConfigurableTransactionProxyFactoryBean.java | Wed Dec 12 22:26:42 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 218 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /********* ********** ********** ********** ********** ********** ********* | |
| 2 | * Copyrii ght 2006 V HA. All ri ghts reser ved | |
| 3 | ********* ********** ********** ********** ********** ********** *********/ | |
| 4 | package go v.va.med.f w.service. transactio n; | |
| 5 | ||
| 6 | // Java cl asses | |
| 7 | import jav a.util.Has hSet; | |
| 8 | import jav a.util.Ite rator; | |
| 9 | import jav a.util.Pro perties; | |
| 10 | import jav a.util.Set ; | |
| 11 | ||
| 12 | import org .apache.co mmons.logg ing.Log; | |
| 13 | import org .apache.co mmons.logg ing.LogFac tory; | |
| 14 | import org .springfra mework.cor e.Constant s; | |
| 15 | import org .springfra mework.tra nsaction.T ransaction Definition ; | |
| 16 | import org .springfra mework.tra nsaction.i nterceptor .Transacti onProxyFac toryBean; | |
| 17 | import org .springfra mework.tra nsaction.s upport.Def aultTransa ctionDefin ition; | |
| 18 | ||
| 19 | /** | |
| 20 | * Allows for insert ion of glo bal transa ction attr ibutes | |
| 21 | * | |
| 22 | * Created Mar 10, 2 006 10:32: 21 PM | |
| 23 | * | |
| 24 | * DNS | |
| 25 | */ | |
| 26 | public cla ss Configu rableTrans actionProx yFactoryBe an extends Transacti onProxyFac toryBean { | |
| 27 | ||
| 28 | /* * | |
| 29 | * An instan ce of seri alVersionU ID | |
| 30 | * / | |
| 31 | pr ivate stat ic final l ong serial VersionUID = -194595 6638456105 718L; | |
| 32 | ||
| 33 | pr ivate stat ic final C onstants T X_CONSTANT S = new Co nstants(Tr ansactionD efinition. class); | |
| 34 | ||
| 35 | pr ivate stat ic final S tring TX_R EQUIRED_CO NSTANT = T X_CONSTANT S.toCode(n ew Integer ( | |
| 36 | Transa ctionDefin ition.PROP AGATION_RE QUIRED), | |
| 37 | Defaul tTransacti onDefiniti on.PREFIX_ PROPAGATIO N); | |
| 38 | ||
| 39 | pr ivate stat ic final S tring TX_R EQUIRES_NE W_CONSTANT = TX_CONS TANTS.toCo de(new Int eger( | |
| 40 | Transa ctionDefin ition.PROP AGATION_RE QUIRES_NEW ), | |
| 41 | Defaul tTransacti onDefiniti on.PREFIX_ PROPAGATIO N); | |
| 42 | ||
| 43 | pr ivate int transactio nTimeout = Transacti onDefiniti on.TIMEOUT _DEFAULT; | |
| 44 | ||
| 45 | pr ivate Set methodName sThatIniti ateTransac tions = ne w HashSet( ); | |
| 46 | ||
| 47 | pr otected fi nal Log lo gger = Log Factory.ge tLog(getCl ass()); | |
| 48 | ||
| 49 | pu blic void setTransac tionAttrib utes(Prope rties tran sactionAtt ributes) { | |
| 50 | preP rocessTran sactionMet adata(tran sactionAtt ributes); | |
| 51 | supe r.setTrans actionAttr ibutes(tra nsactionAt tributes); | |
| 52 | } | |
| 53 | ||
| 54 | pr otected Pr operties p reProcessT ransaction Metadata(P roperties props) { | |
| 55 | Set methods = props.keyS et(); | |
| 56 | Stri ng methodN ame = null ; | |
| 57 | Stri ng metadat a = null; | |
| 58 | for (Iterator itr = meth ods.iterat or(); itr. hasNext(); ) { | |
| 59 | method Name = (St ring) itr. next(); | |
| 60 | metada ta = (Stri ng) props. get(method Name); | |
| 61 | if (sh ouldUpdate MetadataFo rTimeout(m ethodName, metadata) ) { | |
| 62 | if (logg er.isDebug Enabled()) | |
| 63 | logger.deb ug("### Be an method [" + metho dName | |
| 64 | + "] - applyin g tx timeo ut default of " + tr ansactionT imeout); | |
| 65 | ||
| 66 | metadata = metadat a + "," + DefaultTra nsactionDe finition.P REFIX_TIME OUT | |
| 67 | + transactio nTimeout; | |
| 68 | props.pu t(methodNa me, metada ta); | |
| 69 | } | |
| 70 | } | |
| 71 | retu rn props; | |
| 72 | } | |
| 73 | ||
| 74 | pr otected bo olean shou ldUpdateMe tadataForT imeout(Str ing method Name, Stri ng metadat a) { | |
| 75 | // o nly update if does n ot have a timeout al ready and will start a TX | |
| 76 | bool ean should Update = f alse; | |
| 77 | if ( metadata ! = null) { | |
| 78 | if (me tadata.ind exOf(TX_RE QUIRED_CON STANT) >= 0 | |
| 79 | || metadat a.indexOf( TX_REQUIRE S_NEW_CONS TANT) >= 0 ) { | |
| 80 | methodNa mesThatIni tiateTrans actions.ad d(methodNa me); | |
| 81 | // ok, i t starts a TX, now s ee if ther e is alrea dy a timeo ut | |
| 82 | if (meta data.index Of(Default Transactio nDefinitio n.PREFIX_T IMEOUT) == -1) | |
| 83 | shouldUpda te = true; | |
| 84 | } | |
| 85 | } | |
| 86 | retu rn transac tionTimeou t != Trans actionDefi nition.TIM EOUT_DEFAU LT ? shoul dUpdate : false; | |
| 87 | } | |
| 88 | ||
| 89 | /* * | |
| 90 | * @return R eturns the transacti onTimeout. | |
| 91 | * / | |
| 92 | pu blic int g etTransact ionTimeout () { | |
| 93 | retu rn transac tionTimeou t; | |
| 94 | } | |
| 95 | ||
| 96 | /* * | |
| 97 | * @param tr ansactionT imeout | |
| 98 | * The tran sactionTim eout to se t. | |
| 99 | * / | |
| 100 | pu blic void setTransac tionTimeou t(int tran sactionTim eout) { | |
| 101 | this .transacti onTimeout = transact ionTimeout ; | |
| 102 | } | |
| 103 | ||
| 104 | /* * | |
| 105 | * @return R eturns the methodNam esThatInit iateTransa ctions. | |
| 106 | * / | |
| 107 | pr otected Se t getMetho dNamesThat InitiateTr ansactions () { | |
| 108 | retu rn methodN amesThatIn itiateTran sactions; | |
| 109 | } | |
| 110 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.