Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.MethodAdvice


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

        MethodAdvice advice = mockAdvice();

        replay();

        AspectInterceptorBuilder<Subject> builder = decorator.createBuilder(Subject.class, delegate, "<Subject>");
View Full Code Here


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

        MethodAdvice advice = mockAdvice();

        replay();

        AspectInterceptorBuilder<Subject> builder = decorator.createBuilder(Subject.class, delegate, "<Subject>");
View Full Code Here

    @Test
    public void arrays_as_parameters_and_result()
    {
        ArraysSubject delegate = new ArraysSubjectImpl();

        MethodAdvice advice = new MethodAdvice()
        {
            public void advise(Invocation invocation)
            {
                String[] param = (String[]) invocation.getParameter(0);
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

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

        MethodAdvice advice = mockAdvice();

        replay();

        AspectInterceptorBuilder<Subject> builder = decorator.createBuilder(Subject.class, delegate, "<Subject>");
View Full Code Here

            {
                return input;
            }
        };

        MethodAdvice stripFirstLetter = new MethodAdvice()
        {
            public void advise(Invocation invocation)
            {
                String param = (String) invocation.getParameter(0);

                invocation.override(0, param.substring(1));

                invocation.proceed();
            }
        };

        MethodAdvice reverse = new MethodAdvice()
        {
            public void advise(Invocation invocation)
            {
                String param = (String) invocation.getParameter(0);
View Full Code Here

    @Test
    public void arrays_as_parameters_and_result()
    {
        ArraysSubject delegate = new ArraysSubjectImpl();

        MethodAdvice advice = new MethodAdvice()
        {
            public void advise(Invocation invocation)
            {
                String[] param = (String[]) invocation.getParameter(0);
View Full Code Here

        List<TransformMethodSignature> signatures = transformation.findMethodsWithAnnotation(Log.class);

        if (signatures.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 (TransformMethodSignature signature : signatures)
            transformation.advise(signature, advice);
View Full Code Here

     * Invoked at object creation, or when there are updates to class files (i.e., invalidation), to create a new set of
     * Javassist class pools and loaders.
     */
    private void initializeService()
    {
        ClassFactoryClassPool classPool = new ClassFactoryClassPool(parent);

        // For TAPESTRY-2561, we're introducing a class loader between the parent (i.e., the
        // context class loader), and the component class loader, to try and prevent the deadlocks
        // that we've been seeing.

        ClassLoader threadDeadlockBuffer = new URLClassLoader(new URL[0], parent);

        loader = new PackageAwareLoader(threadDeadlockBuffer, classPool);

        ClassPath path = new LoaderClassPath(loader);

        classPool.appendClassPath(path);

        classSource = new CtClassSourceImpl(classPool, loader);

        try
        {
View Full Code Here

        catch (Exception ex)
        {
            throw new RuntimeException(ex);
        }

        classFactory = new ClassFactoryImpl(loader, classPool, classSource, logger);

        classToPriorTransformException.clear();
    }
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.