01: package org.objectweb.celtix.bus.transports.http;
02:
03: import java.io.IOException;
04: import java.io.InputStream;
05:
06: import org.objectweb.celtix.context.GenericMessageContext;
07: import org.objectweb.celtix.context.InputStreamMessageContext;
08:
09: public class HTTPServerInputStreamContext extends GenericMessageContext
10: implements InputStreamMessageContext {
11:
12: public static final String HTTP_REQUEST = HTTPServerInputStreamContext.class
13: .getName()
14: + ".REQUEST";
15: public static final String HTTP_RESPONSE = HTTPServerInputStreamContext.class
16: .getName()
17: + ".RESPONSE";
18:
19: private static final long serialVersionUID = 1L;
20:
21: protected final AbstractHTTPServerTransport transport;
22: protected InputStream origInputStream;
23: protected InputStream inStream;
24:
25: public HTTPServerInputStreamContext(AbstractHTTPServerTransport tr)
26: throws IOException {
27: transport = tr;
28: }
29:
30: public void initContext() throws IOException {
31: transport.setHeaders(this );
32: inStream = origInputStream;
33: }
34:
35: public InputStream getInputStream() {
36: return inStream;
37: }
38:
39: public void setInputStream(InputStream ins) {
40: inStream = ins;
41: }
42:
43: public void setFault(boolean isFault) {
44: //nothing to do
45: }
46:
47: public boolean isFault() {
48: return false;
49: }
50: }
|