1 /* 2 * Copyright 2005 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.springframework.ws.server; 18 19 import org.springframework.ws.context.MessageContext; 20 21 /** 22 * Defines a mapping between message requests and endpoint objects. 23 * <p/> 24 * This class can be implemented by application developers, although this is not always necessary, as 25 * <code>PayloadRootQNameEndpointMapping</code> and <code>SoapActionEndpointMapping</code> are included. 26 * <p/> 27 * HandlerMapping implementations can support mapped interceptors but do not have to. An endpoint will always be wrapped 28 * in a <code>EndpointExecutionChain</code> instance, optionally accompanied by some <code>EndpointInterceptor</code> 29 * instances. The <code>MessageDispacher</code> will first call each <code>EndpointInterceptor</code>'s 30 * <code>handlerRequest</code> method in the given order, finally invoking the endpoint itself if all 31 * <code>handlerRequest</code> methods have returned <code>true</code>. 32 * 33 * @author Arjen Poutsma 34 * @see org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping 35 * @see org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping 36 * @see org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping 37 * @since 1.0.0 38 */ 39 public interface EndpointMapping { 40 41 /** 42 * Returns an endpoint and any interceptors for this message context. The choice may be made on message contents, 43 * transport request url, a routing table, or any factor the implementing class chooses. 44 * <p/> 45 * The returned <code>EndpointExecutionChain</code> contains an endpoint Object, rather than even a tag interface, 46 * so that endpoints are not constrained in any way. For example, a <code>EndpointAdapter</code> could be written to 47 * allow another framework's endpoint objects to be used. 48 * <p/> 49 * Returns <code>null</code> if no match was found. This is by design. The <code>MessageDispatcher</code> will query 50 * all registered <code>EndpointMapping</code> beans to find a match, and only decide there is an error if none can 51 * find an endpoint. 52 * 53 * @return a HandlerExecutionChain instance containing endpoint object and any interceptors, or <code>null</code> if 54 * no mapping is found 55 * @throws Exception if there is an internal error 56 */ 57 EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception; 58 59 }