1 |
| package org.jboss.cache.interceptors; |
2 |
| |
3 |
| import org.jboss.cache.InvocationContext; |
4 |
| import org.jboss.cache.marshall.MethodCall; |
5 |
| import org.jboss.cache.marshall.MethodDeclarations; |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| public class NotificationInterceptor extends BaseTransactionalContextInterceptor |
14 |
| { |
15 |
3675652
| public Object invoke(InvocationContext ctx) throws Throwable
|
16 |
| { |
17 |
3675652
| MethodCall call = ctx.getMethodCall();
|
18 |
| |
19 |
3675652
| switch (call.getMethodId())
|
20 |
| { |
21 |
2938
| case MethodDeclarations.blockChannelMethodLocal_id:
|
22 |
2938
| cache.getNotifier().notifyCacheBlocked(cache, true);
|
23 |
2938
| break;
|
24 |
2589
| case MethodDeclarations.unblockChannelMethodLocal_id:
|
25 |
2589
| cache.getNotifier().notifyCacheUnblocked(cache, true);
|
26 |
2589
| break;
|
27 |
3670125
| default:
|
28 |
| |
29 |
| } |
30 |
| |
31 |
| |
32 |
3675652
| Object retval = super.invoke(ctx);
|
33 |
| |
34 |
| |
35 |
3675501
| switch (call.getMethodId())
|
36 |
| { |
37 |
1121353
| case MethodDeclarations.commitMethod_id:
|
38 |
| |
39 |
| |
40 |
1121353
| cache.getNotifier().notifyTransactionCompleted(ctx.getTransaction(), true, ctx);
|
41 |
1121352
| break;
|
42 |
315
| case MethodDeclarations.rollbackMethod_id:
|
43 |
| |
44 |
315
| cache.getNotifier().notifyTransactionCompleted(ctx.getTransaction(), false, ctx);
|
45 |
314
| break;
|
46 |
2938
| case MethodDeclarations.blockChannelMethodLocal_id:
|
47 |
2938
| cache.getNotifier().notifyCacheBlocked(cache, false);
|
48 |
2938
| break;
|
49 |
2589
| case MethodDeclarations.unblockChannelMethodLocal_id:
|
50 |
2589
| cache.getNotifier().notifyCacheUnblocked(cache, false);
|
51 |
2589
| break;
|
52 |
2548306
| default:
|
53 |
| |
54 |
| } |
55 |
| |
56 |
3675499
| return retval;
|
57 |
| } |
58 |
| } |