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 retreival of a Conduit to mediate an outbound message.
26: * A specific instance implementing a particular strategy may be injected
27: * into the Client via config.
28: */
29: public interface ConduitSelector {
30:
31: /**
32: * Called prior to the interceptor chain being traversed.
33: * This is the point at which an eager strategy would retrieve
34: * a Conduit.
35: *
36: * @param message the current Message
37: */
38: void prepare(Message message);
39:
40: /**
41: * Called when a Conduit is actually required.
42: * This is the point at which a lazy strategy would retrieve
43: * a Conduit.
44: *
45: * @param message
46: * @return the Conduit to use for mediation of the message
47: */
48: Conduit selectConduit(Message message);
49:
50: /**
51: * Called on completion of the MEP for which the Conduit was required.
52: * This is the point at which a one-shot strategy would dispose of
53: * the Conduit.
54: *
55: * @param exchange represents the completed MEP
56: */
57: void complete(Exchange exchange);
58:
59: /**
60: * @return the encapsulated Endpoint
61: */
62: Endpoint getEndpoint();
63:
64: /**
65: * @param endpoint the endpoint to encapsulate
66: */
67: void setEndpoint(Endpoint endpoint);
68: }
|