org.infinispan.loaders.jdbc
Class DataManiulationHelper

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

public abstract class DataManiulationHelper
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
DataManiulationHelper(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()
           
static void logAndThrow(Exception e, String message)
           
abstract  void toStreamProcess(ResultSet rs, InputStream is, ObjectOutput objectOutput)
           
 void toStreamSupport(ObjectOutput objectOutput, byte streamDelimiter)
           
 
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

DataManiulationHelper

public DataManiulationHelper(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)
                           throws CacheLoaderException
Throws:
CacheLoaderException

loadAllSupport

public final Set<InternalCacheEntry> loadAllSupport()
                                             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 © 2009 JBoss, a division of Red Hat. All Rights Reserved.