Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2554

When decorating a service using a decorate method, the underlying service (or interceptor) should be available as a parameter of the service type, not just java.lang.Object

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.13
    • Fix Version/s: 5.0.15
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Currently, the delegate object (the underlying service, or the next filter in the chain) must be present as a parameter of the decorating method, as type Object.

      This makes sense for more general decorations, as Java Generics will likely be used:

      public <T> T decorateXYZ(Class<T> serviceInterface, T service)

      { ... }

      The service object will, after erasure, be java.lang.Object.

      However, when decorating a specific service, where the service interface is known a-priori, the delegate must still be passed as java.lang.Object.

      Possibly, it will be necessary to use an annotation to be clear that the parameter in question is the delegate, and not a service injection.

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              hlship Howard M. Lewis Ship
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: