Package org.puremvc.java.patterns.proxy
Class Proxy
java.lang.Object
org.puremvc.java.patterns.observer.Notifier
org.puremvc.java.patterns.proxy.Proxy
public class Proxy extends Notifier implements IProxy
A base IProxy
implementation.
In PureMVC, Proxy
classes are used to manage parts of the
application's data model.
A Proxy
might simply manage a reference to a local data
object, in which case interacting with it might involve setting and getting
of its data in synchronous fashion.
Proxy
classes are also used to encapsulate the application's
interaction with remote services to save or retrieve data, in which case, we
adopt an asyncronous idiom; setting data (or calling a method) on the
Proxy
and listening for a Notification
to be
sent when the Proxy
has retrieved the data from the service.
- See Also:
Model
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description java.lang.Object
getData()
Get the data objectjava.lang.String
getProxyName()
Get the proxy namevoid
onRegister()
Called by the Model when the Proxy is registeredvoid
onRemove()
Called by the Model when the Proxy is removedvoid
setData(java.lang.Object data)
Set the data objectMethods inherited from class org.puremvc.java.patterns.observer.Notifier
sendNotification, sendNotification, sendNotification
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.puremvc.java.interfaces.INotifier
sendNotification, sendNotification, sendNotification
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
proxyName
protected java.lang.String proxyName -
data
protected java.lang.Object data
-
-
Constructor Details
-
Method Details
-
onRegister
public void onRegister()Called by the Model when the Proxy is registered
- Specified by:
onRegister
in interfaceIProxy
-
onRemove
public void onRemove()Called by the Model when the Proxy is removed
-
getProxyName
public java.lang.String getProxyName()Get the proxy name
- Specified by:
getProxyName
in interfaceIProxy
- Returns:
- the proxy name
-
getData
public java.lang.Object getData()Get the data object
-
setData
public void setData(java.lang.Object data)Set the data object
-