org.jlab.coda.cMsg
Interface cMsgCallbackInterface

All Known Implementing Classes:
cMsgCallbackAdapter

public interface cMsgCallbackInterface

This interface provides an API for the client callbacks in the cMsg system.

Version:
1.0
Author:
Carl Timmer

Method Summary
 void callback(cMsgMessage msg, java.lang.Object userObject)
          Callback method definition.
 int getMaximumQueueSize()
          Method to get the maximum number of messages to queue for the callback.
 int getMaximumThreads()
          Method to get the maximum number of worker threads to use for running the callback if "mustSerializeMessages" returns false.
 int getMessagesPerThread()
          Method to get the maximum number of unprocessed messages per worker thread.
 int getSkipSize()
          Method to get the maximum number of messages to skip over (delete) from the cue for the callback when the cue size has reached it limit.
 boolean maySkipMessages()
          Method telling whether messages may be skipped or not.
 boolean mustSerializeMessages()
          Method telling whether messages must serialized -- processed in the order received.
 

Method Detail

callback

void callback(cMsgMessage msg,
              java.lang.Object userObject)
Callback method definition.

Parameters:
msg - message received from domain server
userObject - object passed as an argument which was set when the client orginally subscribed to a subject and type of message.

maySkipMessages

boolean maySkipMessages()
Method telling whether messages may be skipped or not.

Returns:
true if messages can be skipped without error, false otherwise

mustSerializeMessages

boolean mustSerializeMessages()
Method telling whether messages must serialized -- processed in the order received.

Returns:
true if messages must be processed in the order received, false otherwise

getMaximumQueueSize

int getMaximumQueueSize()
Method to get the maximum number of messages to queue for the callback.

Returns:
maximum number of messages to queue for the callback

getSkipSize

int getSkipSize()
Method to get the maximum number of messages to skip over (delete) from the cue for the callback when the cue size has reached it limit. This is only used when the "maySkipMessages" method returns true.

Returns:
maximum number of messages to skip over from the cue

getMaximumThreads

int getMaximumThreads()
Method to get the maximum number of worker threads to use for running the callback if "mustSerializeMessages" returns false.

Returns:
maximum number of worker threads to start

getMessagesPerThread

int getMessagesPerThread()
Method to get the maximum number of unprocessed messages per worker thread. This number is a target for dynamically adjusting server. This is only used when the "mustSerializeMessages" method returns false.

Returns:
maximum number of messages per worker thread