View Javadoc

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.endpoint.interceptor;
18  
19  import org.apache.commons.logging.Log;
20  import org.apache.commons.logging.LogFactory;
21  import org.springframework.ws.context.MessageContext;
22  import org.springframework.ws.server.EndpointInterceptor;
23  import org.w3c.dom.Element;
24  
25  /**
26   * Default implementation of the <code>EndpointInterceptor</code> interface, for simplified implementation of
27   * pre-only/post-only interceptors.
28   *
29   * @author Arjen Poutsma
30   * @since 1.0.0
31   */
32  public class EndpointInterceptorAdapter implements EndpointInterceptor {
33  
34      /** Logger available to subclasses */
35      protected final Log logger = LogFactory.getLog(getClass());
36  
37      /** Returns <code>false</code>. */
38      public boolean understands(Element header) {
39          return false;
40      }
41  
42      /**
43       * Returns <code>true</code>.
44       *
45       * @return <code>true</code>
46       */
47      public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception {
48          return true;
49      }
50  
51      /**
52       * Returns <code>true</code>.
53       *
54       * @return <code>true</code>
55       */
56      public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception {
57          return true;
58      }
59  
60      /**
61       * Returns <code>true</code>.
62       *
63       * @return <code>true</code>
64       */
65      public boolean handleFault(MessageContext messageContext, Object endpoint) {
66          return true;
67      }
68  }