01: package org.objectweb.celtix.bus.bindings;
02:
03: import java.io.IOException;
04:
05: import javax.xml.ws.handler.MessageContext;
06:
07: import org.objectweb.celtix.bus.bindings.TestServerBinding.ToyOutputStreamMessageContext;
08: import org.objectweb.celtix.context.GenericMessageContext;
09: import org.objectweb.celtix.context.OutputStreamMessageContext;
10: import org.objectweb.celtix.transports.ServerTransport;
11: import org.objectweb.celtix.transports.ServerTransportCallback;
12: import org.objectweb.celtix.ws.addressing.EndpointReferenceType;
13:
14: class TestServerTransport implements ServerTransport {
15:
16: private ServerTransportCallback callback;
17:
18: public void shutdown() {
19: }
20:
21: public void activate(ServerTransportCallback cb) throws IOException {
22: callback = cb;
23: }
24:
25: public OutputStreamMessageContext rebase(MessageContext context,
26: EndpointReferenceType decoupledResponseEndpoint)
27: throws IOException {
28: return null;
29: }
30:
31: public OutputStreamMessageContext createOutputStreamContext(
32: MessageContext context) throws IOException {
33: return new ToyOutputStreamMessageContext(
34: new GenericMessageContext());
35: }
36:
37: public void deactivate() throws IOException {
38: }
39:
40: public void finalPrepareOutputStreamContext(
41: OutputStreamMessageContext context) throws IOException {
42: }
43:
44: public void postDispatch(MessageContext bindingContext,
45: OutputStreamMessageContext context) throws IOException {
46:
47: }
48:
49: public void fire() {
50: callback.dispatch(new TestInputStreamContext(new byte[] { 0 }),
51: this);
52: }
53: }
|