| 
 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
  |
  +--org.exolab.jms.persistence.PersistenceAdapter
        |
        +--org.exolab.jms.persistence.BatchingRdbmsAdapter
The batching RDBMS adapter is used to improve the performance of persistent messages by batching more instructions into a single transaction.
 It encpasulates an RDBMSAdapter and delegates all the behaviour to
 it. In the interim it will only batch 'insert', 'update' and 'delete'
 statements. If it receives a 'select' or any query it will first commit the
 batched statements before satisfying the query.
 
This piece of code is still under development and could effect the integrity of your system if used. It could also improve the throughput of persistent messages if it works correctly.
| Method Summary | |
|  void | addDestination(java.sql.Connection connection,
               java.lang.String name,
               boolean queue)Add a new destination to the database. | 
|  void | addDurableConsumer(java.sql.Connection connection,
                   java.lang.String topic,
                   java.lang.String consumer)Add the specified durable consumer | 
|  void | addMessage(java.sql.Connection connection,
           MessageImpl message)Add a new message to the database. | 
|  void | addMessageHandle(java.sql.Connection connection,
                 PersistentMessageHandle handle)Add the specified persistent message handle. | 
|  void | addUser(java.sql.Connection connection,
        User user) | 
|  boolean | checkDestination(java.sql.Connection connection,
                 java.lang.String name)Determine if a particular destination name exists | 
|  void | close()Close the database if open. | 
|  boolean | durableConsumerExists(java.sql.Connection connection,
                      java.lang.String name)Check if the durable consumer exists | 
|  java.util.Enumeration | getAllDestinations(java.sql.Connection connection)Get a list of all destinations stored in the database | 
|  java.util.HashMap | getAllDurableConsumers(java.sql.Connection connection)Return a dictionary of all registered durable consumers. | 
|  java.util.Enumeration | getAllUsers(java.sql.Connection connection) | 
|  java.sql.Connection | getConnection()Return a connection to the database from the pool of connections. | 
|  int | getDurableConsumerMessageCount(java.sql.Connection connection,
                               java.lang.String destination,
                               java.lang.String name)Return the number of unsent message for the specified durable consumer. | 
|  java.util.Enumeration | getDurableConsumers(java.sql.Connection connection,
                    java.lang.String topic)Get an enumerated list of all durable consumers for the specified JmsTopic destination | 
|  org.exolab.core.foundation.HandleIfc | getHandle()Return a handle to this event handler for the purpose of storing and restoring it. | 
|  long | getLastId(java.sql.Connection connection)Check to see if the root is created. | 
|  int | getMaxStatementsToBatch()Return the maximum number of statements to batch | 
|  MessageImpl | getMessage(java.sql.Connection connection,
           java.lang.String id)Get a message from the persistence store. | 
|  java.util.Vector | getMessageHandles(java.sql.Connection connection,
                  JmsDestination destination,
                  java.lang.String name)Get all the persistent message handles for the specified destination and consumer name. | 
|  java.util.Vector | getMessages(java.sql.Connection connection,
            PersistentMessageHandle handle)Get at least the next message given the specified persistent handle. | 
|  java.util.Vector | getNonExpiredMessages(java.sql.Connection connection,
                      JmsDestination destination)Retrieve a list of unexpired PersistentMessageHandleobjects, 
 for the specified destination. | 
|  int | getQueueMessageCount(java.sql.Connection connection,
                     java.lang.String name)Get the number of unsent messages for a the specified queue | 
|  java.util.Vector | getUnprocessedMessages(java.sql.Connection connection)Return a list of unprocessed messages. | 
|  User | getUser(java.sql.Connection connection,
        User user) | 
|  void | handleEvent(int event,
            java.lang.Object callback,
            long time)Handle the specified event, generated by the EventManager. | 
|  int | purgeMessages()Purge all processed messages from the database. | 
|  void | removeDestination(java.sql.Connection connection,
                  java.lang.String name)Remove the destination with the specified name and all registered consumers from the database. | 
|  void | removeDurableConsumer(java.sql.Connection connection,
                      java.lang.String consumer)Remove the durable consumer for the specified topic. | 
|  void | removeExpiredMessageHandles(java.sql.Connection connection,
                            java.lang.String consumer)Remove all expired messages handles associated with this durable consumer. | 
|  void | removeExpiredMessages(java.sql.Connection connection)Remove all expired messages and associated references from the database. | 
|  void | removeMessage(java.sql.Connection connection,
              java.lang.String id)Remove the message with the specified identity from the database | 
|  void | removeMessageHandle(java.sql.Connection connection,
                    PersistentMessageHandle handle)Remove the specified persistent message handle. | 
|  void | removeUser(java.sql.Connection connection,
           User user) | 
|  void | setMaxStatementsToBatch(int max)Set the maximum number of SQL statements to batch | 
|  void | updateIds(java.sql.Connection connection,
          long id)Update the given id. | 
|  void | updateMessage(java.sql.Connection connection,
              MessageImpl message)Update this message in the database | 
|  void | updateMessageHandle(java.sql.Connection connection,
                    PersistentMessageHandle handle)Update the specified persistent message handle. | 
|  void | updateUser(java.sql.Connection connection,
           User user) | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
public void close()
close in class PersistenceAdapterpublic void setMaxStatementsToBatch(int max)
count - - number of statements to batchpublic int getMaxStatementsToBatch()
public long getLastId(java.sql.Connection connection)
               throws PersistenceException
PersistenceAdaptergetLastId in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterPersistenceException -  
public void updateIds(java.sql.Connection connection,
                      long id)
               throws PersistenceException
PersistenceAdapterupdateIds in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useid - The id to set in the database.PersistenceException -  
public void addMessage(java.sql.Connection connection,
                       MessageImpl message)
                throws PersistenceException
PersistenceAdapteraddMessage in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useMessageImpl - the new message to addPersistenceException -  
public void updateMessage(java.sql.Connection connection,
                          MessageImpl message)
                   throws PersistenceException
PersistenceAdapterupdateMessage in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useMessageImpl - the new message to updatePersistenceException -  
public java.util.Vector getUnprocessedMessages(java.sql.Connection connection)
                                        throws PersistenceException
PersistenceAdaptergetUnprocessedMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usePersistenceException -  
public void removeMessage(java.sql.Connection connection,
                          java.lang.String id)
                   throws PersistenceException
PersistenceAdapterremoveMessage in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - the identity of the message to remove.PersistenceException -  
public MessageImpl getMessage(java.sql.Connection connection,
                              java.lang.String id)
                       throws PersistenceException
PersistenceAdaptergetMessage in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useString - The id of the message to search forPersistenceException -  
public java.util.Vector getMessages(java.sql.Connection connection,
                                    PersistentMessageHandle handle)
                             throws PersistenceException
PersistenceAdaptergetMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to resolvePersistenceException -  
public void addMessageHandle(java.sql.Connection connection,
                             PersistentMessageHandle handle)
                      throws PersistenceException
PersistenceAdapteraddMessageHandle in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to addPersistenceException -  
public void updateMessageHandle(java.sql.Connection connection,
                                PersistentMessageHandle handle)
                         throws PersistenceException
PersistenceAdapterupdateMessageHandle in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to updatePersistenceException -  
public void removeMessageHandle(java.sql.Connection connection,
                                PersistentMessageHandle handle)
                         throws PersistenceException
PersistenceAdapterremoveMessageHandle in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to removePersistenceException -  PersistenceException -  
public java.util.Vector getMessageHandles(java.sql.Connection connection,
                                          JmsDestination destination,
                                          java.lang.String name)
                                   throws PersistenceException
PersistenceAdapterThe returned messages reference unacked or unsent messages
NEED A STRATEGY WHEN WE HAVE LOTS OF MESSAGE HANDLES
getMessageHandles in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usedestination - - the destination to referencename - - the consumer namePersistenceException -  
public void addDurableConsumer(java.sql.Connection connection,
                               java.lang.String topic,
                               java.lang.String consumer)
                        throws PersistenceException
PersistenceAdapteraddDurableConsumer in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usetopic - - the name of the topicname - - the name of the consumerPersistenceException -  
public void removeDurableConsumer(java.sql.Connection connection,
                                  java.lang.String consumer)
                           throws PersistenceException
PersistenceAdapterremoveDurableConsumer in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useconsumer - - the consumer namePersistenceException -  
public java.util.Enumeration getDurableConsumers(java.sql.Connection connection,
                                                 java.lang.String topic)
                                          throws PersistenceException
PersistenceAdaptergetDurableConsumers in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usetopic - - the topic to queryPersistenceException -  
public java.util.HashMap getAllDurableConsumers(java.sql.Connection connection)
                                         throws PersistenceException
PersistenceAdaptergetAllDurableConsumers in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usePersistenceException -  
public boolean durableConsumerExists(java.sql.Connection connection,
                                     java.lang.String name)
                              throws PersistenceException
PersistenceAdapterdurableConsumerExists in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - durable consumer namePersistenceException -  
public void addDestination(java.sql.Connection connection,
                           java.lang.String name,
                           boolean queue)
                    throws PersistenceException
PersistenceAdapteraddDestination in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - the destination namequeue - - true if it pertains to a queuePersistenceException -  
public void removeDestination(java.sql.Connection connection,
                              java.lang.String name)
                       throws PersistenceException
PersistenceAdapterremoveDestination in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usedestination - - the name of the destinationPersistenceException -  
public java.util.Enumeration getAllDestinations(java.sql.Connection connection)
                                         throws PersistenceException
PersistenceAdaptergetAllDestinations in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usePersistenceException -  
public boolean checkDestination(java.sql.Connection connection,
                                java.lang.String name)
                         throws PersistenceException
PersistenceAdaptercheckDestination in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - the name to queryPersistenceException -  
public int getQueueMessageCount(java.sql.Connection connection,
                                java.lang.String name)
                         throws PersistenceException
PersistenceAdaptergetQueueMessageCount in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - the name of the queuePersistenceException -  
public int getDurableConsumerMessageCount(java.sql.Connection connection,
                                          java.lang.String destination,
                                          java.lang.String name)
                                   throws PersistenceException
PersistenceAdaptergetDurableConsumerMessageCount in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usedestination - - the destination namename - - the name of the durable subscriberPersistenceException -  
public void removeExpiredMessages(java.sql.Connection connection)
                           throws PersistenceException
PersistenceAdapterremoveExpiredMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usePersistenceException -  
public void removeExpiredMessageHandles(java.sql.Connection connection,
                                        java.lang.String consumer)
                                 throws PersistenceException
PersistenceAdapterremoveExpiredMessageHandles in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useconsumer - - the durable consumer namePersistenceException -  
public java.util.Vector getNonExpiredMessages(java.sql.Connection connection,
                                              JmsDestination destination)
                                       throws PersistenceException
PersistenceAdapterPersistentMessageHandle objects, 
 for the specified destination.getNonExpiredMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usedestination - - the destination in questionPersistenceException -  
public java.sql.Connection getConnection()
                                  throws PersistenceException
getConnection in class PersistenceAdapterPersistenceException - - if it cannot retrieve a connectionpublic int purgeMessages()
purgeMessages in class PersistenceAdapter
public void handleEvent(int event,
                        java.lang.Object callback,
                        long time)
EventHandlerEventManager.
 The event handler pressumably knows how to handle the callback object
 and should cast it appropriately before using it.
 This methodshould not throw any exceptions
handleEvent in interface EventHandlerorg.exolab.jms.events.EventHandlerevent - the event to handlecallback - the callback objecttime - the absolute time, in ms, that the event
                              fired.public org.exolab.core.foundation.HandleIfc getHandle()
EventHandlerEventManager then you must support this
 method, otherwise this method can simply return null.getHandle in interface EventHandlerorg.exolab.jms.events.EventHandler
public void addUser(java.sql.Connection connection,
                    User user)
             throws PersistenceException
addUser in class PersistenceAdapter
public java.util.Enumeration getAllUsers(java.sql.Connection connection)
                                  throws PersistenceException
getAllUsers in class PersistenceAdapter
public User getUser(java.sql.Connection connection,
                    User user)
             throws PersistenceException
getUser in class PersistenceAdapter
public void removeUser(java.sql.Connection connection,
                       User user)
                throws PersistenceException
removeUser in class PersistenceAdapter
public void updateUser(java.sql.Connection connection,
                       User user)
                throws PersistenceException
updateUser in class PersistenceAdapter| 
 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||