org.puremvc.java.multicore.patterns.proxy
Class Proxy

java.lang.Object
  extended by org.puremvc.java.multicore.patterns.observer.Notifier
      extended by org.puremvc.java.multicore.patterns.proxy.Proxy
All Implemented Interfaces:
INotifier, IProxy

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
protected  Object data
           
protected  String proxyName
           
 
Fields inherited from class org.puremvc.java.multicore.patterns.observer.Notifier
multitonKey
 
Constructor Summary
Proxy()
          Default constructor.
Proxy(String proxyName)
          Constructor.
Proxy(String proxyName, Object data)
          Constructor.
 
Method Summary
 Object getData()
          Get the data object.
 String getProxyName()
          Get the proxy name.
protected  void init(String proxyName)
           
protected  void init(String proxyName, Object data)
           
 void onRegister()
          Called by the Model when the Proxy is registered.
 void onRemove()
          Called by the Model when the Proxy is removed.
 void setData(Object data)
          Set the data object.
 
Methods inherited from class org.puremvc.java.multicore.patterns.observer.Notifier
getFacade, initializeNotifier, 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.multicore.interfaces.INotifier
initializeNotifier, sendNotification, sendNotification, sendNotification
 

Field Detail

proxyName

protected String proxyName

data

protected Object data
Constructor Detail

Proxy

public Proxy()
Default constructor. JavaFX class only extends Java class with default constructor.


Proxy

public Proxy(String proxyName,
             Object data)
Constructor.

Parameters:
proxyName -
data -

Proxy

public Proxy(String proxyName)
Constructor.

Parameters:
proxyName -
Method Detail

init

protected void init(String proxyName)

init

protected void init(String proxyName,
                    Object data)

getProxyName

public String getProxyName()
Get the proxy name.

Specified by:
getProxyName in interface IProxy
Returns:
the proxy name

setData

public void setData(Object data)
Set the data object.

Specified by:
setData in interface IProxy
Parameters:
data -

getData

public Object getData()
Get the data object.

Specified by:
getData in interface IProxy
Returns:
the data object

onRegister

public void onRegister()
Called by the Model when the Proxy is registered.

Specified by:
onRegister in interface IProxy

onRemove

public void onRemove()
Called by the Model when the Proxy is removed.

Specified by:
onRemove in interface IProxy


Copyright © 2010. All Rights Reserved.