org.sandev.basics.nodecommon
Interface Messageable

All Known Implementing Classes:
AuthorizerNode, AuthorizerNodeBase, CacheManagerNode, CacheManagerNodeBase, DataManagerNode, DataManagerNodeBase, MessageDriverNode, MessageDriverNodeBase

public interface Messageable

The Messageable interface defines callback methods used by Messagers to deliver queries and asynchronous messages to nodes. Exceptions thrown during processing of a message may be of any framework type. It is up to the Messager implementation to wrap these appropriately.


Method Summary
 SandCollectionMessage callQuery(SandQueryMessage sqm)
          A generalized call method that takes a query message and returns the corresponding collection.
 void deliver(SandMessage msg)
          Receive streamed messages.
 IDCache getIDCache()
          If this node will be caching instances locally, return the IDCache instance that will be used.
 Messager getMessager()
          Return our Messager instance
 SandMessage receive(SandMessage msg)
          Receive a query.
 void setMessager(Messager messager)
          Set our Messager instance
 

Method Detail

deliver

void deliver(SandMessage msg)
             throws SandException
Receive streamed messages.

Throws:
SandException

receive

SandMessage receive(SandMessage msg)
                    throws SandException
Receive a query.

Throws:
SandException

getMessager

Messager getMessager()
Return our Messager instance


setMessager

void setMessager(Messager messager)
Set our Messager instance


getIDCache

IDCache getIDCache()
If this node will be caching instances locally, return the IDCache instance that will be used. Having this method in the interface allows the NodeBase code to automatically deal with incoming CacheActions.


callQuery

SandCollectionMessage callQuery(SandQueryMessage sqm)
                                throws SandException
A generalized call method that takes a query message and returns the corresponding collection. If given a query message that is not supported, then this method throws. Used to support generalized query processing.

Throws:
SandException