1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 package org.apache.jk.core;
19
20 import java.io.IOException;
21
22 import org.apache.coyote.Request;
23
24 /**
25 * A Channel represents a connection point to the outside world.
26 *
27 * @author Bill Barker
28 */
29
30 public interface JkChannel {
31
32
33 /**
34 * Return the identifying name of this Channel.
35 */
36 public String getChannelName();
37
38 /**
39 * Send a message back to the client.
40 * @param msg The message to send.
41 * @param ep The connection point for this request.
42 */
43 public int send(Msg msg, MsgContext ep) throws IOException;
44
45 /**
46 * Recieve a message from the client.
47 * @param msg The place to recieve the data into.
48 * @param ep The connection point for this request.
49 */
50 public int receive(Msg msg, MsgContext ep) throws IOException;
51
52 /**
53 * Flush the data to the client.
54 */
55 public int flush(Msg msg, MsgContext ep) throws IOException;
56
57 /**
58 * Invoke the request chain.
59 */
60 public int invoke(Msg msg, MsgContext ep) throws IOException;
61
62 /**
63 * Confirm that a shutdown request was recieved form us.
64 */
65 public boolean isSameAddress(MsgContext ep);
66
67 /**
68 * Register a new Request in the Request pool.
69 */
70 public void registerRequest(Request req, MsgContext ep, int count);
71
72 /**
73 * Create a new request endpoint.
74 */
75 public MsgContext createMsgContext();
76
77 }