01: package org.objectweb.celtix.geronimo.container;
02:
03: import java.io.IOException;
04: import java.io.InputStream;
05:
06: import org.apache.geronimo.webservices.WebServiceContainer.Request;
07: import org.apache.geronimo.webservices.WebServiceContainer.Response;
08: import org.objectweb.celtix.context.InputStreamMessageContext;
09: import org.objectweb.celtix.context.ObjectMessageContextImpl;
10:
11: public class GeronimoInputStreamMessageContext extends
12: ObjectMessageContextImpl implements InputStreamMessageContext {
13:
14: static final String REQUEST = GeronimoInputStreamMessageContext.class
15: .getName()
16: + ".REQUEST";
17: static final String RESPONSE = GeronimoInputStreamMessageContext.class
18: .getName()
19: + ".RESPONSE";
20: private boolean isFault;
21: private InputStream inStream;
22:
23: GeronimoInputStreamMessageContext() {
24: }
25:
26: Request getRequest() {
27: return (Request) get(REQUEST);
28: }
29:
30: void setRequest(Request req) {
31: put(REQUEST, req);
32: }
33:
34: Response getResponse() {
35: return (Response) get(RESPONSE);
36: }
37:
38: void setResponse(Response resp) {
39: put(RESPONSE, resp);
40: }
41:
42: public InputStream getInputStream() {
43: // TODO Auto-generated method stub
44: if (inStream != null) {
45: return inStream;
46: }
47: try {
48: return getRequest().getInputStream();
49: } catch (IOException ex) {
50: throw new RuntimeException(ex);
51: }
52: }
53:
54: public void setInputStream(InputStream ins) {
55: inStream = ins;
56: }
57:
58: public void setFault(boolean fault) {
59: isFault = fault;
60: }
61:
62: public boolean isFault() {
63: // TODO Auto-generated method stub
64: return isFault;
65: }
66: }
|