001: package com.tc.object.tx;
002:
003: import com.tc.async.api.Sink;
004: import com.tc.exception.ImplementMe;
005: import com.tc.io.TCByteBufferOutputStream;
006: import com.tc.net.protocol.tcm.ChannelEventListener;
007: import com.tc.net.protocol.tcm.ChannelID;
008: import com.tc.net.protocol.tcm.ChannelIDProvider;
009: import com.tc.net.protocol.tcm.ClientMessageChannel;
010: import com.tc.net.protocol.tcm.MockMessageChannel;
011: import com.tc.net.protocol.tcm.NullMessageMonitor;
012: import com.tc.net.protocol.tcm.TCMessageType;
013: import com.tc.object.msg.AcknowledgeTransactionMessageFactory;
014: import com.tc.object.msg.ClientHandshakeMessageFactory;
015: import com.tc.object.msg.CommitTransactionMessageFactory;
016: import com.tc.object.msg.CompletedTransactionLowWaterMarkMessage;
017: import com.tc.object.msg.CompletedTransactionLowWaterMarkMessageFactory;
018: import com.tc.object.msg.JMXMessage;
019: import com.tc.object.msg.LockRequestMessageFactory;
020: import com.tc.object.msg.ObjectIDBatchRequestMessageFactory;
021: import com.tc.object.msg.RequestManagedObjectMessageFactory;
022: import com.tc.object.msg.RequestRootMessageFactory;
023: import com.tc.object.net.DSOClientMessageChannel;
024: import com.tc.object.session.SessionID;
025:
026: public class MockChannel implements DSOClientMessageChannel {
027:
028: public void addClassMapping(TCMessageType messageType,
029: Class messageClass) {
030: throw new ImplementMe();
031: }
032:
033: public void addListener(ChannelEventListener listener) {
034: throw new ImplementMe();
035: }
036:
037: public ClientMessageChannel channel() {
038: throw new ImplementMe();
039: }
040:
041: public void close() {
042: throw new ImplementMe();
043: }
044:
045: public AcknowledgeTransactionMessageFactory getAcknowledgeTransactionMessageFactory() {
046: throw new ImplementMe();
047: }
048:
049: public ChannelIDProvider getChannelIDProvider() {
050: throw new ImplementMe();
051: }
052:
053: public ClientHandshakeMessageFactory getClientHandshakeMessageFactory() {
054: throw new ImplementMe();
055: }
056:
057: public CommitTransactionMessageFactory getCommitTransactionMessageFactory() {
058: throw new ImplementMe();
059: }
060:
061: public LockRequestMessageFactory getLockRequestMessageFactory() {
062: throw new ImplementMe();
063: }
064:
065: public ObjectIDBatchRequestMessageFactory getObjectIDBatchRequestMessageFactory() {
066: throw new ImplementMe();
067: }
068:
069: public RequestManagedObjectMessageFactory getRequestManagedObjectMessageFactory() {
070: throw new ImplementMe();
071: }
072:
073: public RequestRootMessageFactory getRequestRootMessageFactory() {
074: throw new ImplementMe();
075: }
076:
077: public boolean isConnected() {
078: throw new ImplementMe();
079: }
080:
081: public void open() {
082: throw new ImplementMe();
083: }
084:
085: public void routeMessageType(TCMessageType messageType,
086: Sink destSink, Sink hydrateSink) {
087: throw new ImplementMe();
088: }
089:
090: public JMXMessage getJMXMessage() {
091: throw new ImplementMe();
092: }
093:
094: CompletedTransactionLowWaterMarkMessageFactory nullFactory = new NullCompletedTransactionLowWaterMarkMessageFactory();
095:
096: public CompletedTransactionLowWaterMarkMessageFactory getCompletedTransactionLowWaterMarkMessageFactory() {
097: return nullFactory;
098: }
099:
100: private class NullCompletedTransactionLowWaterMarkMessageFactory
101: implements CompletedTransactionLowWaterMarkMessageFactory {
102:
103: public CompletedTransactionLowWaterMarkMessage newCompletedTransactionLowWaterMarkMessage() {
104: return new CompletedTransactionLowWaterMarkMessage(
105: new SessionID(0),
106: new NullMessageMonitor(),
107: new TCByteBufferOutputStream(4, 4096, false),
108: new MockMessageChannel(new ChannelID(0)),
109: TCMessageType.COMPLETED_TRANSACTION_LOWWATERMARK_MESSAGE);
110: }
111:
112: }
113: }
|