Produced by Araxis Merge on 6/5/2018 10:24:14 AM Central Daylight 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 | patch_205_build_9.zip\Java\TransactionContext\main\src\java\gov\va\med\imaging\transactioncontext | TransactionContextMemento.java | Wed May 30 14:35:23 2018 UTC |
2 | patch_205_build_9.zip\Java\TransactionContext\main\src\java\gov\va\med\imaging\transactioncontext | TransactionContextMemento.java | Mon Jun 4 20:22:56 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 116 |
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 | * | |
3 | */ | |
4 | package go v.va.med.i maging.tra nsactionco ntext; | |
5 | ||
6 | import jav a.io.*; | |
7 | ||
8 | import gov .va.med.im aging.tomc at.vistare alm.VistaR ealmPrinci pal; | |
9 | ||
10 | /** | |
11 | * @author PI I
|
|
12 | * | |
13 | * A wrapp er around a byte arr ay, with a fancy nam e. | |
14 | */ | |
15 | public cla ss Transac tionContex tMemento | |
16 | { | |
17 | pr ivate byte [] buffer; | |
18 | ||
19 | st atic Trans actionCont extMemento create(Vi staRealmPr incipal pr incipal) | |
20 | th rows IOExc eption | |
21 | { | |
22 | Byte ArrayOutpu tStream ou t = new By teArrayOut putStream( ); | |
23 | Obje ctOutputSt ream oos = new Objec tOutputStr eam(out); | |
24 | ||
25 | // w riteObject iterates through an y collecti on instanc es in the principal | |
26 | // t his means that any m odificatio ns to the principal while the serializat ion | |
27 | // i s taking p lace will result in a Concurre ntModifica tionExcept ion | |
28 | oos. writeObjec t(principa l); | |
29 | ||
30 | Tran sactionCon textMement o memento = new Tran sactionCon textMement o(out.toBy teArray()) ; | |
31 | oos. close(); | |
32 | ||
33 | retu rn memento ; | |
34 | } | |
35 | ||
36 | st atic Vista RealmPrinc ipal creat e(Transact ionContext Memento me mento) | |
37 | th rows IOExc eption, Cl assNotFoun dException | |
38 | { | |
39 | Byte ArrayInput Stream in = new Byte ArrayInput Stream( me mento.getB uffer() ); | |
40 | Obje ctInputStr eam ois = new Object InputStrea m(in); | |
41 | Vist aRealmPrin cipal prin cipal = (V istaRealmP rincipal)o is.readObj ect(); | |
42 | ois. close(); | |
43 | ||
44 | retu rn princip al; | |
45 | } | |
46 | ||
47 | Tr ansactionC ontextMeme nto(byte[] buffer) | |
48 | { | |
49 | this .buffer = buffer; | |
50 | } | |
51 | ||
52 | /* * | |
53 | * @return t he buffer | |
54 | * / | |
55 | by te[] getBu ffer() | |
56 | { | |
57 | retu rn this.bu ffer; | |
58 | } | |
59 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.