Package org.codehaus.aspectwerkz.joinpoint

Examples of org.codehaus.aspectwerkz.joinpoint.MethodRtti


    /**
     * @Around pc10
     */
    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() +
                joinPoint.getTargetInstance().hashCode() +
                rtti.getParameterValues()[0] +
                rtti.getParameterTypes()[0].getName() +
                rtti.getReturnType().getName() +
                rtti.getReturnValue();
        return metadata;
    }
View Full Code Here


 

    public void method1Advise(JoinPoint joinPoint) {

      MethodRtti rtti = (MethodRtti)joinPoint.getRtti();

      LOG.append("call ");

    }
View Full Code Here

     */

    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;

View Full Code Here

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

    /**
     * @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

    /**
     * @Around pc10
     */
    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() +
                joinPoint.getTargetInstance().hashCode() +
                rtti.getParameterValues()[0] +
                rtti.getParameterTypes()[0].getName() +
                rtti.getReturnType().getName() +
                rtti.getReturnValue();
        return metadata;
    }
View Full Code Here

    /**
     * @Around 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 execution(int *..Fibonacci.fib(int))
         */
        public Object cache(final JoinPoint joinPoint) throws Throwable {
            MethodRtti rtti = (MethodRtti)joinPoint.getRtti();
            Integer parameter = (Integer)rtti.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

    /**
     * @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();

View Full Code Here

    /**
     * @Around member_pc10
     */
    public Object advice4(JoinPoint joinPoint) throws Throwable {
        final Object result = joinPoint.proceed();
        MethodRtti rtti = (MethodRtti) joinPoint.getRtti();
        String metadata = joinPoint.getTargetClass().getName()
            + rtti.getMethod().getName()
            + joinPoint.getTarget().hashCode()
            + rtti.getParameterValues()[0]
            + rtti.getParameterTypes()[0].getName()
            + rtti.getReturnType().getName()
            + rtti.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.