Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 58   Methods: 1
NCLOC: 39   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
NotificationInterceptor.java - 100% 100% 100%
coverage
 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    * The interceptor in charge of firing off notifications to cache listeners
 9    *
 10    * @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
 11    * @since 2.0.0
 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    // do nothing
 29    }
 30   
 31    // should only kick in as a call returns.
 32  3675652 Object retval = super.invoke(ctx);
 33   
 34    // only invoke on commit.
 35  3675501 switch (call.getMethodId())
 36    {
 37  1121353 case MethodDeclarations.commitMethod_id:
 38    // notify commit
 39    // ctx.is
 40  1121353 cache.getNotifier().notifyTransactionCompleted(ctx.getTransaction(), true, ctx);
 41  1121352 break;
 42  315 case MethodDeclarations.rollbackMethod_id:
 43    // notify rollback
 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    // do nothing;
 54    }
 55   
 56  3675499 return retval;
 57    }
 58    }