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