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.xa;
  6. /**
  7. * The Xid interface is a Java mapping of the X/Open transaction identifier
  8. * XID structure. This interface specifies three accessor methods to
  9. * retrieve a global transaction’s format ID, global transaction ID,
  10. * and branch qualifier. The Xid interface is used by the transaction
  11. * manager and the resource managers. This interface is not visible to
  12. * the application programs.
  13. */
  14. public interface Xid {
  15. /**
  16. * Maximum number of bytes returned by getGtrid.
  17. */
  18. final static int MAXGTRIDSIZE = 64;
  19. /**
  20. * Maximum number of bytes returned by getBqual.
  21. */
  22. final static int MAXBQUALSIZE = 64;
  23. /**
  24. * Obtain the format identifier part of the XID.
  25. *
  26. * @return Format identifier. O means the OSI CCR format.
  27. */
  28. int getFormatId();
  29. /**
  30. * Obtain the global transaction identifier part of XID as an array
  31. * of bytes.
  32. *
  33. * @return Global transaction identifier.
  34. */
  35. byte[] getGlobalTransactionId();
  36. /**
  37. * Obtain the transaction branch identifier part of XID as an array
  38. * of bytes.
  39. *
  40. * @return Global transaction identifier.
  41. */
  42. byte[] getBranchQualifier();
  43. }