Examples of addAdvice()


Examples of org.apache.tapestry5.plastic.PlasticMethod.addAdvice()

            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.services.TransformMethod.addAdvice()

                        new String[]
                        { "int" }, null);

                TransformMethod operate = transformation.getOrCreateMethod(operateSig);

                operate.addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
                        // This advice *replaces* the original do-nothing method, because
                        // it never calls invocation.proceed().
View Full Code Here

Examples of org.apache.tapestry5.services.TransformMethod.addAdvice()

                        "process", new String[]
                        { "java.lang.String", "int" }, null);

                TransformMethod process = transformation.getOrCreateMethod(processSig);

                process.addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
                        // Don't even bother with proceed() this time, which is OK (but
                        // somewhat rare).
View Full Code Here

Examples of org.codehaus.aspectwerkz.pointcut.ExecutionPointcut.addAdvice()

        ExecutionPointcut methodPointcut = (ExecutionPointcut)SystemLoader.getSystem("tests").
                getAspectMetaData(ASPECT_NAME).
                getExecutionPointcuts(m_classMetaData, methodMetaData).get(0);

        methodPointcut.addAdvice("advice2");

        m_logString = "";
        addAdviceTestMethod();
        assertEquals("before1 before2 invocation after2 after1 ", m_logString);
View Full Code Here

Examples of org.codehaus.aspectwerkz.pointcut.MethodPointcut.addAdvice()

                        continue;
                    }
                    // add advice references
                    List adviceRefs = weavingRule.getAdviceRefs();
                    for (Iterator it3 = adviceRefs.iterator(); it3.hasNext();) {
                        methodPointcut.addAdvice((String)it3.next());
                    }
                    // add advices from advice stacks
                    List adviceStackRefs = weavingRule.getAdviceStackRefs();
                    for (Iterator it3 = adviceStackRefs.iterator(); it3.hasNext();) {
                        AdviceStackDefinition adviceStackDefinition =
View Full Code Here

Examples of org.codehaus.aspectwerkz.pointcut.ThrowsPointcut.addAdvice()

                    );
                    if (pointcut == null) {
                        pointcut = new ThrowsPointcut(uuid, adviceDef.getExpression());
                        aspectMetaData.addThrowsPointcut(pointcut);
                    }
                    pointcut.addAdvice(adviceDef.getName());
                }
            }
        }
    }
View Full Code Here

Examples of org.springframework.aop.aspectj.annotation.AspectJProxyFactory.addAdvice()

    protected void buildDocument(Context context, Item item)
            throws SQLException, IOException
    {
        AspectJProxyFactory pf = new AspectJProxyFactory(item);
        pf.setProxyTargetClass(true);
        pf.addAdvice(new CrisItemWrapper());
        // ProxyFactory pf = new ProxyFactory(item);
        super.buildDocument(context, (Item) pf.getProxy());
    }

    public <P extends Property<TP>, TP extends PropertiesDefinition, NP extends ANestedProperty<NTP>, NTP extends ANestedPropertiesDefinition, ACNO extends ACrisNestedObject<NP, NTP, P, TP>, ATNO extends ATypeNestedObject<NTP>> boolean indexCrisObject(
View Full Code Here

Examples of org.springframework.aop.framework.AdvisedSupport.addAdvice()

  @Override
  public void run(RunNotifier notifier) {
    AdvisedSupport config = new AdvisedSupport();
    config.setTarget(notifier);
    config.addAdvice(new org.aopalliance.intercept.MethodInterceptor() {
      public Object invoke(MethodInvocation invocation) throws Throwable {
        if ("fireTestFailure".equals(invocation.getMethod().getName())) {
          Failure failure = (Failure) invocation.getArguments()[0];
          if (failure.getException() instanceof NotSwallowedException) {
            // We expect this
View Full Code Here

Examples of org.springframework.aop.framework.ProxyFactory.addAdvice()

  public static <T> T getVerifyingRepositoryProxy(T target, VerifyingMethodInterceptor interceptor) {

    ProxyFactory factory = new ProxyFactory();
    factory.setInterfaces(target.getClass().getInterfaces());
    factory.setTarget(target);
    factory.addAdvice(interceptor);

    return (T) factory.getProxy();
  }

  public static VerifyingMethodInterceptor expectInvocationOnType(Class<?> type) {
View Full Code Here

Examples of org.springframework.aop.framework.ProxyFactory.addAdvice()

    for (RepositoryProxyPostProcessor processor : postProcessors) {
      processor.postProcess(result, information);
    }

    if (IS_JAVA_8) {
      result.addAdvice(new DefaultMethodInvokingMethodInterceptor());
    }

    result.addAdvice(new QueryExecutorMethodInterceptor(information, customImplementation, target));

    return (T) result.getProxy(classLoader);
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.