Stomp

Runtime callbacks for database changes.

 

Stomp provides a very user-friendly way to find about database changes.  This callback mechanism’s biggest benefit is to allow developers to manage in-memory data caches efficiently.  Objects can register for notification anytime a particular object or class of objects is changed in the database.

 

The stomp.jdo.RefreshManager.  To use this mechanism, clients should create an instance of type stomp.jdo.RefreshListener, and register this object with the RefreshManager, ie: RefreshManager.singleton ().registerListener (pc, myListener).  Clients can pass in a specific object to listen to, or listen for events on an entire class.  Stomp will notify this listener when the object is changed or deleted.  If the listener is registered for events on an entire class, it will be notified when new objects are added as well. 

 

Note: since the object in question is passed along with the callback from the RefreshManager, you may be able to register a single callback listener for many objects and save some memory.

 

Note: as with most registration callback schemes, be careful to remove this listener from the RefreshManager when appropriate, or you may introduce a memory leak into your application.