net.walend.lyophil
Interface Frozen


public interface Frozen

An optional interface for the back-end storage peers. If each Freezable objects all corrispond with an object on the back-end, then this interface can help. All methods throw RemoteExceptions due to EJB's bad habits.

Since:
20001125
Author:
David Walend

Method Summary
 void freezeFreezable(Freezable object)
          Puts the Freezable in cold storage.
 java.io.Serializable getIdentifier()
          Get the identifier for this instance.
 boolean isFrozenAvailable()
           
 boolean representedBy(Freezable object)
          Returns true if this Frozen is represented by the Freezable object.
 Freezable thawFreezable()
          Gets a Freezable out of cold storage.
 void throwOut()
          Remove a frozen instance from cold storage
 

Method Detail

getIdentifier

public java.io.Serializable getIdentifier()
                                   throws java.rmi.RemoteException
Get the identifier for this instance. I've always used a Long, but the ejb spec says it can be anything. Try to use something immutable. Note that you will only have this Object plus metadetails of the class to use for identifier information. All you should need is the identifier.


isFrozenAvailable

public boolean isFrozenAvailable()
                          throws java.rmi.RemoteException

freezeFreezable

public void freezeFreezable(Freezable object)
                     throws java.rmi.RemoteException
Puts the Freezable in cold storage.

Throws:
MismatchedIdentifierException - if the Freezable's identifier doesn't match this object's.
CannotFreezeException - if the Freezable can't be frozen for another reason
java.rmi.RemoteException

thawFreezable

public Freezable thawFreezable()
                        throws java.rmi.RemoteException
Gets a Freezable out of cold storage. Normally, this should be a new instance of a previously frozen Freezable.

Throws:
CannotThawException
java.rmi.RemoteException

throwOut

public void throwOut()
              throws java.rmi.RemoteException
Remove a frozen instance from cold storage

Throws:
CannotThrowOutException
java.rmi.RemoteException

representedBy

public boolean representedBy(Freezable object)
                      throws java.rmi.RemoteException
Returns true if this Frozen is represented by the Freezable object.



Copyright (c) 2000, 2001, David Walend