01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.net.protocol.delivery;
06:
07: import com.tc.async.api.Sink;
08: import com.tc.net.protocol.NetworkStackHarness;
09: import com.tc.net.protocol.NetworkStackHarnessFactory;
10: import com.tc.net.protocol.tcm.MessageChannelInternal;
11: import com.tc.net.protocol.tcm.ServerMessageChannelFactory;
12: import com.tc.net.protocol.transport.MessageTransport;
13: import com.tc.net.protocol.transport.MessageTransportFactory;
14: import com.tc.net.protocol.transport.MessageTransportListener;
15:
16: public class OOONetworkStackHarnessFactory implements
17: NetworkStackHarnessFactory {
18:
19: private final Sink sink;
20: private final OnceAndOnlyOnceProtocolNetworkLayerFactory factory;
21:
22: public OOONetworkStackHarnessFactory(
23: OnceAndOnlyOnceProtocolNetworkLayerFactory factory,
24: Sink sink) {
25: this .factory = factory;
26: this .sink = sink;
27: }
28:
29: public NetworkStackHarness createClientHarness(
30: MessageTransportFactory transportFactory,
31: MessageChannelInternal channel,
32: MessageTransportListener[] transportListeners) {
33: return new OOONetworkStackHarness(transportFactory, channel,
34: factory, sink);
35: }
36:
37: public NetworkStackHarness createServerHarness(
38: ServerMessageChannelFactory channelFactory,
39: MessageTransport transport,
40: MessageTransportListener[] transportListeners) {
41: return new OOONetworkStackHarness(channelFactory, transport,
42: factory, sink);
43: }
44:
45: }
|