Package org.codehaus.aspectwerkz.joinpoint

Examples of org.codehaus.aspectwerkz.joinpoint.MethodJoinPoint


         * @Around interceptServlet
         */
        public Object catchGetRequestParameters(JoinPoint joinPoint)
            throws Throwable
        {
            MethodJoinPoint jp = (MethodJoinPoint) joinPoint;
            SampleServlet servlet = (SampleServlet) jp.getTargetInstance();
            Hashtable params = servlet.getRequestParameters(
                (HttpServletRequest) jp.getParameters()[0]);
            assertNotNull(params.get("param1"));
            assertNotNull(params.get("param2"));
            assertEquals("value1", params.get("param1"));
            assertEquals("value2", params.get("param2"));
            return null;
View Full Code Here


public class DynamicallyCreatedTransientAdvice extends AroundAdvice {
    public DynamicallyCreatedTransientAdvice() {
        super();
    }
    public Object execute(final JoinPoint joinPoint) throws Throwable {
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        ((Loggable)jp.getTargetInstance()).log("before ");
        final Object result = joinPoint.proceed();
        ((Loggable)jp.getTargetInstance()).log("after ");
        return result;
    }
View Full Code Here

    public CFlowLoggingAdvice() {
        super();
    }

    public Object execute(final JoinPoint joinPoint) throws Throwable {
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        ((Loggable)jp.getTargetInstance()).log("advice-before ");
        final Object result = joinPoint.proceed();
        ((Loggable)jp.getTargetInstance()).log("advice-after ");
        return result;
    }
View Full Code Here

    public MyStaticMethodAdvice2() {
        super();
    }

    public Object execute(final JoinPoint joinPoint) throws Throwable {
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        ((StaticMethodAdviceTest)jp.getTargetInstance()).log("before1 ");
        final Object result = joinPoint.proceed();
        ((StaticMethodAdviceTest)jp.getTargetInstance()).log("after1 ");
        return result;
    }
View Full Code Here

    public MyMemberMethodAdvice5() {
        super();
    }

    public Object execute(final JoinPoint joinPoint) throws Throwable {
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        ((Loggable)jp.getTargetInstance()).log("before ");
        final Object result = joinPoint.proceedInNewThread();
        ((Loggable)jp.getTargetInstance()).log("after ");
        return result;
    }
View Full Code Here

        super();
    }

    public Object execute(final JoinPoint joinPoint) throws Throwable {
        final Object result = joinPoint.proceed();
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        String metadata =
                jp.getTargetClass().getName() +
                jp.getMethod().getName() +
                jp.getParameters()[0] +
                jp.getParameterTypes()[0].getName() +
                jp.getReturnType().getName() +
                jp.getResult();
        return metadata;
    }
View Full Code Here

    public DynamicallyCreatedPersistentAdvice() {
        super();
    }
    public Object execute(final JoinPoint joinPoint) throws Throwable {
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        m_counter++;
        ((Loggable)jp.getTargetInstance()).log(new Integer(m_counter).toString());
        return joinPoint.proceed();
    }
View Full Code Here

    public MyMemberMethodAdvice7() {
        super();
    }

    public Object execute(final JoinPoint joinPoint) throws Throwable {
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        ((Loggable)jp.getTargetInstance()).log("# ");
        return joinPoint.proceed();
    }
View Full Code Here

    public MyStaticMethodAdvice3() {
        super();
    }

    public Object execute(final JoinPoint joinPoint) throws Throwable {
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        ((StaticMethodAdviceTest)jp.getTargetInstance()).log("before2 ");
        final Object result = joinPoint.proceed();
        ((StaticMethodAdviceTest)jp.getTargetInstance()).log("after2 ");
        return result;
    }
View Full Code Here

    /**
     * @Around pc1 && pc2
     */
    public Object execute(final JoinPoint joinPoint) throws Throwable {
        MethodJoinPoint jp = (MethodJoinPoint)joinPoint;
        ((Loggable)jp.getTargetInstance()).log("advice-before ");
        final Object result = joinPoint.proceed();
        ((Loggable)jp.getTargetInstance()).log("advice-after ");
        return result;
    }
View Full Code Here

TOP

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

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.