1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.transaction;
  6. /**
  7. * The Status interface defines the static variable for transaction
  8. * status code.
  9. */
  10. public interface Status {
  11. /**
  12. * A transaction is associated with the target object and it is in the
  13. * active state. An implementation returns this status after a
  14. * transaction has been started and prior to a Coordinator issuing
  15. * any prepares unless the transaction has been marked for rollback.
  16. */
  17. public final static int STATUS_ACTIVE = 0;
  18. /**
  19. * A transaction is associated with the target object and it has been
  20. * marked for rollback, perhaps as a result of a setRollbackOnly operation.
  21. */
  22. public final static int STATUS_MARKED_ROLLBACK = 1;
  23. /**
  24. * A transaction is associated with the target object and it has been
  25. * prepared, i.e. all subordinates have responded Vote.Commit. The
  26. * target object may be waiting for a superior's instruction as how
  27. * to proceed.
  28. */
  29. public final static int STATUS_PREPARED = 2;
  30. /**
  31. * A transaction is associated with the target object and it has been
  32. * committed. It is likely that heuristics exists, otherwise the
  33. * transaction would have been destroyed and NoTransaction returned.
  34. */
  35. public final static int STATUS_COMMITTED = 3;
  36. /**
  37. * A transaction is associated with the target object and the outcome
  38. * has been determined as rollback. It is likely that heuristics exist,
  39. * otherwise the transaction would have been destroyed and NoTransaction
  40. * returned.
  41. */
  42. public final static int STATUS_ROLLEDBACK = 4;
  43. /**
  44. * A transaction is associated with the target object but its
  45. * current status cannot be determined. This is a transient condition
  46. * and a subsequent invocation will ultimately return a different status.
  47. */
  48. public final static int STATUS_UNKNOWN = 5;
  49. /**
  50. * No transaction is currently associated with the target object. This
  51. * will occur after a transaction has completed.
  52. */
  53. public final static int STATUS_NO_TRANSACTION = 6;
  54. /**
  55. * A transaction is associated with the target object and it is in the
  56. * process of preparing. An implementation returns this status if it
  57. * has started preparing, but has not yet completed the process, probably
  58. * because it is waiting for responses to prepare from one or more
  59. * Resources.
  60. */
  61. public final static int STATUS_PREPARING = 7;
  62. /**
  63. * A transaction is associated with the target object and it is in the
  64. * process of committing. An implementation returns this status if it
  65. * has decided to commit, but has not yet completed the process, probably
  66. * because it is waiting for responses from one or more Resources.
  67. */
  68. public final static int STATUS_COMMITTING = 8;
  69. /**
  70. * A transaction is associated with the target object and it is in the
  71. * process of rolling back. An implementation returns this status if
  72. * it has decided to rollback, but has not yet completed the process,
  73. * probably because it is waiting for responses from one or more
  74. * Resources.
  75. */
  76. public final static int STATUS_ROLLING_BACK = 9;
  77. }