ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
mx.data 

ManagedObjectProxy  - AS3 ADEP Data Services

Packagemx.data
Classpublic dynamic class ManagedObjectProxy
InheritanceManagedObjectProxy Inheritance ObjectProxy Inheritance Proxy
Implements IManaged

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Data Services for Java EE 3
Runtime Versions: Flash Player 9, AIR 1.1

The ManagedObjectProxy class provides the ability to track changes to an item that is anonymous and managed by a DataService. Any number of objects can "listen" for changes on this object, by using the addEventListener() method. This class provides the same level of functionality for anonymous objects managed by a DataService as that given to any class with [Managed] metadata applied to it.



Public Properties
 PropertyDefined By
  uid : String
[override] The unique id for this object instance.
ManagedObjectProxy
Protected Properties
 PropertyDefined By
 Inheriteddispatcher : EventDispatcher
A reference to the EventDispatcher for this proxy.
ObjectProxy
 Inheritednotifiers : Object
A hashmap of property change notifiers that this proxy is listening for changes from; the key of the map is the property name.
ObjectProxy
 Inheritedobject : Object
[read-only] The object being proxied.
ObjectProxy
 InheritedpropertyList : Array
Contains a list of all of the property names for the proxied object.
ObjectProxy
 InheritedproxyClass : Class
Indicates what kind of proxy to create when proxying complex properties.
ObjectProxy
 Inheritedtype : QName
The qualified type name associated with this object.
ObjectProxy
Public Methods
 MethodDefined By
  
ManagedObjectProxy(item:Object = null, uid:String = null)
Intializes this proxy with the specified object and id.
ManagedObjectProxy
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object so that the listener receives notification of an event.
ObjectProxy
 Inherited
Dispatches an event into the event flow.
ObjectProxy
 Inherited
Checks whether there are any event listeners registered for a specific type of event.
ObjectProxy
 Inherited
Called when a complex property is updated.
ObjectProxy
  
[override] ManagedObjectProxy may need to exclude properties on the wrapped anonymous Object if a DataService destination is defined and lazy associations have been configured.
ManagedObjectProxy
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes an event listener.
ObjectProxy
 Inherited
Checks whether an event listener is registered with this object or any of its ancestors for the specified event type.
ObjectProxy
  
[override] ManagedObjectProxy checks if properties on the wrapped anonymous Object are lazy associations and if so they are excluded from serialization.
ManagedObjectProxy
Protected Methods
 MethodDefined By
  
[override] DataService must save the state of an unmanaged collection before a change to any of the contained items has been modified.
ManagedObjectProxy
  
setProperty(name:*, value:*):void
[override] If the property being set is an ArrayCollection then we need to ensure that any list that this proxy was previously listening for events on should stop.
ManagedObjectProxy
 Inherited
This method creates an array of all of the property names for the proxied object.
ObjectProxy
Property Detail

uid

property
uid:String[override]

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Data Services for Java EE 3
Runtime Versions: Flash Player 9, AIR 1.1

The unique id for this object instance.

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



Implementation
    override public function get uid():String
    override public function set uid(value:String):void
Constructor Detail

ManagedObjectProxy

()Constructor
public function ManagedObjectProxy(item:Object = null, uid:String = null)

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Data Services for Java EE 3
Runtime Versions: Flash Player 9, AIR 1.1

Intializes this proxy with the specified object and id.

Parameters
item:Object (default = null) — Object to proxy. if no item is specified, an anonymous object will be constructed and assigned.
 
uid:String (default = null) — String containing the unique id for this object instance. Required for IManaged compliance as every object must provide a unique way of identifying it. If no value is specified a random id will be assigned.
Method Detail

getProperty

()method
override flash_proxy function getProperty(name:*):*

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Data Services for Java EE 3
Runtime Versions: Flash Player 9, AIR 1.1

DataService must save the state of an unmanaged collection before a change to any of the contained items has been modified. To do this we need to listen for PropertyChangeEvents from the list implementation, and redispatch those events so that the DataService can intercept them and make the appropriate snapshot of the collection. We detect an unmanaged collection by looking at the list implementation. Managed collections have a DataList and unmanaged collections use lists that should implement IPropertyChangeNotifier.

Parameters

name:* — Typically a string containing the name of the property or possibly a QName where the property name is found by inspecting the localName property.

Returns
* — The property value or an instance of ObjectProxy

readExternal

()method 
override public function readExternal(input:IDataInput):void

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Data Services for Java EE 3
Runtime Versions: Flash Player 9, AIR 1.1

ManagedObjectProxy may need to exclude properties on the wrapped anonymous Object if a DataService destination is defined and lazy associations have been configured. This method supports the custom serialization of writeExternal.

Parameters

input:IDataInput — The source of the serialized data.

setProperty

()method 
override flash_proxy function setProperty(name:*, value:*):void

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Data Services for Java EE 3
Runtime Versions: Flash Player 9, AIR 1.1

If the property being set is an ArrayCollection then we need to ensure that any list that this proxy was previously listening for events on should stop.

Parameters

name:* — Object containing the name of the property that should be updated on the proxied object.
 
value:* — Value that should be set on the proxied object.

writeExternal

()method 
override public function writeExternal(output:IDataOutput):void

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Data Services for Java EE 3
Runtime Versions: Flash Player 9, AIR 1.1

ManagedObjectProxy checks if properties on the wrapped anonymous Object are lazy associations and if so they are excluded from serialization.

Parameters

output:IDataOutput — The destination of the serialized data.