Package org.apache.tapestry.ioc.annotations

Examples of org.apache.tapestry.ioc.annotations.Scope


    public void get_annotation_with_annotation_on_write_method()
    {
        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter(
                "annotationOnWrite");

        Scope annotation = pa.getAnnotation(Scope.class);
        assertNotNull(annotation);

        assertEquals(annotation.value(), "onwrite");
    }
View Full Code Here


    public void read_method_annotation_overrides_write_method_annotation()
    {
        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter(
                "annotationOnRead");

        Scope annotation = pa.getAnnotation(Scope.class);
        assertNotNull(annotation);

        assertEquals(annotation.value(), "onread");
    }
View Full Code Here

        // Set defaults for the other properties.

        _eagerLoad = serviceImplementation.getAnnotation(EagerLoad.class) != null;
        _serviceId = serviceInterface.getSimpleName();

        Scope scope = serviceImplementation.getAnnotation(Scope.class);

        _scope = scope != null ? scope.value() : IOCConstants.DEFAULT_SCOPE;

        return this;
    }
View Full Code Here

        _serviceDefs.put(serviceId, serviceDef);
    }

    private String extractServiceScope(Method method)
    {
        Scope scope = method.getAnnotation(Scope.class);

        return scope != null ? scope.value() : IOCConstants.DEFAULT_SCOPE;
    }
View Full Code Here

    @Test
    public void get_annotation_with_annotation_on_write_method()
    {
        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter("annotationOnWrite");

        Scope annotation = pa.getAnnotation(Scope.class);
        assertNotNull(annotation);

        assertEquals(annotation.value(), "onwrite");
    }
View Full Code Here

    @Test
    public void read_method_annotation_overrides_write_method_annotation()
    {
        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter("annotationOnRead");

        Scope annotation = pa.getAnnotation(Scope.class);
        assertNotNull(annotation);

        assertEquals(annotation.value(), "onread");
    }
View Full Code Here

        // Set defaults for the other properties.

        _eagerLoad = serviceImplementation.getAnnotation(EagerLoad.class) != null;
        _serviceId = serviceInterface.getSimpleName();

        Scope scope = serviceImplementation.getAnnotation(Scope.class);

        _scope = scope != null ? scope.value() : IOCConstants.DEFAULT_SCOPE;

        Marker marker = serviceImplementation.getAnnotation(Marker.class);

        if (marker != null)
        {
View Full Code Here

    @Test
    public void get_annotation_with_annotation_on_write_method()
    {
        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter("annotationOnWrite");

        Scope annotation = pa.getAnnotation(Scope.class);
        assertNotNull(annotation);

        assertEquals(annotation.value(), "onwrite");
    }
View Full Code Here

    @Test
    public void read_method_annotation_overrides_write_method_annotation()
    {
        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter("annotationOnRead");

        Scope annotation = pa.getAnnotation(Scope.class);
        assertNotNull(annotation);

        assertEquals(annotation.value(), "onread");
    }
View Full Code Here

        _serviceDefs.put(serviceId, serviceDef);
    }

    private String extractServiceScope(Method method)
    {
        Scope scope = method.getAnnotation(Scope.class);

        return scope != null ? scope.value() : IOCConstants.DEFAULT_SCOPE;
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.annotations.Scope

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.