@Override public synchronized void setWriteTarget(MessageWriteTarget writeTarget) { if (closeOnOpen) writeTarget.closeConnection(); else { setTimeoutEnabled(false); this.writeTarget = writeTarget; upstreamConnection.setWriteTarget(writeTarget); } }
@Override public void connectionOpened() { setTimeoutEnabled(true); handler.connectionOpen(this); }
@Override public synchronized void connectionClosed() { manager.stopAsync(); if (!closeCalled) { closeCalled = true; upstreamConnection.connectionClosed(); } }
public NetworkAbstractionTests(Integer clientType) throws Exception { this.clientType = clientType; if (clientType == 0) { channels = new NioClientManager(); channels.startAsync(); } else if (clientType == 1) { channels = new BlockingClientManager(); channels.startAsync(); } else channels = null; }
public TestWithNetworkConnections(ClientType clientType) { this.clientType = clientType; if (clientType == ClientType.NIO_CLIENT_MANAGER) channels = new NioClientManager(); else if (clientType == ClientType.BLOCKING_CLIENT_MANAGER) channels = new BlockingClientManager(); else channels = null; }
@Override public void destroyConnection(PaymentChannelCloseException.CloseReason reason) { if (closeReason != null) closeReason = reason; socketProtobufHandler.closeConnection(); }
@Override protected synchronized void timeoutOccurred() { closeOnOpen = true; connectionClosed(); }
@Override public synchronized void connectionOpened() { if (!closeOnOpen) upstreamConnection.connectionOpened(); }
@Override public void run() { timeoutOccurred(); } };
@Override public synchronized void setWriteTarget(MessageWriteTarget writeTarget) { if (closeOnOpen) writeTarget.closeConnection(); else { setTimeoutEnabled(false); this.writeTarget = writeTarget; upstreamConnection.setWriteTarget(writeTarget); } }
@Override public void connectionOpened() { setTimeoutEnabled(true); handler.connectionOpen(this); }
@Override public synchronized void connectionClosed() { manager.stopAsync(); if (!closeCalled) { closeCalled = true; upstreamConnection.connectionClosed(); } }
/** * Disconnects the network connection but doesn't request the server to settle the channel first (literally just * unplugs the network socket and marks the stored channel state as inactive). */ public void disconnectWithoutSettlement() { wireParser.closeConnection(); } }
@Override protected synchronized void timeoutOccurred() { closeOnOpen = true; connectionClosed(); }
@Override public synchronized void setWriteTarget(MessageWriteTarget writeTarget) { if (closeOnOpen) writeTarget.closeConnection(); else { setTimeoutEnabled(false); this.writeTarget = writeTarget; upstreamConnection.setWriteTarget(writeTarget); } }
@Override public void connectionOpened() { setTimeoutEnabled(true); handler.connectionOpen(this); }
@Override public synchronized void connectionClosed() { manager.stopAsync(); if (!closeCalled) { closeCalled = true; upstreamConnection.connectionClosed(); } }
@Override public synchronized void setWriteTarget(MessageWriteTarget writeTarget) { if (closeOnOpen) writeTarget.closeConnection(); else { setTimeoutEnabled(false); this.writeTarget = writeTarget; upstreamConnection.setWriteTarget(writeTarget); } }
@Override public void connectionOpened() { setTimeoutEnabled(true); handler.connectionOpen(this); }
@Override public synchronized void connectionClosed() { manager.stopAsync(); if (!closeCalled) { closeCalled = true; upstreamConnection.connectionClosed(); } }