jfun.yan.lifecycle
Class Lifecycle

java.lang.Object
  extended by jfun.yan.lifecycle.Lifecycle
All Implemented Interfaces:
java.io.Serializable, Life
Direct Known Subclasses:
DefaultLifecycleManager.DefaultLifecycle

public class Lifecycle
extends java.lang.Object
implements Life, java.io.Serializable

This class represents the entire life-cycle for a component.

Zephyr Business Solution

Author:
Michelle Lei
See Also:
Serialized Form

Nested Class Summary
static class Lifecycle.Entry
          This class encapsulates the "what-to-do" information for a life-cycle phase.
 
Constructor Summary
Lifecycle()
           
 
Method Summary
 LiveObject bear(java.lang.Object obj)
          To create a LiveObject for a regular Java object.
 java.util.Collection entries()
          To get all the entries.
 Lifecycle.Entry get(java.lang.Object key)
          To get a phase entry.
 boolean isEmpty()
          Is any life-cycle phase defined at all?
 java.util.Set keys()
          To get all the phase keys.
 void put(java.lang.Object key, Procedure proc, boolean reentrant)
          To add a phase.
 void remove(java.lang.Object key)
          To remove a phase definition.
 int size()
          To get the number of phases defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lifecycle

public Lifecycle()
Method Detail

isEmpty

public boolean isEmpty()
Is any life-cycle phase defined at all?


size

public int size()
To get the number of phases defined.


put

public void put(java.lang.Object key,
                Procedure proc,
                boolean reentrant)
To add a phase.

Parameters:
key - the key of the phase.
proc - the procedure to invoke for the phase.
reentrant - is the procedure re-entrant?

remove

public void remove(java.lang.Object key)
To remove a phase definition.

Parameters:
key - the key of the phase.

get

public Lifecycle.Entry get(java.lang.Object key)
To get a phase entry.

Parameters:
key - the key of the phase.
Returns:
the Entry object.

keys

public java.util.Set keys()
To get all the phase keys.


entries

public java.util.Collection entries()
To get all the entries.


bear

public LiveObject bear(java.lang.Object obj)
Description copied from interface: Life
To create a LiveObject for a regular Java object.

Specified by:
bear in interface Life
Parameters:
obj - the regular java object.
Returns:
the LiveObject.