1 23 24 28 29 package com.sun.enterprise.deployment.backend; 30 31 import java.io.File ; 32 import java.util.List ; 33 import java.util.Properties ; 34 import com.sun.ejb.codegen.EjbcContext; 35 import com.sun.ejb.codegen.IASEJBCTimes; 36 import com.sun.enterprise.loader.EJBClassLoader; 37 import com.sun.enterprise.util.io.FileUtils; 38 import com.sun.enterprise.util.i18n.StringManager; 39 40 import com.sun.enterprise.deployment.Application; 41 42 43 50 public class EjbcContextImpl implements EjbcContext { 51 52 55 EjbcContextImpl() 56 { 57 } 58 59 65 66 EjbcContextImpl(File srcDir, File stubsDir, Application dd, DeploymentRequest request) 67 { 68 setSrcDir(srcDir); 69 setStubsDir(stubsDir); 70 setDeploymentRequest(request); 71 setOptionalArguments(request.getOptionalArguments()); 72 setDescriptor(dd); 73 } 74 75 76 81 public File getSrcDir() { 82 return this._srcDir; 83 } 84 85 90 void setSrcDir(File srcDir) { 91 this._srcDir = srcDir; 92 } 93 94 100 public File getOldSrcDir() { 101 return this._oldSrcDir; 102 } 103 104 109 void setOldSrcDir(File oldSrcDir) { 110 this._oldSrcDir = oldSrcDir; 111 } 112 113 119 public File getStubsDir() { 120 return this._stubsDir; 121 } 122 123 128 void setStubsDir(File stubsDir) { 129 this._stubsDir = stubsDir; 130 } 131 132 138 public File getOldStubsDir() { 139 return this._oldStubsDir; 140 } 141 142 147 void setOldStubsDir(File oldStubsDir) { 148 this._oldStubsDir = oldStubsDir; 149 } 150 151 157 public Application getDescriptor() { 158 return this._application; 159 } 160 161 167 void setDescriptor(Application application) { 168 this._application = application; 169 } 170 171 176 public boolean isRedeploy() { 177 178 boolean tf = false; 179 180 if ( FileUtils.safeIsDirectory(this._oldSrcDir) 181 && FileUtils.safeIsDirectory(this._oldStubsDir) ) { 182 183 tf = true; 184 185 } 186 187 return tf; 188 } 189 190 public ClassLoader getOldClassLoader() { 191 return this._oldClassLoader; 192 } 193 194 void setOldClassLoader(ClassLoader oldClassLoader) { 195 this._oldClassLoader = oldClassLoader; 196 } 197 198 206 public String [] getClasspathUrls() { 207 return this._classpathUrls; 208 } 209 210 215 void setClasspathUrls(String [] classpathUrls) { 216 this._classpathUrls = classpathUrls; 217 } 218 219 228 public List getRmicOptions() { 229 return this._rmicOptions; 230 } 231 232 237 void setRmicOptions(List rmicOptions) { 238 this._rmicOptions = rmicOptions; 239 } 240 241 249 public List getJavacOptions() { 250 return this._javacOptions; 251 } 252 253 258 void setJavacOptions(List javacOptions) { 259 this._javacOptions = javacOptions; 260 } 261 262 267 public IASEJBCTimes getTiming() { 268 return this._timing; 269 } 270 271 277 void setTiming(IASEJBCTimes timing) { 278 this._timing = timing; 279 } 280 281 286 public String [] getEjbClasspathUrls() { 287 return this._ejbClasspathUrls; 288 } 289 290 297 void setEjbClasspathUrls(String [] paths) { 298 this._ejbClasspathUrls = paths; 299 } 300 301 307 public DeploymentMode getDeploymentMode() { 308 return this._deploymentMode; 309 } 310 311 316 void setDeploymentMode(DeploymentMode mode) throws IASDeploymentException { 317 if (mode == null) { 318 String msg = localStrings.getString( 319 "enterprise.deployment.backend.invalid_deployment_mode", 320 "null" ); 321 throw new IASDeploymentException(msg); 322 } 323 this._deploymentMode = mode; 324 } 325 326 332 public Properties getOptionalArguments() 333 { 334 return _optionalArguments; 335 } 336 337 342 void setOptionalArguments(Properties p) 343 { 344 _optionalArguments = p; 345 } 346 347 351 public DeploymentRequest getDeploymentRequest() 352 { 353 return _request; 354 } 355 356 360 void setDeploymentRequest(DeploymentRequest request) 361 { 362 _request = request; 363 } 364 365 public void cleanup() { 366 367 if( _oldClassLoader != null ) { 368 if( _oldClassLoader instanceof EJBClassLoader ) { 369 ( (EJBClassLoader) _oldClassLoader ).done(); 370 _oldClassLoader = null; 371 } 372 } 373 374 } 375 376 378 379 private File _srcDir = null; 380 381 382 private File _oldSrcDir = null; 383 384 385 private File _stubsDir = null; 386 387 388 private File _oldStubsDir = null; 389 390 391 private Application _application = null; 392 393 394 private Object _oldDescriptor = null; 395 396 private ClassLoader _oldClassLoader = null; 397 398 399 private String [] _classpathUrls = null; 400 401 402 private String [] _ejbClasspathUrls = null; 403 404 405 private List _rmicOptions = null; 406 407 408 private List _javacOptions = null; 409 410 411 private IASEJBCTimes _timing = null; 412 413 414 private DeploymentMode _deploymentMode = DeploymentMode.EXPLODED; 415 416 417 private Properties _optionalArguments = null; 418 419 420 private DeploymentRequest _request = null; 421 422 423 private static StringManager localStrings = 424 StringManager.getManager( EjbcContextImpl.class ); 425 } 426 | Popular Tags |