public class ExpectationCalc extends java.lang.Object implements MessageListener
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
queryLock |
static PerformanceTimer |
queryTimer |
java.util.HashMap<java.lang.Double,java.lang.Integer> |
scoreCount |
Constructor and Description |
---|
ExpectationCalc(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.util.List<ProteinSequence> seqs,
NetworkDestination dest) |
void |
store(ProteinSequence seq,
NetworkDestination dest) |
void |
store(java.lang.String seq) |
public static PerformanceTimer queryTimer
public static final java.lang.Object queryLock
public java.util.HashMap<java.lang.Double,java.lang.Integer> scoreCount
public ExpectationCalc(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 store(ProteinSequence seq, NetworkDestination dest) throws java.io.IOException
java.io.IOException
public void store(java.util.List<ProteinSequence> seqs, NetworkDestination dest) 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, java.lang.InterruptedException, SerializationException
java.io.IOException
java.lang.InterruptedException
SerializationException