Produced by Araxis Merge on 12/5/2017 12:06:37 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\CoreRouter\main\src\java\gov\va\med\imaging\core | CommandFactoryImpl.java | Mon Dec 4 21:34:32 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CoreRouter\main\src\java\gov\va\med\imaging\core | CommandFactoryImpl.java | Mon Dec 4 21:58:23 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 564 |
| 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 1, 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.cor e; | |
| 25 | ||
| 26 | import gov .va.med.im aging.core .interface s.router.C ommand; | |
| 27 | import gov .va.med.im aging.core .interface s.router.C ommandCont ext; | |
| 28 | import gov .va.med.im aging.core .interface s.router.C ommandFact ory; | |
| 29 | import jav a.util.Col lection; | |
| 30 | import jav a.util.Map ; | |
| 31 | import org .apache.lo gging.log4 j.LogManag er; | |
| 32 | import org .apache.lo gging.log4 j.Logger; | |
| 33 | ||
| 34 | /** | |
| 35 | * @author
|
|
| 36 | * | |
| 37 | */ | |
| 38 | public cla ss Command FactoryImp l | |
| 39 | implements CommandFa ctory | |
| 40 | { | |
| 41 | pr ivate fina l CommandC ontext com mandContex t; | |
| 42 | pr ivate fina l Logger l ogger = Lo gManager.g etLogger(t his.getCla ss()); | |
| 43 | ||
| 44 | /* * | |
| 45 | * This cons tructor ha s been dep recated in favor of the single argument | |
| 46 | * construct or (having a fully c onstructed command f actory). | |
| 47 | * @see #Com mandFactor yImpl(Comm andContext ) | |
| 48 | * @param ro uter | |
| 49 | * / | |
| 50 | @D eprecated | |
| 51 | pu blic Comma ndFactoryI mpl( | |
| 52 | Rout erImpl rou ter) | |
| 53 | { | |
| 54 | this .commandCo ntext = ne w CommandC ontextImpl (router, t his); | |
| 55 | } | |
| 56 | ||
| 57 | /* * | |
| 58 | * The Comma ndContext should ref erence the CommandFa ctoryProvi der as the command f actory | |
| 59 | * to provid e access t o all the installed command fa ctories. | |
| 60 | * | |
| 61 | * @param co mmandConte xt | |
| 62 | * / | |
| 63 | pu blic Comma ndFactoryI mpl(Comman dContext c ommandCont ext) | |
| 64 | { | |
| 65 | this .commandCo ntext = co mmandConte xt; | |
| 66 | } | |
| 67 | ||
| 68 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ========= | |
| 69 | // | |
| 70 | /* | |
| 71 | pr ivate Stri ng [] getC ommandPack ageNames() | |
| 72 | { | |
| 73 | Stri ng [] comm ands = new String [C ommandVoca bulary.val ues().leng th]; | |
| 74 | int count = 0; | |
| 75 | for( CommandVoc abulary cv : Command Vocabulary .values()) | |
| 76 | { | |
| 77 | comman ds[count] = cv.getPa ckageName( ) + "."; | |
| 78 | count+ +; | |
| 79 | } | |
| 80 | retu rn command s; | |
| 81 | }* / | |
| 82 | ||
| 83 | pr ivate Comm andContext getComman dContext() | |
| 84 | { | |
| 85 | retu rn this.co mmandConte xt; | |
| 86 | } | |
| 87 | ||
| 88 | /* * | |
| 89 | * @return t he logger | |
| 90 | * / | |
| 91 | pu blic Logge r getLogge r() | |
| 92 | { | |
| 93 | retu rn this.lo gger; | |
| 94 | } | |
| 95 | ||
| 96 | /* * | |
| 97 | * | |
| 98 | * @param co mmandClass Name | |
| 99 | * @param pa rameterTyp es | |
| 100 | * @param pa rameters | |
| 101 | * @return | |
| 102 | * / | |
| 103 | pu blic <R ex tends Obje ct> Comman d<R> creat eCommand( | |
| 104 | Clas s<R> resul tClass, | |
| 105 | Stri ng command ClassName, | |
| 106 | Stri ng command Package, | |
| 107 | Clas s<?>[] par ameterType s, | |
| 108 | Obje ct[] param eters) | |
| 109 | { | |
| 110 | Comm andClassSe mantics co mmandClass Semantics = null; | |
| 111 | try | |
| 112 | { | |
| 113 | comman dClassSema ntics = Co mmandClass Semantics. create(com mandClassN ame, comma ndPackage) ; | |
| 114 | } | |
| 115 | catc h (CoreRou terSemanti csExceptio n x) | |
| 116 | { | |
| 117 | getLog ger().erro r( "The co mmand name '" + comm andClassNa me + "' is not a val id command class nam e accordin g to the d efined sem antics.", x ); | |
| 118 | return (Command< R>)null; | |
| 119 | } | |
| 120 | ||
| 121 | retu rn createC ommand( | |
| 122 | comman dClassSema ntics, | |
| 123 | parame terTypes, | |
| 124 | parame ters); | |
| 125 | } | |
| 126 | ||
| 127 | @O verride | |
| 128 | pu blic <R> b oolean isC ommandSupp orted(Clas s<R> resul tClass, | |
| 129 | String commandCl assName, S tring comm andPackage , | |
| 130 | Class< ?>[] param eterTypes, Object[] parameters ) | |
| 131 | { | |
| 132 | Comm andClassSe mantics co mmandClass Semantics = null; | |
| 133 | try | |
| 134 | { | |
| 135 | comman dClassSema ntics = Co mmandClass Semantics. create(com mandClassN ame, comma ndPackage) ; | |
| 136 | } | |
| 137 | catc h (CoreRou terSemanti csExceptio n x) | |
| 138 | { | |
| 139 | getLog ger().erro r( "The co mmand name '" + comm andClassNa me + "' is not a val id command class nam e accordin g to the d efined sem antics.", x ); | |
| 140 | return false; | |
| 141 | } | |
| 142 | retu rn isComma ndSupporte d(commandC lassSemant ics, param eterTypes, parameter s); | |
| 143 | } | |
| 144 | ||
| 145 | /* (non-Java doc) | |
| 146 | * @see gov. va.med.ima ging.core. interfaces .router.Co mmandFacto ry#createC ollectionC ommand(jav a.lang.Cla ss, java.l ang.Class, java.lang .String, j ava.lang.C lass<?>[], java.lang .Object[]) | |
| 147 | * / | |
| 148 | @O verride | |
| 149 | @S uppressWar nings("unc hecked") | |
| 150 | pu blic <C ex tends Coll ection<R>, R> Comman d<C> creat eCollectio nCommand( | |
| 151 | Class< C> collect ionClass, Class<R> r esultClass , | |
| 152 | String commandCl assName, S tring comm andPackage , | |
| 153 | Class< ?>[] initA rgTypes, O bject[] in itArgs) | |
| 154 | th rows Illeg alArgument Exception | |
| 155 | { | |
| 156 | Comm and<?> com mand = cre ateNonType safeComman d(commandC lassName, commandPac kage, | |
| 157 | initArgT ypes, init Args); | |
| 158 | ||
| 159 | retu rn (Comman d<C>)comma nd; | |
| 160 | } | |
| 161 | ||
| 162 | @O verride | |
| 163 | pu blic <C ex tends Coll ection<R>, R> boolea n isCollec tionComman dSupported ( | |
| 164 | Class< C> collect ionClass, Class<R> r esultClass , | |
| 165 | String commandCl assName, S tring comm andPackage , | |
| 166 | Class< ?>[] initA rgTypes, O bject[] in itArgs) | |
| 167 | throws IllegalAr gumentExce ption | |
| 168 | { | |
| 169 | Comm andClassSe mantics co mmandClass Semantics = null; | |
| 170 | try | |
| 171 | { | |
| 172 | comman dClassSema ntics = Co mmandClass Semantics. create(com mandClassN ame, comma ndPackage) ; | |
| 173 | } | |
| 174 | catc h (CoreRou terSemanti csExceptio n x) | |
| 175 | { | |
| 176 | getLog ger().erro r( "The co mmand name '" + comm andClassNa me + "' is not a val id command class nam e accordin g to the d efined sem antics.", x ); | |
| 177 | return false; | |
| 178 | } | |
| 179 | ||
| 180 | retu rn isComma ndSupporte d( | |
| 181 | comman dClassSema ntics, | |
| 182 | initAr gTypes, | |
| 183 | initAr gs); | |
| 184 | } | |
| 185 | ||
| 186 | @O verride | |
| 187 | @S uppressWar nings("unc hecked") | |
| 188 | pu blic <C ex tends Map< K,V>, K, V > Command< C> createM apCollecti onCommand( | |
| 189 | Clas s<C> colle ctionClass , | |
| 190 | Clas s<K> mapKe yClass, Cl ass<V> map ValueClass , | |
| 191 | Stri ng command ClassName, | |
| 192 | Stri ng command Package, | |
| 193 | Clas s<?>[] ini tArgTypes, | |
| 194 | Obje ct[] initA rgs) | |
| 195 | th rows Illeg alArgument Exception | |
| 196 | { | |
| 197 | Comm and<?> com mand = cre ateNonType safeComman d(commandC lassName, commandPac kage, | |
| 198 | initArgT ypes, init Args); | |
| 199 | ||
| 200 | retu rn (Comman d<C>)comma nd; | |
| 201 | } | |
| 202 | ||
| 203 | @O verride | |
| 204 | pu blic <C ex tends Map< K, V>, K, V> boolean isMapColl ectionComm andSupport ed( | |
| 205 | Class< C> collect ionClass, Class<K> m apKeyClass , | |
| 206 | Class< V> mapValu eClass, St ring comma ndClassNam e, | |
| 207 | String commandPa ckage, Cla ss<?>[] in itArgTypes , Object[] initArgs) | |
| 208 | throws IllegalAr gumentExce ption | |
| 209 | { | |
| 210 | Comm andClassSe mantics co mmandClass Semantics = null; | |
| 211 | try | |
| 212 | { | |
| 213 | comman dClassSema ntics = Co mmandClass Semantics. create(com mandClassN ame, comma ndPackage) ; | |
| 214 | } | |
| 215 | catc h (CoreRou terSemanti csExceptio n x) | |
| 216 | { | |
| 217 | getLog ger().erro r( "The co mmand name '" + comm andClassNa me + "' is not a val id command class nam e accordin g to the d efined sem antics.", x ); | |
| 218 | return false; | |
| 219 | } | |
| 220 | ||
| 221 | retu rn isComma ndSupporte d( | |
| 222 | comman dClassSema ntics, | |
| 223 | initAr gTypes, | |
| 224 | initAr gs); | |
| 225 | } | |
| 226 | ||
| 227 | /* * | |
| 228 | * | |
| 229 | * @param co mmandClass Name | |
| 230 | * @param in itArgTypes | |
| 231 | * @param in itArgs | |
| 232 | * @return | |
| 233 | * / | |
| 234 | pr ivate Comm and<?> cre ateNonType safeComman d(String c ommandClas sName, Str ing comman dPackage, | |
| 235 | Class< ?>[] initA rgTypes, O bject[] in itArgs) | |
| 236 | { | |
| 237 | Comm andClassSe mantics co mmandClass Semantics = null; | |
| 238 | try | |
| 239 | { | |
| 240 | comman dClassSema ntics = Co mmandClass Semantics. create(com mandClassN ame, comma ndPackage) ; | |
| 241 | } | |
| 242 | catc h (CoreRou terSemanti csExceptio n x) | |
| 243 | { | |
| 244 | getLog ger().erro r( "The co mmand name '" + comm andClassNa me + "' is not a val id command class nam e accordin g to the d efined sem antics.", x ); | |
| 245 | return (Command< ?>)null; | |
| 246 | } | |
| 247 | ||
| 248 | retu rn createC ommand( | |
| 249 | comman dClassSema ntics, | |
| 250 | initAr gTypes, | |
| 251 | initAr gs); | |
| 252 | } | |
| 253 | ||
| 254 | pr ivate stat ic Command Creator co mmandCreat or = null; | |
| 255 | pr ivate sync hronized s tatic Comm andCreator getComman dCreator(C ommandCont ext comman dContext) | |
| 256 | { | |
| 257 | if(c ommandCrea tor == nul l) | |
| 258 | { | |
| 259 | comman dCreator = new Comma ndCreator( commandCon text); | |
| 260 | } | |
| 261 | retu rn command Creator; | |
| 262 | } | |
| 263 | ||
| 264 | /* * | |
| 265 | * | |
| 266 | * / | |
| 267 | pr ivate <R e xtends Obj ect> Comma nd<R> crea teCommand( | |
| 268 | Comm andClassSe mantics co mmandClass Semantics, | |
| 269 | Clas s<?>[] par ameterType s, | |
| 270 | Obje ct[] initA rgs) | |
| 271 | { | |
| 272 | Comm andCreator commandCr eator = ge tCommandCr eator(getC ommandCont ext()); | |
| 273 | retu rn command Creator.cr eateComman d(commandC lassSemant ics, param eterTypes, initArgs) ; | |
| 274 | } | |
| 275 | ||
| 276 | pr ivate bool ean isComm andSupport ed( | |
| 277 | Comman dClassSema ntics comm andClassSe mantics, | |
| 278 | Class< ?>[] param eterTypes, | |
| 279 | Object [] initArg s) | |
| 280 | { | |
| 281 | Comm andCreator commandCr eator = ge tCommandCr eator(getC ommandCont ext()); | |
| 282 | retu rn command Creator.is CommandSup ported(com mandClassS emantics, parameterT ypes, init Args); | |
| 283 | } | |
| 284 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.