Announcement Announcement Module
No announcement yet.
Contribution: PayloadRootQNameAnnotationEndpointMapping Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Contribution: PayloadRootQNameAnnotationEndpointMapping

    Right now the only supported Annotation based discovery mechanism is at the method level using the PayloadRootAnnotationMethodEndpointMapping. This is fine, but it makes it difficult to leverage all the existing functionality in the existing "Abstract*PayloadEndpoint" implementations.

    I had originally looked at extending AbstractDomPayloadEndpoint for my endpoint. Then creating my own @PayloadRoot annotated method that simply called the "invoke" method implemented on AbstractDomPayloadEndpoint. Which would in-turn call the "invokeInternal" method defined by the AbstractDomPayloadEndpoint. This was reeeally ugly.

    So instead I created a simple PayloadRootQNameAnnotationEndpointMapping that looks for instances of "PayloadEndpoint" in the ApplicationContext. It then examines the PayloadEndpoint to see if it has an annotation called PayloadRootMapping on it.

    PayloadRootMapping is a wrapper around an array of "PayloadRoot" annotations (PayloadRoot doesn't allow TYPE as one of it's target types )

    So my endpoint looks like...
            {@PayloadRoot(localPart = "ExchangeRequest", namespace = "")}
    public class CurrencyExchangeEndpointImpl extends AbstractDomPayloadEndpoint {...}
    This gives me the ability to use all the existing Abstract*PayloadEndpoint implementations and combine it with Annotation based auto-discovery.

    It's basically just the PayloadRootQNameAnnotationEndpointMapping and the PayloadRootMapping annotation.

    I'll open a Jira and upload the code.

  • #2
    Jira Created...


    • #3
      Thanks! Looks interesting, I'll take a closer look at the code soon...