SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

com.solarmetric.kodo.runtime.datacache.plugins
Class JMSCache

java.lang.Object
  |
  +--com.solarmetric.kodo.runtime.datacache.plugins.LocalCache
        |
        +--com.solarmetric.kodo.runtime.datacache.plugins.DistributedCache
              |
              +--com.solarmetric.kodo.runtime.datacache.plugins.JMSCache
All Implemented Interfaces:
Configurable, DataCache

public class JMSCache
extends DistributedCache
implements Configurable

A distributed cache implementation that uses a JMS Topic for broadcasting change notifications.


Fields inherited from class com.solarmetric.kodo.runtime.datacache.plugins.LocalCache
cache
 
Constructor Summary
JMSCache()
           
 
Method Summary
protected  void broadcastUpdate(Map additions, Map updates, Collection deletes)
          Notifys other PersistenceManagerFactory caches in this JVM and on other machines of changes to the cache.
 void close()
          Close this cache, dropping all hard references and releasing any resources that this cache maintains.
protected  Message createMessage(Map additions, Map updates, Collection deletes)
          Returns a new Message to send to the topic.
 void endConfiguration()
          Subclasses that need to perform actions in Configurable.endConfiguration() must invoke this method.
protected  MessageListener getMessageListener()
          Returns a MessageListener capable of understanding and processing messages created by createMessage(java.util.Map, java.util.Map, java.util.Collection).
 void setTopic(String name)
          Sets the JMS Topic name.
 void setTopicConnectionFactory(String name)
          Sets the JMS TopicConnectionFactory name.
 void startConfiguration()
          No-op implementation.
 
Methods inherited from class com.solarmetric.kodo.runtime.datacache.plugins.DistributedCache
batchUpdate, log, log, receivedBatchUpdate
 
Methods inherited from class com.solarmetric.kodo.runtime.datacache.plugins.LocalCache
clear, containsKey, get, getCacheMap, getCacheSize, newCacheMap, pin, put, remove, removeAll, setCacheSize, unpin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSCache

public JMSCache()
Method Detail

setTopic

public void setTopic(String name)
Sets the JMS Topic name. Defaults to topic/KodoCacheTopic.

setTopicConnectionFactory

public void setTopicConnectionFactory(String name)
Sets the JMS TopicConnectionFactory name. Defaults to java:/ConnectionFactory.

broadcastUpdate

protected void broadcastUpdate(Map additions,
                               Map updates,
                               Collection deletes)
Description copied from class: DistributedCache
Notifys other PersistenceManagerFactory caches in this JVM and on other machines of changes to the cache.
Overrides:
broadcastUpdate in class DistributedCache

startConfiguration

public void startConfiguration()
No-op implementation. Subclasses need not invoke this method if they override it.
Specified by:
startConfiguration in interface Configurable
Overrides:
startConfiguration in class LocalCache

endConfiguration

public void endConfiguration()
Subclasses that need to perform actions in Configurable.endConfiguration() must invoke this method.
Specified by:
endConfiguration in interface Configurable
Overrides:
endConfiguration in class LocalCache

getMessageListener

protected MessageListener getMessageListener()

Returns a MessageListener capable of understanding and processing messages created by createMessage(java.util.Map, java.util.Map, java.util.Collection).

The listener returned by this method is responsible for notifying the cache that a distributed event has been received. It should invoke DistributedCache.receivedBatchUpdate(java.util.Collection, java.util.Collection, java.util.Collection).

This implementation transfers data via NotificationObject objects, and invokes NotificationObject.receivedBatchUpdate(com.solarmetric.kodo.runtime.datacache.plugins.DistributedCache) on the received object, which in turn invokes DistributedCache.receivedBatchUpdate(java.util.Collection, java.util.Collection, java.util.Collection).


createMessage

protected Message createMessage(Map additions,
                                Map updates,
                                Collection deletes)
                         throws JMSException
Returns a new Message to send to the topic. This implementation creates an ObjectMessage.

close

public void close()
Description copied from interface: DataCache
Close this cache, dropping all hard references and releasing any resources that this cache maintains.
Overrides:
close in class LocalCache

SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.