01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.endpoint;
19:
20: import org.apache.cxf.message.Exchange;
21: import org.apache.cxf.message.Message;
22: import org.apache.cxf.transport.Conduit;
23:
24: /**
25: * Strategy for null Conduit retrieval.
26: * An instance of this class is set on the Exchange to clear
27: * the current ConduitSelector, as a work-around for broken
28: * Exchange.remove(ConduitSelector.class) semantics.
29: */
30: public class NullConduitSelector implements ConduitSelector {
31:
32: private Endpoint endpoint;
33:
34: /**
35: * Called prior to the interceptor chain being traversed.
36: *
37: * @param message the current Message
38: */
39: public void prepare(Message message) {
40: // nothing to do
41: }
42:
43: /**
44: * Called when a Conduit is actually required.
45: *
46: * @param message
47: * @return the Conduit to use for mediation of the message
48: */
49: public Conduit selectConduit(Message message) {
50: return null;
51: }
52:
53: /**
54: * Called on completion of the MEP for which the Conduit was required.
55: *
56: * @param exchange represents the completed MEP
57: */
58: public void complete(Exchange exchange) {
59: // nothing to do
60: }
61:
62: /**
63: * @return the encapsulated Endpoint
64: */
65: public Endpoint getEndpoint() {
66: return endpoint;
67: }
68:
69: /**
70: * @param ep the endpoint to encapsulate
71: */
72: public void setEndpoint(Endpoint ep) {
73: endpoint = ep;
74: }
75: }
|