@@ -58,7 +58,7 @@ The following example shows a simple `MethodInterceptor` implementation:
58
58
======
59
59
Java::
60
60
+
61
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
61
+ [source,java,indent=0,subs="verbatim,quotes"]
62
62
----
63
63
public class DebugInterceptor implements MethodInterceptor {
64
64
73
73
74
74
Kotlin::
75
75
+
76
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
76
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
77
77
----
78
78
class DebugInterceptor : MethodInterceptor {
79
79
@@ -139,7 +139,7 @@ The following example shows a before advice in Spring, which counts all method i
139
139
======
140
140
Java::
141
141
+
142
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
142
+ [source,java,indent=0,subs="verbatim,quotes"]
143
143
----
144
144
public class CountingBeforeAdvice implements MethodBeforeAdvice {
145
145
@@ -157,7 +157,7 @@ Java::
157
157
158
158
Kotlin::
159
159
+
160
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
160
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
161
161
----
162
162
class CountingBeforeAdvice : MethodBeforeAdvice {
163
163
@@ -197,7 +197,7 @@ The following advice is invoked if a `RemoteException` is thrown (including from
197
197
======
198
198
Java::
199
199
+
200
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
200
+ [source,java,indent=0,subs="verbatim,quotes"]
201
201
----
202
202
public class RemoteThrowsAdvice implements ThrowsAdvice {
203
203
@@ -209,7 +209,7 @@ Java::
209
209
210
210
Kotlin::
211
211
+
212
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
212
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
213
213
----
214
214
class RemoteThrowsAdvice : ThrowsAdvice {
215
215
@@ -228,7 +228,7 @@ arguments, and target object. The following advice is invoked if a `ServletExcep
228
228
======
229
229
Java::
230
230
+
231
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
231
+ [source,java,indent=0,subs="verbatim,quotes"]
232
232
----
233
233
public class ServletThrowsAdviceWithArguments implements ThrowsAdvice {
234
234
@@ -240,7 +240,7 @@ Java::
240
240
241
241
Kotlin::
242
242
+
243
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
243
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
244
244
----
245
245
class ServletThrowsAdviceWithArguments : ThrowsAdvice {
246
246
@@ -259,7 +259,7 @@ methods can be combined in a single class. The following listing shows the final
259
259
======
260
260
Java::
261
261
+
262
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
262
+ [source,java,indent=0,subs="verbatim,quotes"]
263
263
----
264
264
public static class CombinedThrowsAdvice implements ThrowsAdvice {
265
265
@@ -275,7 +275,7 @@ Java::
275
275
276
276
Kotlin::
277
277
+
278
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
278
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
279
279
----
280
280
class CombinedThrowsAdvice : ThrowsAdvice {
281
281
@@ -326,7 +326,7 @@ not thrown exceptions:
326
326
======
327
327
Java::
328
328
+
329
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
329
+ [source,java,indent=0,subs="verbatim,quotes"]
330
330
----
331
331
public class CountingAfterReturningAdvice implements AfterReturningAdvice {
332
332
@@ -345,7 +345,7 @@ Java::
345
345
346
346
Kotlin::
347
347
+
348
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
348
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
349
349
----
350
350
class CountingAfterReturningAdvice : AfterReturningAdvice {
351
351
@@ -420,7 +420,7 @@ introduce the following interface to one or more objects:
420
420
======
421
421
Java::
422
422
+
423
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
423
+ [source,java,indent=0,subs="verbatim,quotes"]
424
424
----
425
425
public interface Lockable {
426
426
void lock();
@@ -431,7 +431,7 @@ Java::
431
431
432
432
Kotlin::
433
433
+
434
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
434
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
435
435
----
436
436
interface Lockable {
437
437
fun lock()
@@ -480,7 +480,7 @@ The following example shows the example `LockMixin` class:
480
480
======
481
481
Java::
482
482
+
483
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
483
+ [source,java,indent=0,subs="verbatim,quotes"]
484
484
----
485
485
public class LockMixin extends DelegatingIntroductionInterceptor implements Lockable {
486
486
@@ -510,7 +510,7 @@ Java::
510
510
511
511
Kotlin::
512
512
+
513
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
513
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
514
514
----
515
515
class LockMixin : DelegatingIntroductionInterceptor(), Lockable {
516
516
@@ -556,7 +556,7 @@ The following example shows our `LockMixinAdvisor` class:
556
556
======
557
557
Java::
558
558
+
559
- [source,java,indent=0,subs="verbatim,quotes",role="primary" ]
559
+ [source,java,indent=0,subs="verbatim,quotes"]
560
560
----
561
561
public class LockMixinAdvisor extends DefaultIntroductionAdvisor {
562
562
@@ -568,7 +568,7 @@ Java::
568
568
569
569
Kotlin::
570
570
+
571
- [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary" ]
571
+ [source,kotlin,indent=0,subs="verbatim,quotes"]
572
572
----
573
573
class LockMixinAdvisor : DefaultIntroductionAdvisor(LockMixin(), Lockable::class.java)
574
574
----
0 commit comments