1 8 9 package com.sleepycat.je; 10 11 import com.sleepycat.je.dbi.EnvironmentImpl; 12 13 17 public class RunRecoveryException extends DatabaseException { 18 19 private boolean alreadyThrown = false; 20 21 RunRecoveryException() { 22 super(); 23 } 24 25 public RunRecoveryException(EnvironmentImpl env) { 26 super(); 27 invalidate(env); 28 } 29 30 public RunRecoveryException(EnvironmentImpl env, Throwable t) { 31 super(t); 32 invalidate(env); 33 } 34 35 public RunRecoveryException(EnvironmentImpl env, String message) { 36 super(message); 37 invalidate(env); 38 } 39 40 public RunRecoveryException(EnvironmentImpl env, 41 String message, Throwable t) { 42 super(message, t); 43 invalidate(env); 44 } 45 46 private void invalidate(EnvironmentImpl env) { 47 if (env != null) { 48 env.invalidate(this); 49 } 50 } 51 52 57 public void setAlreadyThrown() { 58 alreadyThrown = true; 59 } 60 61 public String toString() { 62 if (alreadyThrown) { 63 return "Environment invalid because of previous exception: " + 64 super.toString(); 65 } else { 66 return super.toString(); 67 } 68 } 69 } 70 | Popular Tags |