Examples of MethodAdvice


Examples of org.apache.tapestry5.plastic.MethodAdvice

    public static MethodAdvice toPlasticMethodAdvice(final org.apache.tapestry5.ioc.MethodAdvice iocMethodAdvice,
                                                     final AnnotationProvider methodAnnotationProvider)
    {
        assert iocMethodAdvice != null;

        return new MethodAdvice()
        {
            public void advise(final MethodInvocation invocation)
            {
                org.apache.tapestry5.ioc.Invocation iocInvocation = new org.apache.tapestry5.ioc.Invocation()
                {
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

        if (methods.isEmpty())
        {
            return;
        }

        final MethodAdvice loggingAdvice = new LoggingAdvice(model.getLogger(), exceptionTracker);

        for (PlasticMethod method : methods)
        {
            method.addAdvice(loggingAdvice);
        }
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

            public void transform(PlasticClass plasticClass)
            {
                PlasticMethod delegateMethod = plasticClass.introducePrivateMethod(
                        PlasticUtils.toTypeName(serviceType), "delegate", null, null);

                delegateMethod.addAdvice(new MethodAdvice()
                {
                    public void advise(MethodInvocation invocation)
                    {
                        invocation.setReturnValue(environment.peekRequired(serviceType));
                    }
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

        this.exceptionTracker = exceptionTracker;
    }

    public <T> void addLoggingAdvice(Logger logger, MethodAdviceReceiver receiver)
    {
        MethodAdvice advice = new LoggingAdvice(logger, exceptionTracker);

        receiver.adviseAllMethods(advice);
    }
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

        final Class thunkType = method.getReturnType();

        final String description = String.format("<%s Thunk for %s>", thunkType.getName(),
                InternalUtils.asString(method));

        MethodAdvice advice = new MethodAdvice()
        {
            /**
             * When the method is invoked, we don't immediately proceed. Instead, we return a thunk instance
             * that defers its behavior to the lazily invoked invocation.
             */
 
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

    }

    @Override
    public void addLoggingAdvice(Logger logger, MethodAdviceReceiver receiver)
    {
        MethodAdvice advice = new LoggingAdvice(logger, exceptionTracker);

        receiver.adviseAllMethods(advice);
    }
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

    {

        if (componentReplacer.hasReplacements())
        {

            MethodAdvice advice = new MethodAdvice()
            {
                @Override
                public void advise(MethodInvocation invocation)
                {
                    String className = (String) invocation.getParameter(0);
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

    }

    @Order("after:Logging")
    public static void adviseGreeter(MethodAdviceReceiver receiver)
    {
        MethodAdvice advice = new MethodAdvice()
        {
            @Override
            public void advise(MethodInvocation invocation)
            {
                invocation.proceed();
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

        for (final PlasticMethod method : plasticClass
                .getMethodsWithAnnotation(CommitAfter.class))
        {
            PersistenceContext annotation = method.getAnnotation(PersistenceContext.class);

            MethodAdvice advice = annotation == null ? shared : new CommitAfterMethodAdvice(manager);

            method.addAdvice(advice);
        }
    }
View Full Code Here

Examples of org.apache.tapestry5.plastic.MethodAdvice

        Class<T> serviceInterface = resources.getServiceInterface();

        AspectInterceptorBuilder<T> builder = aspectDecorator.createBuilder(serviceInterface, delegate, String.format(
                "<Interceptor for %s(%s)>", resources.getServiceId(), serviceInterface.getName()));

        builder.adviseAllMethods(new MethodAdvice()
        {

            @Override
            public void advise(MethodInvocation invocation)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.