KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > bindings > TestServerTransport


1 package org.objectweb.celtix.bus.bindings;
2
3 import java.io.IOException JavaDoc;
4
5 import javax.xml.ws.handler.MessageContext;
6
7 import org.objectweb.celtix.bus.bindings.TestServerBinding.ToyOutputStreamMessageContext;
8 import org.objectweb.celtix.context.GenericMessageContext;
9 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 JavaDoc {
22         callback = cb;
23     }
24     
25     public OutputStreamMessageContext rebase(MessageContext context,
26                                              EndpointReferenceType decoupledResponseEndpoint)
27         throws IOException JavaDoc {
28         return null;
29     }
30
31     public OutputStreamMessageContext createOutputStreamContext(MessageContext context)
32         throws IOException JavaDoc {
33         return new ToyOutputStreamMessageContext(new GenericMessageContext());
34     }
35
36     public void deactivate() throws IOException JavaDoc {
37     }
38
39     public void finalPrepareOutputStreamContext(OutputStreamMessageContext context) throws IOException JavaDoc {
40     }
41     
42     public void postDispatch(MessageContext bindingContext,
43                                        OutputStreamMessageContext context) throws IOException JavaDoc {
44         
45     }
46
47     public void fire() {
48         callback.dispatch(new TestInputStreamContext(new byte[] {0}), this);
49     }
50 }
51
Popular Tags