org.infinispan.loaders.jdbc
Class DataManipulationHelper

java.lang.Object
  extended by org.infinispan.loaders.jdbc.DataManipulationHelper

public abstract class DataManipulationHelper
extends Object

The purpose of this class is to factorize the repeating code between JdbcStringBasedCacheStore and JdbcBinaryCacheStore. This class implements GOF's template method pattern.

Author:
Mircea.Markus@jboss.com

Field Summary
protected  Marshaller marshaller
           
 
Constructor Summary
DataManipulationHelper(ConnectionFactory connectionFactory, TableManipulation tableManipulation, Marshaller marshaller)
           
 
Method Summary
 void clear()
           
abstract  boolean fromStreamProcess(Object objFromStream, PreparedStatement ps, ObjectInput objectInput)
           
 void fromStreamSupport(ObjectInput objectInput)
           
abstract  void loadAllProcess(ResultSet rs, Set<InternalCacheEntry> result)
           
 Set<InternalCacheEntry> loadAllSupport(boolean filterExpired)
           
static void logAndThrow(Exception e, String message)
           
abstract  void toStreamProcess(ResultSet rs, InputStream is, ObjectOutput objectOutput)
           
 void toStreamSupport(ObjectOutput objectOutput, byte streamDelimiter, boolean filterExpired)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

marshaller

protected Marshaller marshaller
Constructor Detail

DataManipulationHelper

public DataManipulationHelper(ConnectionFactory connectionFactory,
                              TableManipulation tableManipulation,
                              Marshaller marshaller)
Method Detail

clear

public void clear()
           throws CacheLoaderException
Throws:
CacheLoaderException

fromStreamSupport

public final void fromStreamSupport(ObjectInput objectInput)
                             throws CacheLoaderException
Throws:
CacheLoaderException

toStreamSupport

public final void toStreamSupport(ObjectOutput objectOutput,
                                  byte streamDelimiter,
                                  boolean filterExpired)
                           throws CacheLoaderException
Throws:
CacheLoaderException

loadAllSupport

public final Set<InternalCacheEntry> loadAllSupport(boolean filterExpired)
                                             throws CacheLoaderException
Throws:
CacheLoaderException

loadAllProcess

public abstract void loadAllProcess(ResultSet rs,
                                    Set<InternalCacheEntry> result)
                             throws SQLException,
                                    CacheLoaderException
Throws:
SQLException
CacheLoaderException

toStreamProcess

public abstract void toStreamProcess(ResultSet rs,
                                     InputStream is,
                                     ObjectOutput objectOutput)
                              throws CacheLoaderException,
                                     SQLException,
                                     IOException
Throws:
CacheLoaderException
SQLException
IOException

fromStreamProcess

public abstract boolean fromStreamProcess(Object objFromStream,
                                          PreparedStatement ps,
                                          ObjectInput objectInput)
                                   throws SQLException,
                                          CacheLoaderException,
                                          IOException,
                                          ClassNotFoundException
Throws:
SQLException
CacheLoaderException
IOException
ClassNotFoundException

logAndThrow

public static void logAndThrow(Exception e,
                               String message)
                        throws CacheLoaderException
Throws:
CacheLoaderException

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.