Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-262

Endpoint annotation should be annotated as @Inherited

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.5 M2
    • Component/s: Core
    • Labels:
      None

      Description

      After fixing SWS-222 the AbstractAnnotationMethodEndpointMapping will no longer see the @Endpoint annotation on a class that has been proxied using an interface.

      For example, if my endpoint is annotated and thus proxied, using the Acegi @Secured annotation, "MyEndpoint" below will never be discovered.

      interface MyEndpointIF {
      }
       
      //this class will never be discovered
      @Endpoint
      @Secured
      class MyEndpoint implements MyEndpointIF {
      }

      Given that the @Endpoint annotation is ONLY used for discovery, and not proxying purposes the @Endpoint annotation can be annotated as @Inherited and can then be placed on the interface.

      @Inherited
      @interface Endpoint {
      }
       
      //now the AbstractAnnotationMethodEndpointMapping will see a properly annotated bean and be happy.
      @Endpoint
      interface MyEndpointIF {
      }
       
      @Secured
      class MyEndpoint implements MyEndpointIF {
      }

        Issue Links

          Activity

          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          This should have been fixed in 1.0.3 and 1.5 M1, through the use of AopUtils.getTargetClass(). Could you check this?

          Also, annotating @Endpoint with @Inherited would not be consistent with @Controller (in Spring-MVC), which is not @Inherited either.

          Show
          arjen.poutsma Arjen Poutsma added a comment - This should have been fixed in 1.0.3 and 1.5 M1, through the use of AopUtils.getTargetClass(). Could you check this? Also, annotating @Endpoint with @Inherited would not be consistent with @Controller (in Spring-MVC), which is not @Inherited either.
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Closing 1.5 M2 issues.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Closing 1.5 M2 issues.

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              raykrueger Ray Krueger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: