001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
003: */
004: package com.tc.net.core;
005:
006: import com.tc.exception.ImplementMe;
007: import com.tc.net.TCSocketAddress;
008: import com.tc.net.core.event.TCConnectionEventListener;
009: import com.tc.net.protocol.ProtocolAdaptorFactory;
010: import com.tc.net.protocol.TCProtocolAdaptor;
011:
012: /**
013: * TODO Jan 4, 2005: comment describing what this class is for.
014: */
015: public class MockConnectionManager implements TCConnectionManager {
016:
017: TCConnection conn;
018:
019: TCListener listener;
020:
021: int createConnectionCallCount = 0;
022:
023: public void setConnection(TCConnection conn) {
024: this .conn = conn;
025: }
026:
027: public void setListener(TCListener listener) {
028: this .listener = listener;
029: }
030:
031: public int getCreateConnectionCallCount() {
032: return createConnectionCallCount;
033: }
034:
035: /**
036: *
037: */
038:
039: public TCConnection createConnection(TCProtocolAdaptor adaptor) {
040: createConnectionCallCount++;
041: return conn;
042: }
043:
044: /**
045: *
046: */
047:
048: public TCConnection createConnection(TCProtocolAdaptor adaptor,
049: TCConnectionEventListener lsnr) {
050: createConnectionCallCount++;
051: return conn;
052: }
053:
054: /**
055: *
056: */
057:
058: public TCListener createListener(TCSocketAddress addr,
059: ProtocolAdaptorFactory factory) {
060: return this .listener;
061: }
062:
063: /**
064: *
065: */
066:
067: public TCListener createListener(TCSocketAddress addr,
068: ProtocolAdaptorFactory factory, int backlog,
069: boolean reuseAddr) {
070: return this .listener;
071: }
072:
073: /**
074: *
075: */
076:
077: public void asynchCloseAllConnections() {
078: throw new ImplementMe();
079: }
080:
081: /**
082: *
083: */
084:
085: public void closeAllListeners() {
086: throw new ImplementMe();
087: }
088:
089: /**
090: *
091: */
092:
093: public void shutdown() {
094: throw new ImplementMe();
095: }
096:
097: public TCConnection[] getAllConnections() {
098: throw new ImplementMe();
099: }
100:
101: public TCListener[] getAllListeners() {
102: throw new ImplementMe();
103: }
104:
105: public void closeAllConnections(long timeout) {
106: throw new ImplementMe();
107:
108: }
109:
110: }
|