View Javadoc

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