Package org.codehaus.aspectwerkz.joinpoint

Examples of org.codehaus.aspectwerkz.joinpoint.MethodSignature


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


        /**
         * @Around fibs
         */
        public Object cache(final JoinPoint joinPoint) throws Throwable {
            MethodSignature signature = (MethodSignature)joinPoint.getSignature();
            Integer parameter = (Integer)signature.getParameterValues()[0];
            Integer cachedValue = (Integer)m_cache.get(parameter);
            if (cachedValue == null) {
                Object newValue = joinPoint.proceed(); // not found => calculate
                m_cache.put(parameter, newValue);
                return newValue;
View Full Code Here

    /**
     * @Before call(examples.caching.*->int examples.caching.Pi.getPiDecimal(int))
     */
    public void invocationCounter(final JoinPoint joinPoint) throws Throwable {
        MethodSignature signature = (MethodSignature)joinPoint.getSignature();
        CacheStatistics.addMethodInvocation(
                signature.getName(),
                signature.getParameterTypes()
        );
    }
View Full Code Here

    /**
     * @Around execution(int examples.caching.Pi.getPiDecimal(int))
     */
    public Object cache(final JoinPoint joinPoint) throws Throwable {
        MethodSignature signature = (MethodSignature)joinPoint.getSignature();

        final Long hash = new Long(calculateHash(signature));
        final Object cachedResult = m_cache.get(hash);

        if (cachedResult != null) {
            System.out.println("using cache");
            CacheStatistics.addCacheInvocation(signature.getName(), signature.getParameterTypes());
            System.out.println("parameter: timeout = " + ___AW_getParameter("timeout"));
            return cachedResult;
        }
        final Object result = joinPoint.proceed();

View Full Code Here

    /**
     * @Around fibs
     */
    public Object cache(final JoinPoint joinPoint) throws Throwable {
        System.out.println("FibonacciCacheAspect.cache");
        MethodSignature signature = (MethodSignature)joinPoint.getSignature();
        Integer parameter = (Integer)signature.getParameterValues()[0];
        Integer cachedValue = (Integer)m_cache.get(parameter);
        if (cachedValue == null) {
            Object newValue = joinPoint.proceed(); // not found => calculate
            m_cache.put(parameter, newValue);
            return newValue;
View Full Code Here

    /**
     * @Before call(int examples.caching.Pi.getPiDecimal(int)) && withincode(int
     * examples.caching.main(String[]))
     */
    public void invocationCounter(final JoinPoint joinPoint) throws Throwable {
        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
        CacheStatistics.addMethodInvocation(signature.getName(), signature.getParameterTypes());
    }
View Full Code Here

    /**
     * @Before call(int examples.caching.Pi.getPiDecimal(int)) && withincode(int examples.caching.main(String[]))
     */
    public void invocationCounter(final JoinPoint joinPoint) throws Throwable {
        MethodSignature signature = (MethodSignature)joinPoint.getSignature();
        CacheStatistics.addMethodInvocation(
                signature.getName(),
                signature.getParameterTypes()
        );
    }
View Full Code Here

    /**
     * @Before call(int examples.caching.Pi.getPiDecimal(int)) && withincode(int
     *         examples.caching.main(String[]))
     */
    public void invocationCounter(final JoinPoint joinPoint) throws Throwable {
        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
        CacheStatistics.addMethodInvocation(signature.getName(), signature.getParameterTypes());
    }
View Full Code Here

TOP

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

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.