org.activemq.store.jdbc.adapter
Class DefaultJDBCAdapter
java.lang.Object
org.activemq.store.jdbc.adapter.DefaultJDBCAdapter
- All Implemented Interfaces:
- JDBCAdapter
- Direct Known Subclasses:
- BlobJDBCAdapter, BytesJDBCAdapter, ImageBasedJDBCAdaptor, OracleJDBCAdapter, StreamJDBCAdapter
- public class DefaultJDBCAdapter
- extends Object
- implements JDBCAdapter
Implements all the default JDBC operations that are used
by the JDBCPersistenceAdapter.
Subclassing is encouraged to override the default
implementation of methods to account for differences
in JDBC Driver implementations.
The JDBCAdapter inserts and extracts BLOB data using the
getBytes()/setBytes() operations.
The databases/JDBC drivers that use this adapter are:
- Version:
- $Revision: 1.1 $
Method Summary |
void |
doAddMessage(Connection c,
long seq,
String messageID,
String destinationName,
byte[] data,
long expiration)
|
void |
doAddXid(Connection c,
ActiveMQXid xid)
|
void |
doCreateTables(Connection c)
|
void |
doDeleteExpiredMessage(Connection c,
MessageIdentity messageIdentity)
|
void |
doDeleteOldMessages(Connection c)
|
void |
doDeleteSubscription(Connection c,
String destinationName,
String subscription)
|
void |
doDropTables(Connection c)
|
void |
doGetExpiredMessages(Connection c,
JDBCAdapter.ExpiredMessageResultHandler handler)
|
byte[] |
doGetMessage(Connection c,
long seq)
|
void |
doGetMessageForUpdate(Connection c,
long seq,
boolean useLocking,
JDBCAdapter.ExpiredMessageResultHandler handler)
|
SubscriberEntry |
doGetSubscriberEntry(Connection c,
String destinationName,
String sub)
|
void |
doLoadPreparedTransactions(Connection c,
TransactionStore.RecoveryListener listener)
|
void |
doRecover(Connection c,
String destinationName,
JDBCAdapter.MessageListResultHandler listener)
|
void |
doRecoverSubscription(Connection c,
String destinationName,
String subscriptionID,
JDBCAdapter.MessageListResultHandler listener)
|
void |
doRemoveAllMessages(Connection c,
String destinationName)
|
void |
doRemoveMessage(Connection c,
long seq)
|
void |
doRemoveXid(Connection c,
ActiveMQXid xid)
|
void |
doSetDeadLetterFlag(Connection c,
long seq)
|
void |
doSetLastAck(Connection c,
String destinationName,
String subscriptionID,
long seq)
|
void |
doSetSubscriberEntry(Connection c,
String destinationName,
String sub,
SubscriberEntry subscriberEntry)
|
protected byte[] |
getBinaryData(ResultSet rs,
int index)
|
Long |
getMessageSequenceId(Connection c,
String messageID)
|
LongSequenceGenerator |
getSequenceGenerator()
|
StatementProvider |
getStatementProvider()
|
void |
initSequenceGenerator(Connection c)
|
protected void |
setBinaryData(PreparedStatement s,
int index,
byte[] data)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
statementProvider
protected final StatementProvider statementProvider
sequenceGenerator
protected LongSequenceGenerator sequenceGenerator
DefaultJDBCAdapter
public DefaultJDBCAdapter(StatementProvider provider)
- Parameters:
provider
-
DefaultJDBCAdapter
public DefaultJDBCAdapter()
setBinaryData
protected void setBinaryData(PreparedStatement s,
int index,
byte[] data)
throws SQLException
- Throws:
SQLException
getBinaryData
protected byte[] getBinaryData(ResultSet rs,
int index)
throws SQLException
- Throws:
SQLException
getSequenceGenerator
public LongSequenceGenerator getSequenceGenerator()
- Specified by:
getSequenceGenerator
in interface JDBCAdapter
doCreateTables
public void doCreateTables(Connection c)
throws SQLException
- Specified by:
doCreateTables
in interface JDBCAdapter
- Throws:
SQLException
doDropTables
public void doDropTables(Connection c)
throws SQLException
- Specified by:
doDropTables
in interface JDBCAdapter
- Throws:
SQLException
initSequenceGenerator
public void initSequenceGenerator(Connection c)
- Specified by:
initSequenceGenerator
in interface JDBCAdapter
doAddMessage
public void doAddMessage(Connection c,
long seq,
String messageID,
String destinationName,
byte[] data,
long expiration)
throws SQLException,
JMSException
- Specified by:
doAddMessage
in interface JDBCAdapter
- Throws:
SQLException
JMSException
getMessageSequenceId
public Long getMessageSequenceId(Connection c,
String messageID)
throws SQLException,
JMSException
- Specified by:
getMessageSequenceId
in interface JDBCAdapter
- Throws:
SQLException
JMSException
doGetMessage
public byte[] doGetMessage(Connection c,
long seq)
throws SQLException
- Specified by:
doGetMessage
in interface JDBCAdapter
- Throws:
SQLException
doGetMessageForUpdate
public void doGetMessageForUpdate(Connection c,
long seq,
boolean useLocking,
JDBCAdapter.ExpiredMessageResultHandler handler)
throws SQLException,
JMSException
- Specified by:
doGetMessageForUpdate
in interface JDBCAdapter
- Throws:
SQLException
JMSException
doSetDeadLetterFlag
public void doSetDeadLetterFlag(Connection c,
long seq)
throws SQLException,
JMSException
- Specified by:
doSetDeadLetterFlag
in interface JDBCAdapter
- Throws:
SQLException
JMSException
doRemoveMessage
public void doRemoveMessage(Connection c,
long seq)
throws SQLException
- Specified by:
doRemoveMessage
in interface JDBCAdapter
- Throws:
SQLException
doRecover
public void doRecover(Connection c,
String destinationName,
JDBCAdapter.MessageListResultHandler listener)
throws SQLException,
JMSException
- Specified by:
doRecover
in interface JDBCAdapter
- Throws:
SQLException
JMSException
doRemoveXid
public void doRemoveXid(Connection c,
ActiveMQXid xid)
throws SQLException,
XAException
- Specified by:
doRemoveXid
in interface JDBCAdapter
- Throws:
SQLException
XAException
doAddXid
public void doAddXid(Connection c,
ActiveMQXid xid)
throws SQLException,
XAException
- Specified by:
doAddXid
in interface JDBCAdapter
- Throws:
SQLException
XAException
doLoadPreparedTransactions
public void doLoadPreparedTransactions(Connection c,
TransactionStore.RecoveryListener listener)
throws SQLException
- Specified by:
doLoadPreparedTransactions
in interface JDBCAdapter
- Throws:
SQLException
doSetLastAck
public void doSetLastAck(Connection c,
String destinationName,
String subscriptionID,
long seq)
throws SQLException,
JMSException
- Specified by:
doSetLastAck
in interface JDBCAdapter
- Throws:
JMSException
SQLException
- See Also:
JDBCAdapter.doSetLastAck(java.sql.Connection, java.lang.String, java.lang.String, long)
doRecoverSubscription
public void doRecoverSubscription(Connection c,
String destinationName,
String subscriptionID,
JDBCAdapter.MessageListResultHandler listener)
throws SQLException,
JMSException
- Specified by:
doRecoverSubscription
in interface JDBCAdapter
- Throws:
JMSException
SQLException
- See Also:
JDBCAdapter.doRecoverSubscription(java.sql.Connection, java.lang.String, java.lang.String, org.activemq.store.jdbc.JDBCAdapter.MessageListResultHandler)
doSetSubscriberEntry
public void doSetSubscriberEntry(Connection c,
String destinationName,
String sub,
SubscriberEntry subscriberEntry)
throws SQLException
- Specified by:
doSetSubscriberEntry
in interface JDBCAdapter
- Throws:
SQLException
- See Also:
org.activemq.store.jdbc.JDBCAdapter#doSetSubscriberEntry(java.sql.Connection, java.lang.Object, org.activemq.service.SubscriberEntry)
doGetSubscriberEntry
public SubscriberEntry doGetSubscriberEntry(Connection c,
String destinationName,
String sub)
throws SQLException
- Specified by:
doGetSubscriberEntry
in interface JDBCAdapter
- Throws:
SQLException
- See Also:
org.activemq.store.jdbc.JDBCAdapter#doGetSubscriberEntry(java.sql.Connection, java.lang.Object)
doRemoveAllMessages
public void doRemoveAllMessages(Connection c,
String destinationName)
throws SQLException,
JMSException
- Specified by:
doRemoveAllMessages
in interface JDBCAdapter
- Throws:
SQLException
JMSException
doDeleteSubscription
public void doDeleteSubscription(Connection c,
String destinationName,
String subscription)
throws SQLException,
JMSException
- Specified by:
doDeleteSubscription
in interface JDBCAdapter
- Throws:
SQLException
JMSException
doDeleteOldMessages
public void doDeleteOldMessages(Connection c)
throws SQLException,
JMSException
- Specified by:
doDeleteOldMessages
in interface JDBCAdapter
- Throws:
SQLException
JMSException
doGetExpiredMessages
public void doGetExpiredMessages(Connection c,
JDBCAdapter.ExpiredMessageResultHandler handler)
throws SQLException,
JMSException
- Specified by:
doGetExpiredMessages
in interface JDBCAdapter
- Throws:
SQLException
JMSException
doDeleteExpiredMessage
public void doDeleteExpiredMessage(Connection c,
MessageIdentity messageIdentity)
throws SQLException,
JMSException
- Specified by:
doDeleteExpiredMessage
in interface JDBCAdapter
- Throws:
SQLException
JMSException
getStatementProvider
public StatementProvider getStatementProvider()
- Specified by:
getStatementProvider
in interface JDBCAdapter
Copyright © 2004-2007 Protique, Ltd.. All Rights Reserved.