Produced by Araxis Merge on 12/5/2017 12:06:35 PM Central 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\BaseWebFacade\main\src\java\gov\va\med\imaging\exchange\business | AbstractBaseServlet.java | Mon Dec 4 21:35:14 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\BaseWebFacade\main\src\java\gov\va\med\imaging\exchange\business | AbstractBaseServlet.java | Mon Dec 4 21:57:10 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 382 |
| Changed | 2 | 4 |
| 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 | * Package : MAG - Vi stA Imagin g | |
| 3 | * WARNING : Per VHA Directive 2004-038, this routi ne should not be mod ified. | |
| 4 | * Date Cr eated: Oct 6, 2008 | |
| 5 | * Site Na me: Washi ngton OI F ield Offic e, Silver Spring, MD | |
| 6 | * @author
|
|
| 7 | * @versio n 1.0 | |
| 8 | * | |
| 9 | * ------- ---------- ---------- ---------- ---------- ---------- ------- | |
| 10 | * Propert y of the U S Governme nt. | |
| 11 | * No perm ission to copy or re distribute this soft ware is gi ven. | |
| 12 | * Use of unreleased versions of this so ftware req uires the user | |
| 13 | * to exec ute a writ ten test a greement w ith the Vi stA Imagin g | |
| 14 | * Develop ment Offic e of the D epartment of Veteran s Affairs, | |
| 15 | * telepho ne (301) 7 34-0100. | |
| 16 | * | |
| 17 | * The Foo d and Drug Administr ation clas sifies thi s software as | |
| 18 | * a Class II medica l device. As such, it may not be change d | |
| 19 | * in any way. Modi fications to this so ftware may result in an | |
| 20 | * adulter ated medic al device under 21CF R820, the use of whi ch | |
| 21 | * is cons idered to be a viola tion of US Federal S tatutes. | |
| 22 | * ------- ---------- ---------- ---------- ---------- ---------- ------- | |
| 23 | */ | |
| 24 | package go v.va.med.i maging.exc hange.busi ness; | |
| 25 | ||
| 26 | import gov .va.med.im aging.Base WebFacadeR outer; | |
| 27 | import gov .va.med.im aging.core .FacadeRou terUtility ; | |
| 28 | import gov .va.med.im aging.core .interface s.router.C ommandFact ory; | |
| 29 | ||
| 30 | import jav ax.servlet .ServletCo ntext; | |
| 31 | import jav ax.servlet .ServletEx ception; | |
| 32 | import jav ax.servlet .http.Http Servlet; | |
| 33 | ||
| 34 | import org .apache.lo gging.log4 j.LogManag er; | |
| 35 | import org .apache.lo gging.log4 j.Logger; | |
| 36 | import org .springfra mework.bea ns.BeansEx ception; | |
| 37 | import org .springfra mework.bea ns.factory .NoSuchBea nDefinitio nException ; | |
| 38 | import org .springfra mework.web .context.W ebApplicat ionContext ; | |
| 39 | import org .springfra mework.web .context.s upport.Web Applicatio nContextUt ils; | |
| 40 | ||
| 41 | /** | |
| 42 | * An abst ract servl et that pr ovides com mon web ap plication functional ity | |
| 43 | * for Ima ging servl ets such a s: | |
| 44 | * 1.) get ting route r referenc es | |
| 45 | * 2.) get ting logge r referenc es | |
| 46 | * 3.) get ting sprin g applicat ion contex t referenc es | |
| 47 | * | |
| 48 | * @author
|
|
| 49 | * | |
| 50 | */ | |
| 51 | public cla ss Abstrac tBaseServl et | |
| 52 | extends Ht tpServlet | |
| 53 | { | |
| 54 | pr ivate stat ic final l ong serial VersionUID = 1L; | |
| 55 | ||
| 56 | pu blic stati c final St ring defau ltCoreRout erBeanName = "coreRo uter"; | |
| 57 | pu blic stati c final St ring defau ltCommandF actoryBean Name = "co mmandFacto ry"; | |
| 58 | ||
| 59 | pr ivate WebA pplication Context we bApplicati onContext; | |
| 60 | pr ivate Comm andFactory commandFa ctory; | |
| 61 | pr ivate Base WebFacadeR outer rout er; | |
| 62 | pr ivate Stri ng coreRou terBeanNam e = defaul tCoreRoute rBeanName; | |
| 63 | pr ivate Stri ng command FactoryBea nName = de faultComma ndFactoryB eanName; | |
| 64 | pr ivate Logg er logger = LogManag er.getLogg er(this.ge tClass()); | |
| 65 | ||
| 66 | /* * | |
| 67 | * | |
| 68 | * / | |
| 69 | pu blic Abstr actBaseSer vlet() | |
| 70 | { | |
| 71 | } | |
| 72 | ||
| 73 | /* * | |
| 74 | * | |
| 75 | * @return | |
| 76 | * / | |
| 77 | pr otected sy nchronized WebApplic ationConte xt getWebA pplication Context() | |
| 78 | th rows Servl etExceptio n | |
| 79 | { | |
| 80 | if(w ebApplicat ionContext == null) | |
| 81 | { | |
| 82 | Servle tContext s ervletCont ext = this .getServle tContext() ; | |
| 83 | webApp licationCo ntext = We bApplicati onContextU tils.getRe quiredWebA pplication Context(se rvletConte xt); | |
| 84 | ||
| 85 | if(web Applicatio nContext = = null) | |
| 86 | { | |
| 87 | String m sg = | |
| 88 | "Unable to acquire a reference to the we b applicat ion contex t.\n" + | |
| 89 | "A Spring Web Applic ation Cont ext must b e provided for this servlet an d its deri vatives."; | |
| 90 | logger.e rror(msg); | |
| 91 | throw ne w ServletE xception(m sg); | |
| 92 | } | |
| 93 | } | |
| 94 | retu rn webAppl icationCon text; | |
| 95 | } | |
| 96 | ||
| 97 | /* * | |
| 98 | * | |
| 99 | * @return | |
| 100 | * / | |
| 101 | pr otected sy nchronized BaseWebFa cadeRouter getRouter () | |
| 102 | th rows Servl etExceptio n | |
| 103 | { | |
| 104 | Ba seWebFacad eRouter ro uter; | |
| 105 | try | |
| 106 | { | |
| 107 | router = FacadeR outerUtili ty.getFaca deRouter(B aseWebFaca deRouter.c lass); | |
| 108 | } | |
| 109 | catc h (Excepti on x) | |
| 110 | { | |
| 111 | logger .error("Ex ception ge tting the facade rou ter implem entation." , x); | |
| 112 | return null; | |
| 113 | } | |
| 114 | ||
| 115 | retu rn router; | |
| 116 | } | |
| 117 | ||
| 118 | pr otected sy nchronized CommandFa ctory getC ommandFact ory() | |
| 119 | th rows Servl etExceptio n | |
| 120 | { | |
| 121 | if(c ommandFact ory == nul l) | |
| 122 | { | |
| 123 | try | |
| 124 | { | |
| 125 | commandF actory = ( CommandFac tory)getWe bApplicati onContext( ).getBean( commandFac toryBeanNa me); | |
| 126 | } | |
| 127 | catch (NoSuchBea nDefinitio nException nsbdX) | |
| 128 | { | |
| 129 | String m sg = | |
| 130 | "Unable to acquire a reference to the Co mmandFacto ry impleme ntation.\n " + | |
| 131 | "The Sprin g Web Appl ication Co ntext must provide a bean name d '" + com mandFactor yBeanName + | |
| 132 | "' a refer ence to a CommandFac tory imple mentation and it doe s not."; | |
| 133 | logger.e rror(msg); | |
| 134 | throw ne w ServletE xception(m sg); | |
| 135 | } | |
| 136 | catch (BeansExce ption e) | |
| 137 | { | |
| 138 | String m sg = | |
| 139 | "Unable to acquire a reference to the Co mmandFacto ry impleme ntation.\n " + | |
| 140 | "The Sprin g Web Appl ication Co ntext prov ides a bea n named '" + command FactoryBea nName + | |
| 141 | "' but the bean coul d not be i nstantiate d."; | |
| 142 | logger.e rror(msg); | |
| 143 | throw ne w ServletE xception(m sg); | |
| 144 | } | |
| 145 | catch (ClassCast Exception ccX) | |
| 146 | { | |
| 147 | String m sg = | |
| 148 | "Unable to acquire a reference to the Co mmandFacto ry impleme ntation.\n " + | |
| 149 | "The Sprin g Web Appl ication Co ntext prov ides a bea n named '" + command FactoryBea nName + | |
| 150 | "' but the reference d object d oes not im plement Co mmandFacto ry."; | |
| 151 | logger.e rror(msg); | |
| 152 | throw ne w ServletE xception(m sg); | |
| 153 | } | |
| 154 | } | |
| 155 | ||
| 156 | retu rn command Factory; | |
| 157 | } | |
| 158 | ||
| 159 | pr otected Lo gger getLo gger() | |
| 160 | { | |
| 161 | retu rn logger; | |
| 162 | } | |
| 163 | ||
| 164 | /* * | |
| 165 | * The CoreR outerBeanN ame is the name of t he bean in the Sprin g Web Appl ication Co ntext | |
| 166 | * that is a reference to a Rout er impleme ntation. | |
| 167 | * | |
| 168 | * @return | |
| 169 | * / | |
| 170 | pr otected St ring getCo reRouterBe anName() | |
| 171 | { | |
| 172 | re turn coreR outerBeanN ame; | |
| 173 | } | |
| 174 | ||
| 175 | pr otected vo id setCore RouterBean Name(Strin g coreRout erBeanName ) | |
| 176 | { | |
| 177 | th is.coreRou terBeanNam e = coreRo uterBeanNa me; | |
| 178 | } | |
| 179 | ||
| 180 | /* * | |
| 181 | * Initializ ation of t he servlet . <br> | |
| 182 | * | |
| 183 | * @throws S ervletExce ption if a n error oc curs | |
| 184 | * / | |
| 185 | pu blic void init() | |
| 186 | th rows Servl etExceptio n | |
| 187 | { | |
| 188 | // c alling get Router wil l force ex ceptions i mmediately if the ro uter or | |
| 189 | // s pring cont ext are no t availabl e | |
| 190 | getR outer(); | |
| 191 | } | |
| 192 | ||
| 193 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.