public abstract class AbstractJdbcStore<K,V> extends Object implements AdvancedLoadWriteStore<K,V>, TransactionalCacheWriter<K,V>
AdvancedCacheLoader.CacheLoaderTask<K,V>, AdvancedCacheLoader.TaskContextAdvancedCacheWriter.PurgeListener<K>| Modifier and Type | Field and Description |
|---|---|
protected String |
cacheName |
protected ConnectionFactory |
connectionFactory |
protected InitializationContext |
ctx |
protected TableManager |
tableManager |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractJdbcStore(Log log) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all the data from the storage.
|
void |
commit(Transaction tx)
Commit the provided transaction's changes to the underlying store.
|
protected void |
destroyTxConnection(Transaction tx) |
ConnectionFactory |
getConnectionFactory() |
protected abstract TableManager |
getTableManager() |
protected Connection |
getTxConnection(Transaction tx) |
void |
init(InitializationContext ctx)
Used to initialize a cache loader.
|
void |
initializeConnectionFactory(ConnectionFactory connectionFactory)
Keeps a reference to the connection factory for further use.
|
protected ByteBuffer |
marshall(Object obj) |
void |
rollback(Transaction tx)
Rollback the provided transaction's changes to the underlying store.
|
void |
start()
Invoked on component start
|
void |
stop()
Invoked on component stop
|
protected <T> T |
unmarshall(InputStream inputStream) |
protected void |
waitForFutureToComplete(Future<Void> future) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocess, sizecontains, loadprepareWithModificationspurgedelete, deleteBatch, write, writeBatchprotected ConnectionFactory connectionFactory
protected TableManager tableManager
protected InitializationContext ctx
protected String cacheName
protected AbstractJdbcStore(Log log)
protected abstract TableManager getTableManager()
public void init(InitializationContext ctx)
CacheLoaderPersistenceManager
when setting up cache loaders.init in interface CacheLoader<K,V>init in interface CacheWriter<K,V>public void start()
Lifecyclepublic void stop()
Lifecyclepublic void clear()
AdvancedCacheWriterclear in interface AdvancedCacheWriter<K,V>public void commit(Transaction tx)
TransactionalCacheWritercommit in interface TransactionalCacheWriter<K,V>tx - the current transactional context.public void rollback(Transaction tx)
TransactionalCacheWriterrollback in interface TransactionalCacheWriter<K,V>tx - the current transactional context.protected Connection getTxConnection(Transaction tx)
protected void destroyTxConnection(Transaction tx)
public void initializeConnectionFactory(ConnectionFactory connectionFactory) throws PersistenceException
TableManager that needs connections. This method should be called when you don't
want the store to manage the connection factory, perhaps because it is using an shared connection factory: see
org.infinispan.persistence.jdbc.stores.mixed.JdbcMixedStore for such an example of this.PersistenceExceptionpublic ConnectionFactory getConnectionFactory()
protected ByteBuffer marshall(Object obj) throws PersistenceException, InterruptedException
protected <T> T unmarshall(InputStream inputStream) throws PersistenceException
PersistenceExceptionCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.