1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.mail;
  6. /**
  7. * This exception is thrown when a method is invoked on a Messaging object
  8. * and the Store that owns that object has died due to some reason.
  9. * This exception should be treated as a fatal error; in particular any
  10. * messaging object belonging to that Store must be considered invalid. <p>
  11. *
  12. * The connect method may be invoked on the dead Store object to
  13. * revive it. <p>
  14. *
  15. * The getMessage() method returns more detailed information about the
  16. * error that caused this exception. <p>
  17. *
  18. * @author John Mani
  19. */
  20. public class StoreClosedException extends MessagingException {
  21. transient private Store store;
  22. /**
  23. * Constructor
  24. * @param store The dead Store object
  25. */
  26. public StoreClosedException(Store store) {
  27. this(store, null);
  28. }
  29. /**
  30. * Constructor
  31. * @param store The dead Store object
  32. * @param message The detailed error message
  33. */
  34. public StoreClosedException(Store store, String message) {
  35. super(message);
  36. this.store = store;
  37. }
  38. /**
  39. * Returns the dead Store object
  40. */
  41. public Store getStore() {
  42. return store;
  43. }
  44. }