net.walend.lyophil
Interface Caster

All Known Implementing Classes:
JDBCCaster, MemCaster

public interface Caster

This interface provides some simple methods for working with metainformation. These should generally be used by Freezers and Trays.

Since:
20001226
Author:
David Walend

Field Summary
static java.lang.String CASTER
           
 
Method Summary
 boolean checkSetUp()
          make sure the backing storage is set up correctly
 int count()
          count the Freezables in the freezer.
 int countByClass(java.lang.Class interf)
          Count the number of freezables that implement this interf.
 Set findByClass(java.lang.Class interf)
          Returns the Set of Freezables in the Freezer that can be cast to interf.
 java.lang.Class findInterfaceForFreezable(Freezable id)
          Returns the working interface for the freezable.
 java.lang.Class findInterfaceForIdentifier(java.io.Serializable id)
          Returns the working interface for the object pointed at by identifier.
 void freeze(Freezable freezable)
          Add a freezable to the Caster's collection if it isn't already there.
 Set getAllIdentifiers()
          Get a Set containing all the identifiers in the Freezer.
 boolean isAbsent(java.io.Serializable identifier)
          Return true if identifier is available in the frozen medium.
 boolean isPresent(java.io.Serializable identifier)
          Return true if identifier is available in the frozen medium.
 void setUp()
          set up the backing storage
 void tearDown()
          clean up the backing storage
 Freezable thaw(java.io.Serializable id)
          Thaw out a freezable.
 void throwOut(java.io.Serializable id)
          Remove a freezable from the Caster's collection
 void validate(java.io.Serializable identifier, InvalidFrozenMap ife)
          Validates identifier.
 void validateAll(InvalidFrozenMap ife)
          Validates all the identifiers in the Caster.
 

Field Detail

CASTER

public static final java.lang.String CASTER
Method Detail

findInterfaceForIdentifier

public java.lang.Class findInterfaceForIdentifier(java.io.Serializable id)
                                           throws NotInFreezerException
Returns the working interface for the object pointed at by identifier.

Throws:
NotInFreezerException
PersistenceFailureException

findInterfaceForFreezable

public java.lang.Class findInterfaceForFreezable(Freezable id)
Returns the working interface for the freezable.

Throws:
ClassForRoleNotFoundException
PersistenceFailureException

freeze

public void freeze(Freezable freezable)
Add a freezable to the Caster's collection if it isn't already there.

Throws:
CannotFreezeException

thaw

public Freezable thaw(java.io.Serializable id)
               throws NotInFreezerException
Thaw out a freezable.


throwOut

public void throwOut(java.io.Serializable id)
              throws NotInFreezerException
Remove a freezable from the Caster's collection

Throws:
CannotThrowOutException
NotInFreezerException

isPresent

public boolean isPresent(java.io.Serializable identifier)
Return true if identifier is available in the frozen medium.

Throws:
PersistenceFailureException

isAbsent

public boolean isAbsent(java.io.Serializable identifier)
Return true if identifier is available in the frozen medium.

Throws:
PersistenceFailureException

validate

public void validate(java.io.Serializable identifier,
                     InvalidFrozenMap ife)
Validates identifier.


validateAll

public void validateAll(InvalidFrozenMap ife)
Validates all the identifiers in the Caster.


getAllIdentifiers

public Set getAllIdentifiers()
Get a Set containing all the identifiers in the Freezer.


count

public int count()
count the Freezables in the freezer.


countByClass

public int countByClass(java.lang.Class interf)
Count the number of freezables that implement this interf.


findByClass

public Set findByClass(java.lang.Class interf)
Returns the Set of Freezables in the Freezer that can be cast to interf.

Throws:
PersistenceFailureException

checkSetUp

public boolean checkSetUp()
make sure the backing storage is set up correctly

Throws:
PersistenceFailureException

setUp

public void setUp()
set up the backing storage

Throws:
PersistenceFailureException

tearDown

public void tearDown()
clean up the backing storage

Throws:
PersistenceFailureException


Copyright (c) 2000, 2001, David Walend