1 package org.enhydra.shark; 2 3 import java.util.Properties ; 4 import org.enhydra.shark.SharkEngineManager; 5 import org.enhydra.shark.api.RootException; 6 import org.enhydra.shark.api.internal.working.CallbackUtilities; 7 8 14 public class CallbackUtil implements CallbackUtilities { 15 16 private Properties properties; 17 18 protected CallbackUtil () { 19 } 20 21 25 32 public String getProperty (String name) { 33 return properties.getProperty(name); 34 } 35 36 45 public String getProperty (String name,String defaultValue) { 46 return properties.getProperty(name,defaultValue); 47 } 48 49 55 public Properties getProperties () { 56 return properties; 57 } 58 59 65 public void setProperties (Properties props) { 66 this.properties=props; 67 } 68 69 75 public void error (String msg) { 76 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 77 try { 78 SharkEngineManager.getInstance().getLoggingManager().error(msg); 79 } 80 catch (Exception e){ 81 System.err.println("Error in logging - errMsg="+e.getMessage()); 82 } 83 } 84 } 85 86 93 public void error (String msg,RootException ex) { 94 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 95 try { 96 SharkEngineManager.getInstance().getLoggingManager().error(msg, ex); 97 } 98 catch (Exception e){ 99 System.err.println("Error in logging - errMsg="+e.getMessage()); 100 } 101 } 102 } 103 104 111 public void error (String channel,String msg) { 112 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 113 try { 114 SharkEngineManager.getInstance().getLoggingManager().error(channel, msg); 115 } 116 catch (Exception e){ 117 System.err.println("Error in logging - errMsg="+e.getMessage()); 118 } 119 } 120 } 121 122 130 public void error (String channel,String msg,RootException ex) { 131 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 132 try { 133 SharkEngineManager.getInstance().getLoggingManager().error(channel, msg, ex); 134 } 135 catch (Exception e){ 136 System.err.println("Error in logging - errMsg="+e.getMessage()); 137 } 138 } 139 } 140 141 147 public void warn (String msg) { 148 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 149 try { 150 SharkEngineManager.getInstance().getLoggingManager().warn(msg); 151 } 152 catch (Exception e){ 153 System.err.println("Error in logging - errMsg="+e.getMessage()); 154 } 155 } 156 } 157 158 165 public void warn (String msg,RootException ex) { 166 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 167 try { 168 SharkEngineManager.getInstance().getLoggingManager().warn(msg, ex); 169 } 170 catch (Exception e){ 171 System.err.println("Error in logging - errMsg="+e.getMessage()); 172 } 173 } 174 } 175 176 183 public void warn (String channel,String msg) { 184 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 185 try { 186 SharkEngineManager.getInstance().getLoggingManager().warn(channel, msg); 187 } 188 catch (Exception e){ 189 System.err.println("Error in logging - errMsg="+e.getMessage()); 190 } 191 } 192 } 193 194 202 public void warn (String channel,String msg,RootException ex) { 203 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 204 try { 205 SharkEngineManager.getInstance().getLoggingManager().warn(channel, msg, ex); 206 } 207 catch (Exception e){ 208 System.err.println("Error in logging - errMsg="+e.getMessage()); 209 } 210 } 211 } 212 213 219 public void info (String msg) { 220 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 221 try { 222 SharkEngineManager.getInstance().getLoggingManager().info(msg); 223 } 224 catch (Exception e){ 225 System.err.println("Error in logging - errMsg="+e.getMessage()); 226 } 227 } 228 } 229 230 237 public void info (String msg,RootException ex) { 238 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 239 try { 240 SharkEngineManager.getInstance().getLoggingManager().info(msg, ex); 241 } 242 catch (Exception e){ 243 System.err.println("Error in logging - errMsg="+e.getMessage()); 244 } 245 } 246 } 247 248 255 public void info (String channel,String msg) { 256 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 257 try { 258 SharkEngineManager.getInstance().getLoggingManager().info(channel, msg); 259 } 260 catch (Exception e){ 261 System.err.println("Error in logging - errMsg="+e.getMessage()); 262 } 263 } 264 } 265 266 274 public void info (String channel,String msg,RootException ex) { 275 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 276 try { 277 SharkEngineManager.getInstance().getLoggingManager().info(channel, msg, ex); 278 } 279 catch (Exception e){ 280 System.err.println("Error in logging - errMsg="+e.getMessage()); 281 } 282 } 283 } 284 285 291 public void debug (String msg) { 292 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 293 try { 294 SharkEngineManager.getInstance().getLoggingManager().debug(msg); 295 } 296 catch (Exception e){ 297 System.err.println("Error in logging - errMsg="+e.getMessage()); 298 } 299 } 300 } 301 302 309 public void debug (String msg,RootException ex) { 310 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 311 try { 312 SharkEngineManager.getInstance().getLoggingManager().debug(msg, ex); 313 } 314 catch (Exception e){ 315 System.err.println("Error in logging - errMsg="+e.getMessage()); 316 } 317 } 318 } 319 320 327 public void debug (String channel,String msg) { 328 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 329 try { 330 SharkEngineManager.getInstance().getLoggingManager().debug(channel, msg); 331 } 332 catch (Exception e){ 333 System.err.println("Error in logging - errMsg="+e.getMessage()); 334 } 335 } 336 } 337 338 346 public void debug (String channel,String msg,RootException ex) { 347 if (SharkEngineManager.getInstance().getLoggingManager() != null) { 348 try { 349 SharkEngineManager.getInstance().getLoggingManager().debug(channel, msg, ex); 350 } 351 catch (Exception e){ 352 System.err.println("Error in logging - errMsg="+e.getMessage()); 353 } 354 } 355 } 356 357 } 358 359 | Popular Tags |