|
76 | 76 | * |
77 | 77 | * @author Scott Marlow |
78 | 78 | */ |
79 | | -@Deprecated(since = "7.0", forRemoval = true) // moving to an SPI package |
| 79 | +@Deprecated(since = "7", forRemoval = true) // moving to an SPI package |
80 | 80 | public class LockOptions implements Serializable { |
81 | | - /** |
82 | | - * Represents {@link LockMode#NONE}, to which timeout and scope are |
83 | | - * not applicable. |
84 | | - */ |
85 | | - public static final LockOptions NONE = new LockOptions( true, LockMode.NONE ); |
86 | | - |
87 | | - /** |
88 | | - * Represents {@link LockMode#READ}, to which timeout and scope are |
89 | | - * not applicable. |
90 | | - */ |
91 | | - public static final LockOptions READ = new LockOptions( true, LockMode.READ ); |
92 | | - |
93 | | - /** |
94 | | - * Represents {@link LockMode#OPTIMISTIC}. |
95 | | - */ |
96 | | - static final LockOptions OPTIMISTIC = new LockOptions( true, LockMode.OPTIMISTIC ); |
97 | | - |
98 | | - /** |
99 | | - * Represents {@link LockMode#OPTIMISTIC_FORCE_INCREMENT}, to which |
100 | | - * timeout and scope are not applicable. |
101 | | - */ |
102 | | - static final LockOptions OPTIMISTIC_FORCE_INCREMENT = new LockOptions( true, LockMode.OPTIMISTIC_FORCE_INCREMENT ); |
103 | | - |
104 | | - /** |
105 | | - * Represents {@link LockMode#PESSIMISTIC_READ}. |
106 | | - */ |
107 | | - static final LockOptions PESSIMISTIC_READ = new LockOptions( true, LockMode.PESSIMISTIC_READ ); |
108 | | - |
109 | | - /** |
110 | | - * Represents {@link LockMode#PESSIMISTIC_WRITE}. |
111 | | - */ |
112 | | - static final LockOptions PESSIMISTIC_WRITE = new LockOptions( true, LockMode.PESSIMISTIC_WRITE ); |
113 | | - |
114 | | - /** |
115 | | - * Represents {@link LockMode#PESSIMISTIC_FORCE_INCREMENT}. |
116 | | - */ |
117 | | - static final LockOptions PESSIMISTIC_FORCE_INCREMENT = new LockOptions( true, LockMode.PESSIMISTIC_FORCE_INCREMENT ); |
118 | | - |
119 | | - /** |
120 | | - * Represents {@link LockMode#UPGRADE_NOWAIT}. |
121 | | - */ |
122 | | - static final LockOptions UPGRADE_NOWAIT = new LockOptions( true, LockMode.UPGRADE_NOWAIT ); |
123 | | - |
124 | | - /** |
125 | | - * Represents {@link LockMode#UPGRADE_SKIPLOCKED}. |
126 | | - */ |
127 | | - static final LockOptions UPGRADE_SKIPLOCKED = new LockOptions( true, LockMode.UPGRADE_SKIPLOCKED ); |
128 | | - |
129 | | - /** |
130 | | - * Represents {@link LockMode#PESSIMISTIC_WRITE} with |
131 | | - * {@linkplain #WAIT_FOREVER no timeout}, and |
132 | | - * {@linkplain PessimisticLockScope#NORMAL no extension of the |
133 | | - * lock to owned collections}. |
134 | | - */ |
135 | | - public static final LockOptions UPGRADE = PESSIMISTIC_WRITE; |
136 | | - |
137 | | - /** |
138 | | - * @see Timeouts#NO_WAIT_MILLI |
139 | | - * @see Timeouts#NO_WAIT |
140 | | - * @see #getTimeOut |
141 | | - */ |
142 | | - public static final int NO_WAIT = Timeouts.NO_WAIT_MILLI; |
143 | | - |
144 | | - /** |
145 | | - * @see Timeouts#WAIT_FOREVER_MILLI |
146 | | - * @see Timeouts#WAIT_FOREVER |
147 | | - * @see #getTimeOut |
148 | | - */ |
149 | | - public static final int WAIT_FOREVER = Timeouts.WAIT_FOREVER_MILLI; |
150 | | - |
151 | | - /** |
152 | | - * @see Timeouts#SKIP_LOCKED_MILLI |
153 | | - * @see Timeouts#SKIP_LOCKED |
154 | | - * @see #getTimeOut() |
155 | | - * @deprecated use {@link LockMode#UPGRADE_SKIPLOCKED} |
156 | | - */ |
157 | | - @Deprecated(since = "6.2", forRemoval = true) |
158 | | - public static final int SKIP_LOCKED = -2; |
159 | 81 |
|
160 | 82 | private final boolean immutable; |
161 | 83 | private LockMode lockMode; |
@@ -662,4 +584,121 @@ public LockMode findGreatestLockMode() { |
662 | 584 |
|
663 | 585 | return lockModeToUse; |
664 | 586 | } |
| 587 | + |
| 588 | + |
| 589 | + /** |
| 590 | + * Represents {@link LockMode#NONE}, to which timeout and scope are |
| 591 | + * not applicable. |
| 592 | + * |
| 593 | + * @deprecated This, and the other constants on this class, will be removed. |
| 594 | + */ |
| 595 | + @Deprecated(since = "7", forRemoval = true) |
| 596 | + public static final LockOptions NONE = new LockOptions( true, LockMode.NONE ); |
| 597 | + |
| 598 | + /** |
| 599 | + * Represents {@link LockMode#READ}, to which timeout and scope are |
| 600 | + * not applicable. |
| 601 | + * |
| 602 | + * @deprecated This, and the other constants on this class, will be removed. |
| 603 | + */ |
| 604 | + @Deprecated(since = "7", forRemoval = true) |
| 605 | + public static final LockOptions READ = new LockOptions( true, LockMode.READ ); |
| 606 | + |
| 607 | + /** |
| 608 | + * Represents {@link LockMode#OPTIMISTIC}. |
| 609 | + * |
| 610 | + * @deprecated This, and the other constants on this class, will be removed. |
| 611 | + */ |
| 612 | + @Deprecated(since = "7", forRemoval = true) |
| 613 | + static final LockOptions OPTIMISTIC = new LockOptions( true, LockMode.OPTIMISTIC ); |
| 614 | + |
| 615 | + /** |
| 616 | + * Represents {@link LockMode#OPTIMISTIC_FORCE_INCREMENT}, to which |
| 617 | + * timeout and scope are not applicable. |
| 618 | + * |
| 619 | + * @deprecated This, and the other constants on this class, will be removed. |
| 620 | + */ |
| 621 | + @Deprecated(since = "7", forRemoval = true) |
| 622 | + static final LockOptions OPTIMISTIC_FORCE_INCREMENT = new LockOptions( true, LockMode.OPTIMISTIC_FORCE_INCREMENT ); |
| 623 | + |
| 624 | + /** |
| 625 | + * Represents {@link LockMode#PESSIMISTIC_READ}. |
| 626 | + * |
| 627 | + * @deprecated This, and the other constants on this class, will be removed. |
| 628 | + */ |
| 629 | + @Deprecated(since = "7", forRemoval = true) |
| 630 | + static final LockOptions PESSIMISTIC_READ = new LockOptions( true, LockMode.PESSIMISTIC_READ ); |
| 631 | + |
| 632 | + /** |
| 633 | + * Represents {@link LockMode#PESSIMISTIC_WRITE}. |
| 634 | + * |
| 635 | + * @deprecated This, and the other constants on this class, will be removed. |
| 636 | + */ |
| 637 | + @Deprecated(since = "7", forRemoval = true) |
| 638 | + static final LockOptions PESSIMISTIC_WRITE = new LockOptions( true, LockMode.PESSIMISTIC_WRITE ); |
| 639 | + |
| 640 | + /** |
| 641 | + * Represents {@link LockMode#PESSIMISTIC_FORCE_INCREMENT}. |
| 642 | + * |
| 643 | + * @deprecated This, and the other constants on this class, will be removed. |
| 644 | + */ |
| 645 | + @Deprecated(since = "7", forRemoval = true) |
| 646 | + static final LockOptions PESSIMISTIC_FORCE_INCREMENT = new LockOptions( true, LockMode.PESSIMISTIC_FORCE_INCREMENT ); |
| 647 | + |
| 648 | + /** |
| 649 | + * Represents {@link LockMode#UPGRADE_NOWAIT}. |
| 650 | + * |
| 651 | + * @deprecated This, and the other constants on this class, will be removed. |
| 652 | + */ |
| 653 | + @Deprecated(since = "7", forRemoval = true) |
| 654 | + static final LockOptions UPGRADE_NOWAIT = new LockOptions( true, LockMode.UPGRADE_NOWAIT ); |
| 655 | + |
| 656 | + /** |
| 657 | + * Represents {@link LockMode#UPGRADE_SKIPLOCKED}. |
| 658 | + * |
| 659 | + * @deprecated This, and the other constants on this class, will be removed. |
| 660 | + */ |
| 661 | + @Deprecated(since = "7", forRemoval = true) |
| 662 | + static final LockOptions UPGRADE_SKIPLOCKED = new LockOptions( true, LockMode.UPGRADE_SKIPLOCKED ); |
| 663 | + |
| 664 | + /** |
| 665 | + * Represents {@link LockMode#PESSIMISTIC_WRITE} with |
| 666 | + * {@linkplain #WAIT_FOREVER no timeout}, and |
| 667 | + * {@linkplain PessimisticLockScope#NORMAL no extension of the |
| 668 | + * lock to owned collections}. |
| 669 | + * |
| 670 | + * @deprecated This, and the other constants on this class, will be removed. |
| 671 | + */ |
| 672 | + @Deprecated(since = "7", forRemoval = true) |
| 673 | + public static final LockOptions UPGRADE = PESSIMISTIC_WRITE; |
| 674 | + |
| 675 | + /** |
| 676 | + * @see Timeouts#NO_WAIT_MILLI |
| 677 | + * @see Timeouts#NO_WAIT |
| 678 | + * @see #getTimeOut |
| 679 | + * |
| 680 | + * @deprecated This, and the other constants on this class, will be removed. |
| 681 | + */ |
| 682 | + @Deprecated(since = "7", forRemoval = true) |
| 683 | + public static final int NO_WAIT = Timeouts.NO_WAIT_MILLI; |
| 684 | + |
| 685 | + /** |
| 686 | + * @see Timeouts#WAIT_FOREVER_MILLI |
| 687 | + * @see Timeouts#WAIT_FOREVER |
| 688 | + * @see #getTimeOut |
| 689 | + * |
| 690 | + * @deprecated This, and the other constants on this class, will be removed. |
| 691 | + */ |
| 692 | + @Deprecated(since = "7", forRemoval = true) |
| 693 | + public static final int WAIT_FOREVER = Timeouts.WAIT_FOREVER_MILLI; |
| 694 | + |
| 695 | + /** |
| 696 | + * @see Timeouts#SKIP_LOCKED_MILLI |
| 697 | + * @see Timeouts#SKIP_LOCKED |
| 698 | + * @see #getTimeOut() |
| 699 | + * |
| 700 | + * @deprecated This, and the other constants on this class, will be removed. |
| 701 | + */ |
| 702 | + @Deprecated(since = "6.2", forRemoval = true) |
| 703 | + public static final int SKIP_LOCKED = -2; |
665 | 704 | } |
0 commit comments