Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.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()
        {
          
            public void advise(Invocation invocation)
            {
                invocation.proceed();
View Full Code Here


        if (methods.isEmpty())
            return;

        // Re-use the logging advice from LoggingDecorator
        final MethodAdvice loggingAdvice = new LoggingAdvice(model.getLogger(), exceptionTracker);

        // ... but wrap it for use at the component level.
        ComponentMethodAdvice advice = new ComponentMethodAdvice()
        {
            public void advise(ComponentMethodInvocation invocation)
            {
                loggingAdvice.advise(invocation);
            }
        };

        for (TransformMethod method : methods)
        {
View Full Code Here

        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. Intead, we return a thunk instance
             * that defers its behavior to the lazily invoked invocation.
             */
 
View Full Code Here

        this.exceptionTracker = exceptionTracker;
    }

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

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

        doAdvise(receiver, "alpha");
    }
   
    private static void doAdvise(MethodAdviceReceiver receiver, final String id)
    {
        receiver.adviseAllMethods(new MethodAdvice()
        {
          
            public void advise(Invocation invocation)
            {
                invocation.proceed();
View Full Code Here

        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()
        {
          
            public void advise(Invocation invocation)
            {
                invocation.proceed();
View Full Code Here

        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. Intead, we return a thunk instance
             * that defers its behavior to the lazily invoked invocation.
             */
 
View Full Code Here

        this.exceptionTracker = exceptionTracker;
    }

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

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

        this.exceptionTracker = exceptionTracker;
    }

    public <T> T build(Class<T> serviceInterface, T delegate, String serviceId, final Logger logger)
    {
        MethodAdvice advice = new LoggingAdvice(logger, exceptionTracker);

        return aspectDecorator.build(serviceInterface, delegate, advice,
                                     String.format("<Logging interceptor for %s(%s)>", serviceId,
                                                   serviceInterface.getName()));
    }
View Full Code Here

    @Test
    public void some_methods_not_intercepted() throws Exception
    {
        Subject delegate = mockSubject();

        MethodAdvice advice = new MethodAdvice()
        {
            public void advise(Invocation invocation)
            {
                assertEquals(invocation.getMethodName(), "advised");
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.MethodAdvice

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.