messif.buckets.storage
Interface Storage<T>

Type Parameters:
T - the class of objects stored in this storage
All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IntStorage<T>, IntStorageIndexed<T>, LongStorage<T>, LongStorageIndexed<T>, StorageIndexed<T>
All Known Implementing Classes:
DatabaseStorage, DiskStorage, MemoryStorage

public interface Storage<T>
extends java.io.Serializable

Interface of a generic storage. The store(T) method stores the provided object into the storage and returns its address. This address can be used to retrieve or remove the object back at any time later.


Method Summary
 void destroy()
          Destroy this storage.
 void finalize()
          Finalize this storage.
 Address<T> store(T object)
          Stores an object in this storage.
 

Method Detail

store

Address<T> store(T object)
                 throws BucketStorageException
Stores an object in this storage. The address returned by this call can be used to retrieve or remove the object.

Parameters:
object - the object to store
Returns:
the address where the object has been stored
Throws:
BucketStorageException - if there was an error writing the data

finalize

void finalize()
              throws java.lang.Throwable
Finalize this storage. All transient resources associated with this storage are released. After this method is called, the store and retrieval methods' behavior is unpredictable.

Throws:
java.lang.Throwable - if there was an error while cleaning

destroy

void destroy()
             throws java.lang.Throwable
Destroy this storage. This method releases all resources (transient and persistent) associated with this storage. After this method is called, the store and retrieval methods' behavior is unpredictable.

Throws:
java.lang.Throwable - if there was an error while cleaning