org.jlab.coda.cMsg
Class cMsgCallbackAdapter

java.lang.Object
  extended by org.jlab.coda.cMsg.cMsgCallbackAdapter
All Implemented Interfaces:
cMsgCallbackInterface

public class cMsgCallbackAdapter
extends java.lang.Object
implements cMsgCallbackInterface

This class is an adapter which implements the cMsgCallbackInterface. It implements the methods so extending this adapter is simpler than implementing the full interface.


Constructor Summary
cMsgCallbackAdapter()
           
 
Method Summary
 void callback(cMsgMessage msg, java.lang.Object userObject)
          Callback method definition.
 int getMaximumCueSize()
          Method to get the maximum number of messages to cue for the callback.
 int getMaximumThreads()
          Method to get the maximum number of supplemental threads to use for running the callback if mustSerializeMessages() returns false.
 int getMessagesPerThread()
          Method to get the maximum number of unprocessed messages per supplemental 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

cMsgCallbackAdapter

public cMsgCallbackAdapter()
Method Detail

callback

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

Specified by:
callback in interface cMsgCallbackInterface
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

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

Specified by:
maySkipMessages in interface cMsgCallbackInterface
Returns:
true if messages can be skipped without error, false otherwise

mustSerializeMessages

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

Specified by:
mustSerializeMessages in interface cMsgCallbackInterface
Returns:
true if messages must be processed in the order received, false otherwise

getMaximumCueSize

public int getMaximumCueSize()
Method to get the maximum number of messages to cue for the callback.

Specified by:
getMaximumCueSize in interface cMsgCallbackInterface
Returns:
maximum number of messages to cue for the callback

getSkipSize

public 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;

Specified by:
getSkipSize in interface cMsgCallbackInterface
Returns:
maximum number of messages to skip over from the cue

getMaximumThreads

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

Specified by:
getMaximumThreads in interface cMsgCallbackInterface
Returns:
maximum number of supplemental threads to start

getMessagesPerThread

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

Specified by:
getMessagesPerThread in interface cMsgCallbackInterface
Returns:
maximum number of messages per supplemental thread