01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: * Return the identifying name of this Channel.
34: */
35: public String getChannelName();
36:
37: /**
38: * Send a message back to the client.
39: * @param msg The message to send.
40: * @param ep The connection point for this request.
41: */
42: public int send(Msg msg, MsgContext ep) throws IOException;
43:
44: /**
45: * Recieve a message from the client.
46: * @param msg The place to recieve the data into.
47: * @param ep The connection point for this request.
48: */
49: public int receive(Msg msg, MsgContext ep) throws IOException;
50:
51: /**
52: * Flush the data to the client.
53: */
54: public int flush(Msg msg, MsgContext ep) throws IOException;
55:
56: /**
57: * Invoke the request chain.
58: */
59: public int invoke(Msg msg, MsgContext ep) throws IOException;
60:
61: /**
62: * Confirm that a shutdown request was recieved form us.
63: */
64: public boolean isSameAddress(MsgContext ep);
65:
66: /**
67: * Register a new Request in the Request pool.
68: */
69: public void registerRequest(Request req, MsgContext ep, int count);
70:
71: /**
72: * Create a new request endpoint.
73: */
74: public MsgContext createMsgContext();
75:
76: }
|