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 transaction manager supports a synchronization mechanism
  8. * that allows the interested party to be notified before and
  9. * after the transaction completes. Using the registerSynchronization
  10. * method, the application server registers a Synchronization object
  11. * for the transaction currently associated with the target Transaction
  12. * object.
  13. */
  14. public interface Synchronization {
  15. /**
  16. * This method is called by the transaction
  17. * manager prior to the start of the transaction completion process.
  18. */
  19. public void beforeCompletion();
  20. /**
  21. * This method is called by the transaction
  22. * manager after the transaction is committed or rolled back.
  23. *
  24. * @param status The status of the transaction completion.
  25. */
  26. public void afterCompletion(int status);
  27. }