Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.activemq.store.cache
Class SimpleCachePersistenceAdapterGBean  view SimpleCachePersistenceAdapterGBean download SimpleCachePersistenceAdapterGBean.java

java.lang.Object
  extended byorg.activemq.store.cache.SimpleCachePersistenceAdapterGBean
All Implemented Interfaces:
org.apache.geronimo.gbean.GBeanLifecycle, org.activemq.store.PersistenceAdapter, org.activemq.service.Service

public class SimpleCachePersistenceAdapterGBean
extends java.lang.Object
implements org.apache.geronimo.gbean.GBeanLifecycle, org.activemq.store.PersistenceAdapter


Field Summary
private  int cacheSize
           
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
private  org.activemq.store.PersistenceAdapter longTermPersistence
           
private  SimpleCachePersistenceAdapter persistenceAdapter
           
 
Constructor Summary
SimpleCachePersistenceAdapterGBean()
           
SimpleCachePersistenceAdapterGBean(org.activemq.store.PersistenceAdapter longTermPersistence, int cacheSize)
           
 
Method Summary
 void beginTransaction()
          This method starts a transaction on the persistent storage - which is nothing to do with JMS or XA transactions - its purely a mechanism to perform multiple writes to a persistent store in 1 transaction as a performance optimisation.
 void commitTransaction()
          Commit a persistence transaction
 org.activemq.store.MessageStore createQueueMessageStore(java.lang.String destinationName)
          Factory method to create a new queue message store with the given destination name
 org.activemq.store.TopicMessageStore createTopicMessageStore(java.lang.String destinationName)
          Factory method to create a new topic message store with the given destination name
 org.activemq.store.TransactionStore createTransactionStore()
          Factory method to create a new persistent prepared transaction store for XA recovery
 boolean deadLetterAlreadySent(long seq, boolean useDatabaseLocking)
          Verifies if a dead letter has already been sent for a message
 void doFail()
          Fails the GBean.
 void doStart()
          Starts the GBean.
 void doStop()
          Stops the target.
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 java.util.Map getInitialDestinations()
          Returns a map, indexed by String name, of all the javax.jms.Destination objects active on startup.
 void rollbackTransaction()
          Rollback a persistence transaction
 void start()
          Called to start the service
 void stop()
          Called to shutdown the service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

longTermPersistence

private final org.activemq.store.PersistenceAdapter longTermPersistence

persistenceAdapter

private SimpleCachePersistenceAdapter persistenceAdapter

cacheSize

private final int cacheSize

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

SimpleCachePersistenceAdapterGBean

public SimpleCachePersistenceAdapterGBean()

SimpleCachePersistenceAdapterGBean

public SimpleCachePersistenceAdapterGBean(org.activemq.store.PersistenceAdapter longTermPersistence,
                                          int cacheSize)
Method Detail

doStart

public void doStart()
             throws java.lang.Exception
Description copied from interface: org.apache.geronimo.gbean.GBeanLifecycle
Starts the GBean. This informs the GBean that it is about to transition to the running state.

Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle

doStop

public void doStop()
            throws java.lang.Exception
Description copied from interface: org.apache.geronimo.gbean.GBeanLifecycle
Stops the target. This informs the GBean that it is about to transition to the stopped state.

Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle

doFail

public void doFail()
Description copied from interface: org.apache.geronimo.gbean.GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()

beginTransaction

public void beginTransaction()
                      throws javax.jms.JMSException
Description copied from interface: org.activemq.store.PersistenceAdapter
This method starts a transaction on the persistent storage - which is nothing to do with JMS or XA transactions - its purely a mechanism to perform multiple writes to a persistent store in 1 transaction as a performance optimisation.

Typically one transaction will require one disk synchronization point and so for real high performance its usually faster to perform many writes within the same transaction to minimise latency caused by disk synchronization. This is especially true when using tools like Berkeley Db or embedded JDBC servers.

Specified by:
beginTransaction in interface org.activemq.store.PersistenceAdapter

commitTransaction

public void commitTransaction()
                       throws javax.jms.JMSException
Description copied from interface: org.activemq.store.PersistenceAdapter
Commit a persistence transaction

Specified by:
commitTransaction in interface org.activemq.store.PersistenceAdapter

createQueueMessageStore

public org.activemq.store.MessageStore createQueueMessageStore(java.lang.String destinationName)
                                                        throws javax.jms.JMSException
Description copied from interface: org.activemq.store.PersistenceAdapter
Factory method to create a new queue message store with the given destination name

Specified by:
createQueueMessageStore in interface org.activemq.store.PersistenceAdapter

createTopicMessageStore

public org.activemq.store.TopicMessageStore createTopicMessageStore(java.lang.String destinationName)
                                                             throws javax.jms.JMSException
Description copied from interface: org.activemq.store.PersistenceAdapter
Factory method to create a new topic message store with the given destination name

Specified by:
createTopicMessageStore in interface org.activemq.store.PersistenceAdapter

createTransactionStore

public org.activemq.store.TransactionStore createTransactionStore()
                                                           throws javax.jms.JMSException
Description copied from interface: org.activemq.store.PersistenceAdapter
Factory method to create a new persistent prepared transaction store for XA recovery

Specified by:
createTransactionStore in interface org.activemq.store.PersistenceAdapter

getInitialDestinations

public java.util.Map getInitialDestinations()
Description copied from interface: org.activemq.store.PersistenceAdapter
Returns a map, indexed by String name, of all the javax.jms.Destination objects active on startup.

Specified by:
getInitialDestinations in interface org.activemq.store.PersistenceAdapter

rollbackTransaction

public void rollbackTransaction()
Description copied from interface: org.activemq.store.PersistenceAdapter
Rollback a persistence transaction

Specified by:
rollbackTransaction in interface org.activemq.store.PersistenceAdapter

start

public void start()
           throws javax.jms.JMSException
Description copied from interface: org.activemq.service.Service
Called to start the service

Specified by:
start in interface org.activemq.service.Service

stop

public void stop()
          throws javax.jms.JMSException
Description copied from interface: org.activemq.service.Service
Called to shutdown the service

Specified by:
stop in interface org.activemq.service.Service

deadLetterAlreadySent

public boolean deadLetterAlreadySent(long seq,
                                     boolean useDatabaseLocking)
Description copied from interface: org.activemq.store.PersistenceAdapter
Verifies if a dead letter has already been sent for a message

Specified by:
deadLetterAlreadySent in interface org.activemq.store.PersistenceAdapter