org.mule.api.store
Interface ObjectStore<T extends Serializable>

All Known Subinterfaces:
ExpirableObjectStore<T>, ListableObjectStore<T>, PartitionableExpirableObjectStore<T>, PartitionableObjectStore<T>, QueueStore<T>
All Known Implementing Classes:
AbstractMonitoredObjectStore, AbstractObjectStore, AbstractPartitionedObjectStore, FakeObjectStore, InMemoryObjectStore, JdbcObjectStore, ManagedObjectStore, MonitoredObjectStoreWrapper, ObjectStorePartition, PartitionedInMemoryObjectStore, PartitionedObjectStoreWrapper, PartitionedPersistentObjectStore, PersistentObjectStorePartition, QueuePersistenceObjectStore, QueueStoreAdapter, SimpleMemoryObjectStore, TextFileObjectStore

public interface ObjectStore<T extends Serializable>


Method Summary
 void clear()
          Removes all items of this store without disposing it, meaning that after performing a clear(), you should still be able perform other operations.
 boolean contains(Serializable key)
          Check whether the given Object is already registered with this store.
 boolean isPersistent()
          Is this store persistent?
 T remove(Serializable key)
          Remove the object with key.
 T retrieve(Serializable key)
          Retrieve the given Object.
 void store(Serializable key, T value)
          Store the given Object.
 

Method Detail

contains

boolean contains(Serializable key)
                 throws ObjectStoreException
Check whether the given Object is already registered with this store.

Parameters:
key - the identifier of the object to check
Returns:
true if the key is stored or false no value was stored for the key.
Throws:
ObjectStoreException - if the given key is null.
ObjectStoreNotAvaliableException - if any implementation-specific error occured, e.g. when the store is not available

store

void store(Serializable key,
           T value)
           throws ObjectStoreException
Store the given Object.

Parameters:
key - the identifier for value
value - the Object to store with key
Throws:
ObjectStoreException - if the given key cannot be stored or is null.
ObjectStoreNotAvaliableException - if the store is not available or any other implementation-specific error occured.
ObjectAlreadyExistsException - if an attempt is made to store an object for a key that already has an object associated.

retrieve

T retrieve(Serializable key)
                                throws ObjectStoreException
Retrieve the given Object.

Parameters:
key - the identifier of the object to retrieve.
Returns:
the object associated with the given key. If no object for the given key was found this method throws an ObjectDoesNotExistException.
Throws:
ObjectStoreException - if the given key is null.
ObjectStoreNotAvaliableException - if the store is not available or any other implementation-specific error occured.
ObjectDoesNotExistException - if no value for the given key was previously stored.

remove

T remove(Serializable key)
                              throws ObjectStoreException
Remove the object with key.

Parameters:
key - the identifier of the object to remove.
Returns:
the object that was previously stored for the given key
Throws:
ObjectStoreException - if the given key is null or if the store is not available or any other implementation-specific error occured
ObjectDoesNotExistException - if no value for the given key was previously stored.

isPersistent

boolean isPersistent()
Is this store persistent?

Returns:
true if this store is persistent

clear

void clear()
           throws ObjectStoreException
Removes all items of this store without disposing it, meaning that after performing a clear(), you should still be able perform other operations. Implementations of this method have to remove all items in the fastest way possible. No assumptions should be made regarding thread safeness. If the store implementation is thread-safe, then this method should also be. If the implementation does not guarantee thread-safeness, then you shouldn't expect that from this method either.

Throws:
ObjectStoreException - if the operation fails


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.