view src/org/dancres/blitz/arc/BackingStore.java @ 35:6f68e94c1fb8 default tip

Add CondensedStats monitoring utility, equivalent to vmstat
author Dominic Cleal <dominic-cleal@cdo2.com>
date Thu, 05 Aug 2010 11:07:25 +0100
parents 3dc0c5604566
children
line wrap: on
line source

package org.dancres.blitz.arc;

import java.io.IOException;

import org.dancres.blitz.cache.Identifiable;
import org.dancres.blitz.cache.Identifier;

/**
   Implementers of this class will be able to store and recover entities based
   on an Identifier.
 */
public interface BackingStore {
    /**
       @return Identifiable associated with Identifier or <code>null</code>
       if it cannot be found.
     */
    public Identifiable load(Identifier anId) throws IOException;

    /**
       Must deal with handling of delete, update and write.  All saves
       MUST be done asynchronously.  i.e.  ArcCache does not expect this
       method to block.  This is required to avoid the risk of deadlock under
       various circumstances.
     */
    public void save(Identifiable anIdentifiable) throws IOException;

    public String getName();
}