1 4 package com.tc.net.protocol.transport; 5 6 import com.tc.async.api.Sink; 7 import com.tc.net.protocol.ProtocolSwitch; 8 import com.tc.net.protocol.TCProtocolAdaptor; 9 10 public class WireProtocolAdaptorFactoryImpl implements WireProtocolAdaptorFactory { 11 12 private final Sink httpSink; 13 14 public WireProtocolAdaptorFactoryImpl(Sink httpSink) { 16 this.httpSink = httpSink; 17 } 18 19 public WireProtocolAdaptorFactoryImpl() { 20 this(null); 21 } 22 23 public TCProtocolAdaptor newWireProtocolAdaptor(WireProtocolMessageSink sink) { 24 if (httpSink != null) { return new ProtocolSwitch(new WireProtocolAdaptorImpl(sink), httpSink); } 25 return new WireProtocolAdaptorImpl(sink); 26 } 27 } 28 | Popular Tags |