Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Interceptors with multiple bindings
Signed-off-by: thadumi <th.theodor.th@gmail.com>
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...ceptor_bindings/interceptor_resolution/interceptors_with_multiple_bindings.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
//// | ||
******************************************************************* | ||
* Copyright (c) 2019 Eclipse Foundation | ||
* | ||
* This specification document is made available under the terms | ||
* of the Eclipse Foundation Specification License v1.0, which is | ||
* available at https://www.eclipse.org/legal/efsl.php. | ||
******************************************************************* | ||
//// | ||
|
||
[[interceptors_with_multiple_bindings]] | ||
== Interceptors with multiple bindings | ||
|
||
An interceptor class may specify multiple | ||
interceptor bindings. | ||
|
||
@Monitored @Logged @Interceptor | ||
@Priority(1100) | ||
|
||
public class MonitoringLoggingInterceptor \{ | ||
|
||
@AroundInvoke | ||
|
||
public Object aroundInvoke(InvocationContext | ||
context) | ||
|
||
throws Exception \{ ... } | ||
|
||
|
||
|
||
} | ||
|
||
This interceptor will be bound to all methods | ||
of this component: | ||
|
||
@Monitored @Logged | ||
|
||
public class ShoppingCart \{ ... } | ||
|
||
The MonitoringLoggingInterceptor will not be | ||
bound to methods of this component, since the Logged interceptor binding | ||
does not appear: | ||
|
||
@Monitored | ||
|
||
public class ShoppingCart \{ | ||
|
||
|
||
|
||
public void placeOrder() \{ ... } | ||
|
||
|
||
|
||
} | ||
|
||
However, the MonitoringLoggingInterceptor | ||
will be bound to the placeOrder method of this component: | ||
|
||
@Monitored | ||
|
||
public class ShoppingCart \{ | ||
|
||
|
||
|
||
@Logged | ||
|
||
public void placeOrder() \{ ... } | ||
|
||
|
||
|
||
} | ||
|