public class NTConnectionAdapter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private NTConnectionList |
m_adapterListener |
NTConnection |
m_connection |
private NTConnectionState |
m_connectionState |
private NTEntryStore |
m_entryStore |
private NTThread |
m_readThread |
| Constructor and Description |
|---|
NTConnectionAdapter(NTSocketStream stream,
NTEntryStore entryStore,
NTConnectionList adapterListener,
NTEntryTypeManager typeManager)
Create a server connection adapter for a given stream
|
| Modifier and Type | Method and Description |
|---|---|
void |
badMessage(BadMessageException e)
called if a bad message exception is thrown
|
void |
clientHello(char protocolRevision)
Called when the connection receives a client hello message
|
void |
ensureAlive() |
void |
flush() |
NTConnectionState |
getConnectionState() |
NTTableEntry |
getEntry(char id)
get an entry (used by a connection when filling an update entry
|
private void |
gotoState(NTConnectionState newState) |
void |
ioException(java.io.IOException e)
called if an io exception is thrown
|
void |
keepAlive()
Called when the connection receives a keep alive message
|
void |
offerIncomingAssignment(NTTableEntry entry) |
void |
offerIncomingUpdate(NTTableEntry entry,
char sequenceNumber,
java.lang.Object value) |
void |
offerOutgoingAssignment(NTTableEntry entry) |
void |
offerOutgoingUpdate(NTTableEntry entry) |
void |
protocolVersionUnsupported(char protocolRevision)
Called when the connection receives a protocol unsupported message
|
void |
serverHelloComplete() |
void |
shutdown(boolean closeStream)
stop the read thread and close the stream
|
private final NTEntryStore m_entryStore
private final NTConnectionList m_adapterListener
public final NTConnection m_connection
private final NTThread m_readThread
private NTConnectionState m_connectionState
public NTConnectionAdapter(NTSocketStream stream, NTEntryStore entryStore, NTConnectionList adapterListener, NTEntryTypeManager typeManager)
stream - transactionPool - entryStore - transactionReceiver - adapterListener - threadManager - private void gotoState(NTConnectionState newState)
public void badMessage(BadMessageException e)
e - public void ioException(java.io.IOException e)
e - public void shutdown(boolean closeStream)
public void keepAlive()
throws java.io.IOException
java.io.IOExceptionpublic void clientHello(char protocolRevision)
throws java.io.IOException
protocolRevision - java.io.IOExceptionpublic void protocolVersionUnsupported(char protocolRevision)
throws java.io.IOException
protocolRevision - the protocol version the server reported it supportsjava.io.IOExceptionpublic void serverHelloComplete()
throws java.io.IOException
java.io.IOExceptionpublic void offerIncomingAssignment(NTTableEntry entry)
public void offerIncomingUpdate(NTTableEntry entry, char sequenceNumber, java.lang.Object value)
public NTTableEntry getEntry(char id)
id - public void offerOutgoingAssignment(NTTableEntry entry)
public void offerOutgoingUpdate(NTTableEntry entry)
public void flush()
public NTConnectionState getConnectionState()
public void ensureAlive()