net.walend.lyophil.memory
Class MemFreezer

java.lang.Object
  |
  +--net.walend.lyophil.memory.MemFreezer
All Implemented Interfaces:
Freezer, java.io.Serializable

public class MemFreezer
extends java.lang.Object
implements Freezer, java.io.Serializable

A freezer for beans stored in a Map in jvm memory.

Since:
20001230
Author:
David Walend

Field Summary
 
Fields inherited from interface net.walend.lyophil.Freezer
ROLE
 
Constructor Summary
MemFreezer()
           
 
Method Summary
 int count()
          Returns the number of elements in this collection.
 void freeze(Freezable victem)
          Freeze and thaw methods in MemFreezer always return the same instance of the object.
 SetOfFreezables getAll()
          Returns a lyophilizer.collection.Set of Freezables.
protected  MemStorage getStorage()
           
 boolean isAvailable(java.io.Serializable identifier)
          Return true if identifier is available in the freezer
 boolean isEmpty()
          Returns true if this collection contains no elements.
 Freezable thaw(java.io.Serializable identifier)
          Freeze and thaw methods in MemFreezer always return the same instance of the object.
 void throwOut(java.io.Serializable identifier)
          Remote the Freezable identified by identifier from the persistent storage
 void throwOutAll()
          Throw out everything in the Freezer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemFreezer

public MemFreezer()
Method Detail

getStorage

protected MemStorage getStorage()

freeze

public void freeze(Freezable victem)
Freeze and thaw methods in MemFreezer always return the same instance of the object. This behavior is appropirate for client object caches, but not for safe transactions.

Specified by:
freeze in interface Freezer

thaw

public Freezable thaw(java.io.Serializable identifier)
               throws NotInFreezerException
Freeze and thaw methods in MemFreezer always return the same instance of the object. This behavior is appropirate for client object caches, but not for safe transactions.

Specified by:
thaw in interface Freezer

throwOut

public void throwOut(java.io.Serializable identifier)
              throws NotInFreezerException
Description copied from interface: Freezer
Remote the Freezable identified by identifier from the persistent storage

Specified by:
throwOut in interface Freezer

isAvailable

public boolean isAvailable(java.io.Serializable identifier)
Description copied from interface: Freezer
Return true if identifier is available in the freezer

Specified by:
isAvailable in interface Freezer

throwOutAll

public void throwOutAll()
Description copied from interface: Freezer
Throw out everything in the Freezer.

Specified by:
throwOutAll in interface Freezer

getAll

public SetOfFreezables getAll()
Description copied from interface: Freezer
Returns a lyophilizer.collection.Set of Freezables.

Specified by:
getAll in interface Freezer

count

public int count()
Description copied from interface: Freezer
Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Specified by:
count in interface Freezer

isEmpty

public boolean isEmpty()
Returns true if this collection contains no elements.

Specified by:
isEmpty in interface Freezer


Copyright (c) 2000, 2001, David Walend