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, InMemoryObjectStore, JdbcObjectStore, ManagedObjectStore, MonitoredObjectStoreWrapper, ObjectStorePartition, PartitionedInMemoryObjectStore, PartitionedObjectStoreWrapper, PartitionedPersistentObjectStore, QueuePersistenceObjectStore, QueueStoreAdapter, SimpleMemoryObjectStore, TextFileObjectStore

public interface ObjectStore<T extends Serializable>


Method Summary
 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


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