|
9 | 9 | * @author Radim Vansa <rvansa@redhat.com> |
10 | 10 | */ |
11 | 11 | public interface AccessDelegate { |
12 | | - Object get(Object session, Object key, long txTimestamp) throws CacheException; |
| 12 | + Object get(Object session, Object key, long txTimestamp) throws CacheException; |
13 | 13 |
|
14 | | - /** |
15 | | - * Attempt to cache an object, after loading from the database. |
16 | | - * |
17 | | - * @param session Current session |
18 | | - * @param key The item key |
19 | | - * @param value The item |
20 | | - * @param txTimestamp a timestamp prior to the transaction start time |
21 | | - * @param version the item version number |
22 | | - * @return <code>true</code> if the object was successfully cached |
23 | | - */ |
24 | | - boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version); |
| 14 | + /** |
| 15 | + * Attempt to cache an object, after loading from the database. |
| 16 | + * |
| 17 | + * @param session Current session |
| 18 | + * @param key The item key |
| 19 | + * @param value The item |
| 20 | + * @param txTimestamp a timestamp prior to the transaction start time |
| 21 | + * @param version the item version number |
| 22 | + * @return <code>true</code> if the object was successfully cached |
| 23 | + */ |
| 24 | + boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version); |
25 | 25 |
|
26 | | - /** |
27 | | - * Attempt to cache an object, after loading from the database, explicitly |
28 | | - * specifying the minimalPut behavior. |
29 | | - * |
30 | | - * @param session Current session. |
31 | | - * @param key The item key |
32 | | - * @param value The item |
33 | | - * @param txTimestamp a timestamp prior to the transaction start time |
34 | | - * @param version the item version number |
35 | | - * @param minimalPutOverride Explicit minimalPut flag |
36 | | - * @return <code>true</code> if the object was successfully cached |
37 | | - * @throws org.hibernate.cache.CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region} |
38 | | - */ |
39 | | - boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) |
40 | | - throws CacheException; |
| 26 | + /** |
| 27 | + * Attempt to cache an object, after loading from the database, explicitly |
| 28 | + * specifying the minimalPut behavior. |
| 29 | + * |
| 30 | + * @param session Current session. |
| 31 | + * @param key The item key |
| 32 | + * @param value The item |
| 33 | + * @param txTimestamp a timestamp prior to the transaction start time |
| 34 | + * @param version the item version number |
| 35 | + * @param minimalPutOverride Explicit minimalPut flag |
| 36 | + * @return <code>true</code> if the object was successfully cached |
| 37 | + * @throws org.hibernate.cache.CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region} |
| 38 | + */ |
| 39 | + boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) |
| 40 | + throws CacheException; |
41 | 41 |
|
42 | | - /** |
43 | | - * Called after an item has been inserted (before the transaction completes), |
44 | | - * instead of calling evict(). |
45 | | - * |
46 | | - * @param session Current session |
47 | | - * @param key The item key |
48 | | - * @param value The item |
49 | | - * @param version The item's version value |
50 | | - * @return Were the contents of the cache actual changed by this operation? |
51 | | - * @throws CacheException if the insert fails |
52 | | - */ |
53 | | - boolean insert(Object session, Object key, Object value, Object version) throws CacheException; |
| 42 | + /** |
| 43 | + * Called after an item has been inserted (before the transaction completes), |
| 44 | + * instead of calling evict(). |
| 45 | + * |
| 46 | + * @param session Current session |
| 47 | + * @param key The item key |
| 48 | + * @param value The item |
| 49 | + * @param version The item's version value |
| 50 | + * @return Were the contents of the cache actual changed by this operation? |
| 51 | + * @throws CacheException if the insert fails |
| 52 | + */ |
| 53 | + boolean insert(Object session, Object key, Object value, Object version) throws CacheException; |
54 | 54 |
|
55 | | - /** |
56 | | - * Called after an item has been updated (before the transaction completes), |
57 | | - * instead of calling evict(). |
58 | | - * |
59 | | - * @param session Current session |
60 | | - * @param key The item key |
61 | | - * @param value The item |
62 | | - * @param currentVersion The item's current version value |
63 | | - * @param previousVersion The item's previous version value |
64 | | - * @return Whether the contents of the cache actual changed by this operation |
65 | | - * @throws CacheException if the update fails |
66 | | - */ |
67 | | - boolean update(Object session, Object key, Object value, Object currentVersion, Object previousVersion) |
68 | | - throws CacheException; |
| 55 | + /** |
| 56 | + * Called after an item has been updated (before the transaction completes), |
| 57 | + * instead of calling evict(). |
| 58 | + * |
| 59 | + * @param session Current session |
| 60 | + * @param key The item key |
| 61 | + * @param value The item |
| 62 | + * @param currentVersion The item's current version value |
| 63 | + * @param previousVersion The item's previous version value |
| 64 | + * @return Whether the contents of the cache actual changed by this operation |
| 65 | + * @throws CacheException if the update fails |
| 66 | + */ |
| 67 | + boolean update(Object session, Object key, Object value, Object currentVersion, Object previousVersion) |
| 68 | + throws CacheException; |
69 | 69 |
|
70 | | - /** |
71 | | - * Called after an item has become stale (before the transaction completes). |
72 | | - * |
73 | | - * @param session Current session |
74 | | - * @param key The key of the item to remove |
75 | | - * @throws CacheException if removing the cached item fails |
76 | | - */ |
77 | | - void remove(Object session, Object key) throws CacheException; |
| 70 | + /** |
| 71 | + * Called after an item has become stale (before the transaction completes). |
| 72 | + * |
| 73 | + * @param session Current session |
| 74 | + * @param key The key of the item to remove |
| 75 | + * @throws CacheException if removing the cached item fails |
| 76 | + */ |
| 77 | + void remove(Object session, Object key) throws CacheException; |
78 | 78 |
|
79 | | - /** |
80 | | - * Called just before the delegate will have all entries removed. Any work to prevent concurrent modifications |
81 | | - * while this occurs should happen here |
82 | | - * @throws CacheException if locking had an issue |
83 | | - */ |
84 | | - void lockAll() throws CacheException; |
| 79 | + /** |
| 80 | + * Called just before the delegate will have all entries removed. Any work to prevent concurrent modifications |
| 81 | + * while this occurs should happen here |
| 82 | + * |
| 83 | + * @throws CacheException if locking had an issue |
| 84 | + */ |
| 85 | + void lockAll() throws CacheException; |
85 | 86 |
|
86 | | - /** |
87 | | - * Called just after the delegate had all entries removed via {@link #removeAll()}. Any work required to allow |
88 | | - * for new modifications to happen should be done here |
89 | | - * @throws CacheException if unlocking had an issue |
90 | | - */ |
91 | | - void unlockAll() throws CacheException; |
| 87 | + /** |
| 88 | + * Called just after the delegate had all entries removed via {@link #removeAll()}. Any work required to allow |
| 89 | + * for new modifications to happen should be done here |
| 90 | + * |
| 91 | + * @throws CacheException if unlocking had an issue |
| 92 | + */ |
| 93 | + void unlockAll() throws CacheException; |
92 | 94 |
|
93 | | - /** |
94 | | - * Called to evict data from the entire region |
95 | | - * |
96 | | - * @throws CacheException if eviction the region fails |
97 | | - */ |
98 | | - void removeAll() throws CacheException; |
| 95 | + /** |
| 96 | + * Called to evict data from the entire region |
| 97 | + * |
| 98 | + * @throws CacheException if eviction the region fails |
| 99 | + */ |
| 100 | + void removeAll() throws CacheException; |
99 | 101 |
|
100 | | - /** |
101 | | - * Forcibly evict an item from the cache immediately without regard for transaction |
102 | | - * isolation. |
103 | | - * |
104 | | - * @param key The key of the item to remove |
105 | | - * @throws CacheException if evicting the item fails |
106 | | - */ |
107 | | - void evict(Object key) throws CacheException; |
| 102 | + /** |
| 103 | + * Forcibly evict an item from the cache immediately without regard for transaction |
| 104 | + * isolation. |
| 105 | + * |
| 106 | + * @param key The key of the item to remove |
| 107 | + * @throws CacheException if evicting the item fails |
| 108 | + */ |
| 109 | + void evict(Object key) throws CacheException; |
108 | 110 |
|
109 | | - /** |
110 | | - * Forcibly evict all items from the cache immediately without regard for transaction |
111 | | - * isolation. |
112 | | - * |
113 | | - * @throws CacheException if evicting items fails |
114 | | - */ |
115 | | - void evictAll() throws CacheException; |
| 111 | + /** |
| 112 | + * Forcibly evict all items from the cache immediately without regard for transaction |
| 113 | + * isolation. |
| 114 | + * |
| 115 | + * @throws CacheException if evicting items fails |
| 116 | + */ |
| 117 | + void evictAll() throws CacheException; |
116 | 118 |
|
117 | | - /** |
118 | | - * Called when we have finished the attempted update/delete (which may or |
119 | | - * may not have been successful), after transaction completion. This method |
120 | | - * is used by "asynchronous" concurrency strategies. |
121 | | - * |
122 | | - * |
123 | | - * @param session |
124 | | - * @param key The item key |
125 | | - * @throws org.hibernate.cache.CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region} |
126 | | - */ |
127 | | - void unlockItem(Object session, Object key) throws CacheException; |
| 119 | + /** |
| 120 | + * Called when we have finished the attempted update/delete (which may or |
| 121 | + * may not have been successful), after transaction completion. This method |
| 122 | + * is used by "asynchronous" concurrency strategies. |
| 123 | + * |
| 124 | + * @param session |
| 125 | + * @param key The item key |
| 126 | + * @throws org.hibernate.cache.CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region} |
| 127 | + */ |
| 128 | + void unlockItem(Object session, Object key) throws CacheException; |
128 | 129 |
|
129 | | - /** |
130 | | - * Called after an item has been inserted (after the transaction completes), |
131 | | - * instead of calling release(). |
132 | | - * This method is used by "asynchronous" concurrency strategies. |
133 | | - * |
134 | | - * |
135 | | - * @param session |
136 | | - * @param key The item key |
137 | | - * @param value The item |
138 | | - * @param version The item's version value |
139 | | - * @return Were the contents of the cache actual changed by this operation? |
140 | | - * @throws CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region} |
141 | | - */ |
142 | | - boolean afterInsert(Object session, Object key, Object value, Object version); |
| 130 | + /** |
| 131 | + * Called after an item has been inserted (after the transaction completes), |
| 132 | + * instead of calling release(). |
| 133 | + * This method is used by "asynchronous" concurrency strategies. |
| 134 | + * |
| 135 | + * @param session |
| 136 | + * @param key The item key |
| 137 | + * @param value The item |
| 138 | + * @param version The item's version value |
| 139 | + * @return Were the contents of the cache actual changed by this operation? |
| 140 | + * @throws CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region} |
| 141 | + */ |
| 142 | + boolean afterInsert(Object session, Object key, Object value, Object version); |
143 | 143 |
|
144 | | - /** |
145 | | - * Called after an item has been updated (after the transaction completes), |
146 | | - * instead of calling release(). This method is used by "asynchronous" |
147 | | - * concurrency strategies. |
148 | | - * |
149 | | - * |
150 | | - * @param session |
151 | | - * @param key The item key |
152 | | - * @param value The item |
153 | | - * @param currentVersion The item's current version value |
154 | | - * @param previousVersion The item's previous version value |
155 | | - * @param lock The lock |
156 | | - * @return Were the contents of the cache actual changed by this operation? |
157 | | - * @throws CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region} |
158 | | - */ |
159 | | - boolean afterUpdate(Object session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock); |
| 144 | + /** |
| 145 | + * Called after an item has been updated (after the transaction completes), |
| 146 | + * instead of calling release(). This method is used by "asynchronous" |
| 147 | + * concurrency strategies. |
| 148 | + * |
| 149 | + * @param session |
| 150 | + * @param key The item key |
| 151 | + * @param value The item |
| 152 | + * @param currentVersion The item's current version value |
| 153 | + * @param previousVersion The item's previous version value |
| 154 | + * @param lock The lock |
| 155 | + * @return Were the contents of the cache actual changed by this operation? |
| 156 | + * @throws CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region} |
| 157 | + */ |
| 158 | + boolean afterUpdate(Object session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock); |
160 | 159 | } |
0 commit comments