public class NearestNeighborQueryTest extends java.lang.Object implements MessageListener
Constructor and Description |
---|
NearestNeighborQueryTest(java.lang.String server,
int port) |
Modifier and Type | Method and Description |
---|---|
void |
disconnect() |
static void |
main(java.lang.String[] args) |
void |
onConnect(NetworkDestination endpoint)
Called when a connection is established with a remote endpoint.
|
void |
onDisconnect(NetworkDestination endpoint)
Called when the MessageListener has been disconnected from a remote
endpoint.
|
void |
onMessage(MendelMessage message)
Called when a message is ready to be processed.
|
void |
query(java.lang.String queryString) |
void |
store(Block block) |
void |
store(java.lang.String seq) |
public NearestNeighborQueryTest(java.lang.String server, int port) throws java.io.IOException
java.io.IOException
public void disconnect()
public void query(java.lang.String queryString) throws java.io.IOException, SerializationException
java.io.IOException
SerializationException
public void store(java.lang.String seq) throws java.io.IOException
java.io.IOException
public void store(Block block) throws java.io.IOException
java.io.IOException
public void onConnect(NetworkDestination endpoint)
MessageListener
onConnect
in interface MessageListener
public void onDisconnect(NetworkDestination endpoint)
MessageListener
onDisconnect
in interface MessageListener
public void onMessage(MendelMessage message)
MessageListener
MessageRouter
instance). To avoid
hurting performance, the implementation of onMessage must be lightweight.
In fact, blocking in this method implementation can cause serious
problems.
An example use case could involve placing incoming messages in a blocking queue and then having another thread process them. If the queue gets too full, then it may be appropriate to block here (thus blocking the Selector thread) to slow the rate of incoming messages from the network.
onMessage
in interface MessageListener
message
- MendelMessage that was received; null if the connection
has been terminated.public static void main(java.lang.String[] args) throws java.io.IOException, SerializationException, java.lang.InterruptedException
java.io.IOException
SerializationException
java.lang.InterruptedException