Package org.codehaus.aspectwerkz.joinpoint

Examples of org.codehaus.aspectwerkz.joinpoint.MethodRtti


    /**
     * @Around execution(int examples.caching.Pi.getPiDecimal(int))
     */
    public Object cache(final JoinPoint joinPoint) throws Throwable {
        MethodRtti rtti   = (MethodRtti) joinPoint.getRtti();
        final Long hash = new Long(calculateHash(rtti));
        final Object cachedResult = m_cache.get(hash);
        if (cachedResult != null) {
            System.out.println("using            cache");
            CacheStatistics.addCacheInvocation(rtti.getName(), rtti.getParameterTypes());
            System.out.println("parameter: timeout = " + m_info.getParameter("timeout"));
            return cachedResult;
        }
        final Object result = joinPoint.proceed();
        m_cache.put(hash, result);
View Full Code Here


     * Creates info for the method.
     *
     * @return the created method info
     */
    private static MethodInfo createMethodInfo(final JoinPoint joinPoint) {
        MethodRtti rtti = (MethodRtti) joinPoint.getRtti();
        Method method = rtti.getMethod();
        return JavaMethodInfo.getMethodInfo(method);
    }
View Full Code Here

    /**
     * @Around static_pc9
     */
    public Object advice4(final JoinPoint joinPoint) throws Throwable {
        final Object result = joinPoint.proceed();
        MethodRtti rtti = (MethodRtti)joinPoint.getRtti();
        String metadata = joinPoint.getTargetClass().getName() + rtti.getMethod().getName()
                          + rtti.getParameterValues()[0] + rtti.getParameterTypes()[0].getName()
                          + rtti.getReturnType().getName() + rtti.getReturnValue();
        return metadata;
    }
View Full Code Here

    /**
     * @Around member_pc10
     */
    public Object advice4(JoinPoint joinPoint) throws Throwable {
        final Object result = joinPoint.proceed();
        MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
        String metadata = joinPoint.getTargetClass().getName()
                          + mrtti.getMethod().getName()
                          + joinPoint.getTarget().hashCode()
                          + mrtti.getParameterValues()[0]
                          + mrtti.getParameterTypes()[0].getName()
                          + mrtti.getReturnType().getName()
                          + mrtti.getReturnValue();
        return metadata;
    }
View Full Code Here

    /**
     * @Around static_pc9
     */
    public Object advice4(final JoinPoint joinPoint) throws Throwable {
        final Object result = joinPoint.proceed();
        MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
        String metadata = joinPoint.getTargetClass().getName()
                          + mrtti.getMethod().getName()
                          + mrtti.getParameterValues()[0]
                          + mrtti.getParameterTypes()[0].getName()
                          + mrtti.getReturnType().getName()
                          + mrtti.getReturnValue();
        return metadata;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.joinpoint.MethodRtti

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.