|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.puremvc.java.core.model.Model
public class Model
A Singleton IModel
implementation.
In PureMVC, the Model
class provides access to model objects
(Proxies) by named lookup.
The Model
assumes these responsibilities:
IProxy
instances.IProxy
instances.
Your application must register IProxy
instances with the
Model
. Typically, you use an ICommand
to
create and register IProxy
instances once the
Facade
has initialized the Core actors.
Proxy
,
IProxy
Field Summary | |
---|---|
protected static Model |
instance
Singleton instance |
protected java.util.Hashtable |
proxyMap
Mapping of proxyNames to IProxy instances |
Constructor Summary | |
---|---|
protected |
Model()
Constructor. |
Method Summary | |
---|---|
static Model |
getInstance()
Model Singleton Factory method. |
protected void |
initializeModel()
Initialize the Singleton Model instance. |
void |
registerProxy(IProxy proxy)
Register an Proxy with the Model . |
IProxy |
removeProxy(java.lang.String proxy)
Remove an Proxy from the Model . |
IProxy |
retrieveProxy(java.lang.String proxy)
Retrieve an Proxy from the Model . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Model instance
protected java.util.Hashtable proxyMap
Constructor Detail |
---|
protected Model()
This IModel
implementation is a Singleton, so you should
not call the constructor directly, but instead call the static Singleton
Factory method Model.getInstance()
java.lang.Error
- Error if Singleton instance has already been constructedMethod Detail |
---|
protected void initializeModel()
Model
instance.
Called automatically by the constructor, this is your opportunity to initialize the Singleton instance in your subclass without overriding the constructor.
public static Model getInstance()
Model
Singleton Factory method.
public void registerProxy(IProxy proxy)
Proxy
with the Model
.
registerProxy
in interface IModel
proxy
- an Proxy
to be held by the Model
.public IProxy removeProxy(java.lang.String proxy)
Proxy
from the Model
.
removeProxy
in interface IModel
proxy
- name of the Proxy
instance to be removed.public IProxy retrieveProxy(java.lang.String proxy)
Proxy
from the Model
.
retrieveProxy
in interface IModel
proxy
-
Proxy
instance previously registered with the
given proxyName
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |