net.walend.lyophil.memory
Class MemCaster

java.lang.Object
  |
  +--net.walend.lyophil.memory.MemCaster
All Implemented Interfaces:
Caster

public class MemCaster
extends java.lang.Object
implements Caster

This class implements a simple Caster for memory based systems. Warning!!! This implementation calls on the Freezer, so don't use it inside the Freezer. It's fine for inside a Digger.

Since:
20001216
Author:
David Walend

Field Summary
 
Fields inherited from interface net.walend.lyophil.Caster
CASTER
 
Constructor Summary
MemCaster()
           
 
Method Summary
 boolean checkSetUp()
          make sure the backing storage is set up correctly
 int count()
          Warning!!! asks the Freezer.
 int countByClass(java.lang.Class interf)
          Warning!!! asks the Freezer.
 Set findByClass(java.lang.Class interf)
          Warning!!! asks the Freezer.
 java.lang.Class findInterfaceForFreezable(Freezable freezable)
          Returns the working interface for the freezable.
private  java.lang.Class findInterfaceForFreezableFromProperties(Freezable freezable)
           
 java.lang.Class findInterfaceForIdentifier(java.io.Serializable id)
          Warning!! This method asks the Freezer for the Freezable.
 void freeze(Freezable freezable)
          Does nothing.
 Set getAllIdentifiers()
          Warning!!! asks the Freezer.
protected  Mother getMother()
           
protected  PropertySource getPropertySource()
           
protected  MemStorage getStorage()
           
 boolean isAbsent(java.io.Serializable identifier)
          Warning!!! asks the Freezer.
 boolean isPresent(java.io.Serializable identifier)
          Warning!!! asks the Freezer.
 void setUp()
          set up the backing storage
 void tearDown()
          clean up the backing storage
 Freezable thaw(java.io.Serializable id)
          Does nothing
 void throwOut(java.io.Serializable id)
          Does nothing.
 void validate(java.io.Serializable id, InvalidFrozenMap ife)
          Validates identifier.
 void validateAll(InvalidFrozenMap ife)
          Validates all the identifiers in the Caster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemCaster

public MemCaster()
Method Detail

getStorage

protected MemStorage getStorage()

getMother

protected Mother getMother()

getPropertySource

protected PropertySource getPropertySource()

findInterfaceForIdentifier

public java.lang.Class findInterfaceForIdentifier(java.io.Serializable id)
                                           throws NotInFreezerException
Warning!! This method asks the Freezer for the Freezable.

Specified by:
findInterfaceForIdentifier in interface Caster

findInterfaceForFreezableFromProperties

private java.lang.Class findInterfaceForFreezableFromProperties(Freezable freezable)

findInterfaceForFreezable

public java.lang.Class findInterfaceForFreezable(Freezable freezable)
Description copied from interface: Caster
Returns the working interface for the freezable.

Specified by:
findInterfaceForFreezable in interface Caster

freeze

public void freeze(Freezable freezable)
Does nothing.

Specified by:
freeze in interface Caster

thaw

public Freezable thaw(java.io.Serializable id)
               throws NotInFreezerException
Does nothing

Specified by:
thaw in interface Caster

throwOut

public void throwOut(java.io.Serializable id)
              throws NotInFreezerException
Does nothing.

Specified by:
throwOut in interface Caster

validate

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

Specified by:
validate in interface Caster

validateAll

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

Specified by:
validateAll in interface Caster

isAbsent

public boolean isAbsent(java.io.Serializable identifier)
Warning!!! asks the Freezer.

Specified by:
isAbsent in interface Caster

isPresent

public boolean isPresent(java.io.Serializable identifier)
Warning!!! asks the Freezer.

Specified by:
isPresent in interface Caster

getAllIdentifiers

public Set getAllIdentifiers()
Warning!!! asks the Freezer.

Specified by:
getAllIdentifiers in interface Caster

count

public int count()
Warning!!! asks the Freezer.

Specified by:
count in interface Caster

countByClass

public int countByClass(java.lang.Class interf)
Warning!!! asks the Freezer.

Specified by:
countByClass in interface Caster

findByClass

public Set findByClass(java.lang.Class interf)
Warning!!! asks the Freezer.

Specified by:
findByClass in interface Caster

checkSetUp

public boolean checkSetUp()
Description copied from interface: Caster
make sure the backing storage is set up correctly

Specified by:
checkSetUp in interface Caster

setUp

public void setUp()
Description copied from interface: Caster
set up the backing storage

Specified by:
setUp in interface Caster

tearDown

public void tearDown()
Description copied from interface: Caster
clean up the backing storage

Specified by:
tearDown in interface Caster


Copyright (c) 2000, 2001, David Walend