|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AdapterManager
Responsible for managing the adapters and identities for each and every
POJO that is being used by the framework.
It provides a consistent set of adapters in memory, providing an adapter for the POJOs
that are in use ensuring that the same object is not loaded twice into memory.
Each POJO is given an adapter so that the framework can work with the POJOs even though
it does not understand their types. Each POJO maps to an adapter and these are reused.
| Method Summary | |
|---|---|
NakedObject |
adapterFor(java.lang.Object pojo)
Either returns an existing adapter (as per AdapterManagerLookup.getAdapterFor(Object)), otherwise creates either a
transient root or a standalone adapter for the supplied domain object, depending on
its NakedObjectSpecification. |
NakedObject |
adapterFor(java.lang.Object pojo,
NakedObject ownerAdapter,
Identified identified)
Either returns an existing adapter (as per AdapterManagerLookup.getAdapterFor(Object)), otherwise creates either a
transient, standalone or aggregated adapter for the supplied domain object,
depending on its NakedObjectSpecification and the context arguments provided. |
void |
removeAdapter(NakedObject adapter)
Removes the specified adapter from the identity maps. |
void |
removeAdapter(Oid oid)
Removes the adapter identified by the specified Oid. |
| Methods inherited from interface org.nakedobjects.runtime.persistence.adaptermanager.AdapterManagerLookup |
|---|
getAdapterFor, getAdapterFor |
| Methods inherited from interface org.nakedobjects.metamodel.commons.component.Injectable |
|---|
injectInto |
| Method Detail |
|---|
NakedObject adapterFor(java.lang.Object pojo,
NakedObject ownerAdapter,
Identified identified)
AdapterManagerLookup.getAdapterFor(Object)), otherwise creates either a
transient, standalone or aggregated adapter for the supplied domain object,
depending on its NakedObjectSpecification and the context arguments provided.
If no adapter is found for the provided pojo, then the rules for creating the adapter are as follows:
specification indicates that this is an immutable
value, then a ResolveState.VALUE adapter is created
Identified argument indicates that for this particular
property/collection the object is aggregated or that the pojo's own
specification indicates that the pojo is intrinsically aggregated,
then an aggregated adapter is created. Note that the
ResolveState of such NakedObject's is independent of its ownerAdapter, but it
has the same optimistic locking version.
ResolveState.TRANSIENT adapter is created.
pojo - - pojo to adaptownerAdapter - - only used if aggregatedidentifier - - only used if aggregatedNakedObject adapterFor(java.lang.Object pojo)
AdapterManagerLookup.getAdapterFor(Object)), otherwise creates either a
transient root or a standalone adapter for the supplied domain object, depending on
its NakedObjectSpecification.
The rules for creating a standalone vs transient root adapter are as for
adapterFor(Object, NakedObject, Identified).
Historical notes: previously called createAdapterForTransient, though this name wasn't quite right.
void removeAdapter(NakedObject adapter)
adapter from the identity maps.
void removeAdapter(Oid oid)
adapter identified by the specified Oid.
Should be same as AdapterManagerLookup.getAdapterFor(Oid) followed by removeAdapter(NakedObject).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||