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.transport;
19:
20: import java.io.IOException;
21:
22: import org.apache.cxf.message.Message;
23: import org.apache.cxf.ws.addressing.EndpointReferenceType;
24:
25: /**
26: * A pipe between peers that channels transport-level messages.
27: * <p>
28: * A Conduit channels messages to a <b>single</b> destination, though
29: * this destination may fan-out to multiple receivers (for example a JMS topic).
30: * <p>
31: * A Conduit may have a back-channel, on which transport-level responses
32: * are received. Alternatively the back-channel destination may be decoupled,
33: * in which case the response it is received via a separate Conduit.
34: * The crucial distinction is whether the Conduit can itself correlate
35: * the response (which may be synchronous, or may be delivered via
36: * a dedicated destination).
37: * <p>
38: * Conduits may be used for multiple messages, either serially or
39: * concurrently, with the implementation taking care of mapping onto
40: * multiple transport resources (e.g. connections) if neccessary to
41: * support concurrency.
42: * <p>
43: * Binding-level MEPs may be realized over one or more Conduits.
44: */
45: public interface Conduit extends Observable {
46:
47: /**
48: * Prepare the message for sending. This will typically involve setting
49: * an OutputStream on the message, but it may do nothing at all.
50: *
51: * @param message the message to be sent.
52: */
53: void prepare(Message message) throws IOException;
54:
55: /**
56: * Close the connections associated with the message
57: */
58: void close(Message message) throws IOException;
59:
60: /**
61: * @return the reference associated with the target Destination
62: */
63: EndpointReferenceType getTarget();
64:
65: /**
66: * Retreive the back-channel Destination.
67: *
68: * @return the backchannel Destination (or null if the backchannel is
69: * built-in)
70: */
71: Destination getBackChannel();
72:
73: /**
74: * Close the conduit
75: */
76: void close();
77: }
|