|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface creates new Freezable objects that fulfil a given named role and interface.
An instance of Mother will let you easily swap the implementation of the Freezable.
Implementations of Mother should freeze the Freezable they create immediately after they create it. This step will allow Diggers and Freezers to find the Freezable.
Field Summary | |
static java.lang.String |
BEAN
|
static java.lang.String |
INTERFACE
|
static java.lang.String |
PREFIX
|
static java.lang.String |
ROLE
|
Method Summary | |
Freezable |
createEvilClone(Freezable freezy,
java.lang.String role)
Create a copy as a new instance with a new identifier. |
Freezable |
createNewInstance(java.lang.String role)
Create a new instance of a class for the given role wanted. |
Freezable |
createNewInstance(java.lang.String role,
java.lang.Object[] parameters)
Create a new instance of a class for the given role wanted. |
java.lang.Class |
getInterfaceForBeanClass(java.lang.Class beanClass)
|
java.lang.Class |
getInterfaceForRole(java.lang.String role)
|
Set |
getInterfaces()
|
java.lang.String |
getRoleForInterface(java.lang.Class interf)
|
void |
postCreate(Freezable freezable,
Mother caller)
Mothers should call this method after creating a new instance of a Freezable. |
Freezable |
restoreNewInstance(java.lang.String role,
java.io.Serializable id)
Only call this method from inside a Freezer. |
Freezable |
restoreNewInstance(java.lang.String role,
java.io.Serializable id,
java.lang.Object[] parameters)
Only call this method from inside a Freezer. |
Field Detail |
public static final java.lang.String ROLE
public static final java.lang.String PREFIX
public static final java.lang.String BEAN
public static final java.lang.String INTERFACE
Method Detail |
public java.lang.Class getInterfaceForBeanClass(java.lang.Class beanClass)
public Set getInterfaces()
public java.lang.Class getInterfaceForRole(java.lang.String role)
public java.lang.String getRoleForInterface(java.lang.Class interf)
public Freezable createNewInstance(java.lang.String role)
implementations should call postCreate(new freezable,this);
role
- the role that the Freezable should implementCannotCreateException
public Freezable createNewInstance(java.lang.String role, java.lang.Object[] parameters)
implementations should call postCreate(new freezable,this);
role
- the role that the Freezable should implementparameters
- for the object's constructor.CannotCreateException
public Freezable createEvilClone(Freezable freezy, java.lang.String role)
implementations should call postCreate(new freezable,this);
freezy
- the Freezable to copy.CannotCreateException
public void postCreate(Freezable freezable, Mother caller)
public Freezable restoreNewInstance(java.lang.String role, java.io.Serializable id)
role
- the role that the Freezable should implementCannotThawException
public Freezable restoreNewInstance(java.lang.String role, java.io.Serializable id, java.lang.Object[] parameters)
role
- the role that the Freezable should implementid
- the identifier of this Freezableparameters
- for the object's constructor.CannotThawException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |