1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base; 27 28 36 public class InitializationError 37 extends DeployerFailureException 38 { 39 40 private int gravity=0; 46 57 public InitializationError(DeployerContext deployer, 58 String message) 59 { 60 super(deployer,null,message); 61 } 62 70 public InitializationError(DeployerContext deployer, 71 Exception e, 72 String message) 73 { 74 super(deployer,e,message); 75 } 76 77 85 public InitializationError(DeployerContext deployer, 86 Exception e, 87 String message, 88 int gravity) 89 { 90 super(deployer,e,message); 91 this.gravity=gravity; 92 } 93 99 105 public void 106 printStackTrace() 107 { 108 109 110 System.err.println(getMessage()); 111 if(gravity==1&&getInitialException()!=null) 112 getInitialException().printStackTrace(); 113 else 114 if(getInitialException()!=null) 115 System.err.println(getInitialException().getMessage()); 116 120 121 } 122 123 public String 124 getMessage() 125 { if(message==null) 126 message=""; 127 128 if(getDeployer()==null) 129 return "The deployment machine building was aborted during "+ 130 " initialization due to\n"+message; 131 132 133 return "The deployment machine building was aborted when tried "+ 134 "to initialize "+getDeployer().getIdentifier()+" due to :\n"+message; 135 } 136 } 137 | Popular Tags |