- Timestamp:
- 02/29/08 19:16:14 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/dss/src/org/openmrs/module/dss/CompilingClassLoader.java
r3289 r3513 141 141 } 142 142 143 144 145 143 // The heart of the ClassLoader -- automatically compile 146 144 // source as necessary when looking for class files … … 151 149 { 152 150 AdministrationService adminService = Context.getAdministrationService(); 153 String rulePackagePrefix = adminService.getGlobalProperty("dss.rulePackagePrefix"); 154 if(!rulePackagePrefix.endsWith(".")) 155 { 156 rulePackagePrefix+="."; 157 } 151 String rulePackagePrefix = Util.processPackagePrefix( 152 adminService.getGlobalProperty("dss.rulePackagePrefix")); 158 153 String javaRuleDirectory = Util.processFileDirectoryGlobalProperty("dss.javaRuleDirectory"); 159 154 String classRulesDirectory = Util.processFileDirectoryGlobalProperty( … … 215 210 ModuleFactory.getModuleClassLoaders(); 216 211 217 for(ModuleClassLoader currClassLoader:moduleClassLoaders) 218 { 212 Iterator<ModuleClassLoader> iter = moduleClassLoaders.iterator(); 213 214 while(iter.hasNext()&&clas == null) 215 { 216 ModuleClassLoader currClassLoader = iter.next(); 219 217 try 220 218 { … … 235 233 // Create a pathname from the class name 236 234 // E.g. java.lang.Object => java/lang/Object 237 String fileStub = name.replace('.', '\\'); 235 String fileStub = name; 236 if(fileStub.lastIndexOf('.') >-1) 237 { 238 fileStub = fileStub.substring(fileStub.lastIndexOf('.')+1, 239 fileStub.length()); 240 } 241 238 242 // Build objects pointing to the source code (.java) and object 239 243 // code (.class) … … 247 251 248 252 // If no javafile exists, run thru the arden parser 249 250 253 if(mlmFile.exists()&&(!javaFile.exists() || mlmFile.lastModified() > javaFile.lastModified())) 251 254 { … … 344 347 byte raw[] = getBytes(classFilename); 345 348 // try to turn them into a class 346 clas = defineClass( rulePackagePrefix +name, raw, 0, raw.length);349 clas = defineClass( name, raw, 0, raw.length); 347 350 348 351 //load class filename into rule table … … 363 366 } catch (Exception ie) 364 367 { 365 log.error("Error defining class file: "+classFilename+". \n"+366 ie.getMessage());367 368 } 368 369 }