org.apache.activemq.kaha.impl.data
Class DataManagerImpl

java.lang.Object
  extended by org.apache.activemq.kaha.impl.data.DataManagerImpl
All Implemented Interfaces:
DataManager

public final class DataManagerImpl
extends Object
implements DataManager

Manages DataFiles


Field Summary
static byte DATA_ITEM_TYPE
           
static int ITEM_HEAD_SIZE
           
static long MAX_FILE_LENGTH
           
static byte REDO_ITEM_TYPE
           
 
Constructor Summary
DataManagerImpl(File dir, String name, AtomicLong storeSize)
           
 
Method Summary
 void addInterestInFile(int file)
           
 void close()
           
 void consolidateDataFiles()
           
protected  SyncDataFileReader createReader()
           
 boolean delete()
           
 void force()
           
 long getMaxFileLength()
           
 String getName()
           
 SyncDataFileReader getReader()
           
 Marshaller getRedoMarshaller()
           
 SyncDataFileWriter getWriter()
           
 Object readItem(Marshaller marshaller, StoreLocation item)
           
 void recoverRedoItems(RedoListener listener)
           
 void removeInterestInFile(int file)
           
 void setMaxFileLength(long maxFileLength)
           
 void setReader(SyncDataFileReader reader)
           
 void setRedoMarshaller(Marshaller redoMarshaller)
           
 void setWriter(SyncDataFileWriter writer)
           
 StoreLocation storeDataItem(Marshaller marshaller, Object payload)
           
 StoreLocation storeRedoItem(Object payload)
           
 String toString()
           
 void updateItem(StoreLocation location, Marshaller marshaller, Object payload)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ITEM_HEAD_SIZE

public static final int ITEM_HEAD_SIZE
See Also:
Constant Field Values

DATA_ITEM_TYPE

public static final byte DATA_ITEM_TYPE
See Also:
Constant Field Values

REDO_ITEM_TYPE

public static final byte REDO_ITEM_TYPE
See Also:
Constant Field Values

MAX_FILE_LENGTH

public static final long MAX_FILE_LENGTH
See Also:
Constant Field Values
Constructor Detail

DataManagerImpl

public DataManagerImpl(File dir,
                       String name,
                       AtomicLong storeSize)
Method Detail

getName

public String getName()
Specified by:
getName in interface DataManager

readItem

public Object readItem(Marshaller marshaller,
                       StoreLocation item)
                throws IOException
Specified by:
readItem in interface DataManager
Throws:
IOException

storeDataItem

public StoreLocation storeDataItem(Marshaller marshaller,
                                   Object payload)
                            throws IOException
Specified by:
storeDataItem in interface DataManager
Throws:
IOException

storeRedoItem

public StoreLocation storeRedoItem(Object payload)
                            throws IOException
Specified by:
storeRedoItem in interface DataManager
Throws:
IOException

updateItem

public void updateItem(StoreLocation location,
                       Marshaller marshaller,
                       Object payload)
                throws IOException
Specified by:
updateItem in interface DataManager
Throws:
IOException

recoverRedoItems

public void recoverRedoItems(RedoListener listener)
                      throws IOException
Specified by:
recoverRedoItems in interface DataManager
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface DataManager
Throws:
IOException

force

public void force()
           throws IOException
Specified by:
force in interface DataManager
Throws:
IOException

delete

public boolean delete()
               throws IOException
Specified by:
delete in interface DataManager
Throws:
IOException

addInterestInFile

public void addInterestInFile(int file)
                       throws IOException
Specified by:
addInterestInFile in interface DataManager
Throws:
IOException

removeInterestInFile

public void removeInterestInFile(int file)
                          throws IOException
Specified by:
removeInterestInFile in interface DataManager
Throws:
IOException

consolidateDataFiles

public void consolidateDataFiles()
                          throws IOException
Specified by:
consolidateDataFiles in interface DataManager
Throws:
IOException

getRedoMarshaller

public Marshaller getRedoMarshaller()
Specified by:
getRedoMarshaller in interface DataManager

setRedoMarshaller

public void setRedoMarshaller(Marshaller redoMarshaller)
Specified by:
setRedoMarshaller in interface DataManager

getMaxFileLength

public long getMaxFileLength()
Returns:
the maxFileLength

setMaxFileLength

public void setMaxFileLength(long maxFileLength)
Parameters:
maxFileLength - the maxFileLength to set

toString

public String toString()
Overrides:
toString in class Object

getReader

public SyncDataFileReader getReader()

createReader

protected SyncDataFileReader createReader()

setReader

public void setReader(SyncDataFileReader reader)

getWriter

public SyncDataFileWriter getWriter()

setWriter

public void setWriter(SyncDataFileWriter writer)


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.