Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 50   Methods: 2
NCLOC: 27   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
CheckIdInterceptor.java 50% 85.7% 100% 81.8%
coverage coverage
 1    /*
 2    * JBoss, Home of Professional Open Source
 3    *
 4    * Distributable under LGPL license.
 5    * See terms of license at gnu.org.
 6    */
 7   
 8    package org.jboss.cache.pojo.interceptors;
 9   
 10    import org.jboss.aop.joinpoint.Invocation;
 11    import org.jboss.aop.joinpoint.MethodInvocation;
 12    import org.jboss.cache.Fqn;
 13   
 14    /**
 15    * Interceptor (done via aop advice) to check the validity of the id specified by the user.
 16    *
 17    * @version $Id: CheckIdInterceptor.java,v 1.2 2007/05/23 10:28:56 msurtani Exp $
 18    */
 19    public class CheckIdInterceptor extends AbstractInterceptor
 20    {
 21  25842 public Object invoke(Invocation in) throws Throwable
 22    {
 23  25842 if (!(in instanceof MethodInvocation))
 24    {
 25  0 throw new IllegalArgumentException("CheckIdInterceptor.invoke(): invocation not MethodInvocation");
 26    }
 27   
 28  25842 MethodInvocation invocation = (MethodInvocation) in;
 29  25842 invocation.getAdvisor();
 30  25842 try
 31    {
 32  25842 checkFqnValidity((Fqn) invocation.getArguments()[0]);
 33  25842 return invocation.invokeNext(); // proceed to next advice or actual call
 34    }
 35    finally
 36    {
 37    }
 38    }
 39   
 40   
 41  25842 private static void checkFqnValidity(Fqn id)
 42    {
 43    // throws exception is fqn is JBossInternal
 44    // if (id.hasElement(InternalConstant.JBOSS_INTERNAL_STRING))
 45    // {
 46    // throw new IllegalArgumentException("CheckIdIntercepto.checkFqnValidity(): fqn is not valid: " + id);
 47    // }
 48    }
 49    }
 50