Referencia de ActionScript® 3.0 para la plataforma de Adobe® Flash®
Inicio  |  Ocultar lista de paquetes y clases |  Paquetes  |  Clases  |  Novedades  |  Índice  |  Apéndices  |  ¿Por qué hay texto en inglés?
Filtros: Recuperando datos del servidor...
Recuperando datos del servidor...
mx.data 

MessageBatch  - AS3 ADEP Data Services

Paquetemx.data
Clasepublic class MessageBatch
HerenciaMessageBatch Inheritance EventDispatcher Inheritance Object
Implementa IExternalizable

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Represents a group of changes: creates, updates, deletes, and update collection messages. There is always at least one open batch accessible via the DataStore.currentBatch property. Changes you make such as property changes detected automatically through data binding, createItem(), updateItem(), or deleteItem() operations are stored in this batch. The current list of uncommitted batches is stored in the uncommittedBatches property. You call createBatch create a new batch which is added to the end of the list. This batch is automatically made the currentBatch. You can commit or revert the set of a changes a batch at a time - in both cases, the batch is automatically removed from the uncommittedBatches list.

When there are dependencies between changes, you should commit and revert changes in order - i.e. commit the oldest batch in the list (uncommittedBatches[0]) and revert the most recent batch - uncommittedBatches[uncommittedBatches.length - 1].

The commitRequired property is set to true when there are any changes in the batch (i.e. items.length > 0). The items property stores the set of DataMessages in this batch.

You can store custom information in a MessageBatch via the properties property. Batches are saved/restored each time you use the saveCache method or automatically when autoSaveCache is true when using the offline feature.

Each batch also has a DataMessage associated with it in the batchMessage property. If you need to communicate information with the server (and you are sending the batch message to the server) you can store info in the headers of this message.



Propiedades públicas
 PropiedadDefinido por
  batchMessage : DataMessage
This is the data message used to represent the batch being sent to the server.
MessageBatch
  commitRequired : Boolean
[solo lectura] True if any changes are in this batch.
MessageBatch
 Inheritedconstructor : Object
Una referencia a la clase de objeto o función constructora para una instancia de objeto determinada.
Object
  properties : Object = null
An optional set of user defined properties you can set for this batch.
MessageBatch
Métodos públicos
 MétodoDefinido por
  
Constructor.
MessageBatch
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra un objeto de detector de eventos con un objeto EventDispatcher, de modo que el detector reciba la notificación de un evento.
EventDispatcher
  
commit(itemsOrCollections:Array = null, cascadeCommit:Boolean = false):mx.rpc:AsyncToken
Commits the changes in the batch.
MessageBatch
  
Indicates if there are pending changes for this particular item.
MessageBatch
 Inherited
Distribuye un evento en el flujo del evento.
EventDispatcher
  
Returns the message with the given id.
MessageBatch
 Inherited
Comprueba si el objeto EventDispatcher tiene detectores registrados para un tipo concreto de evento.
EventDispatcher
 Inherited
Indica si un objeto tiene definida una propiedad especificada.
Object
 Inherited
Indica si hay una instancia de la clase Object en la cadena de prototipo del objeto especificado como parámetro.
Object
 Inherited
Indica si existe la propiedad especificada y si es enumerable.
Object
  
This method deserializes the message batch.
MessageBatch
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Elimina un detector del objeto EventDispatcher.
EventDispatcher
  
Removes the specified message from this batch.
MessageBatch
  
Reverts the changes for this batch, either all changes if no item is supplied, or just the changes for the specified item if it is supplied.
MessageBatch
  
Reverts the changes for all items in the specified managed collection.
MessageBatch
 Inherited
Establece la disponibilidad de una propiedad dinámica para operaciones de bucle.
Object
 Inherited
Devuelve la representación de cadena de este objeto, con formato según las convenciones específicas de configuración regional.
Object
  
[override] Returns a String representation of this object.
MessageBatch
 Inherited
Devuelve el valor simple del objeto especificado.
Object
 Inherited
Comprueba si hay registrado un detector de eventos con este objeto EventDispatcher o con cualquiera de sus ascendientes para el tipo de evento concreto.
EventDispatcher
  
This method serializes the batch with the following stucture: numberOfElements:int - this is the total number of elements serialized [repeated element (once for every message in the batch)] destination:String - the destination of the associated DataService uid:String - the UID of the associated item message:DataMessage - the message for the associated change Because the message currently contains a copy of the item we don't have to serialize the message in a special way.
MessageBatch
Eventos
 Evento Resumen Definido por
 Inherited[evento broadcast] Se distribuye cuando Flash Player o AIR pasan a estar activos.EventDispatcher
 Inherited[evento broadcast] Se distribuye cuando Flash Player o de AIR pasan a estar inactivos.EventDispatcher
Constantes públicas
 ConstanteDefinido por
  items : ArrayCollection
This stores the list of MessageCacheItem instances which represent the changes in the batch.
MessageBatch
Información sobre propiedades

batchMessage

propiedad
public var batchMessage:DataMessage

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

This is the data message used to represent the batch being sent to the server. If you need to pass additional per-transaction information you might use the headers of this message to communicate with your server code (assuming it actually sends the message instead of converting it on the client).

commitRequired

propiedad 
commitRequired:Boolean  [solo lectura]

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

True if any changes are in this batch. This is a bindable property.

Esta propiedad se puede utilizar como origen para la vinculación de datos. Cuando se modifica esta propiedad, distribuye el evento propertyChange .



Implementación
    public function get commitRequired():Boolean

properties

propiedad 
public var properties:Object = null

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

An optional set of user defined properties you can set for this batch.

Información sobre constructores

MessageBatch

()Información sobre
public function MessageBatch()

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Constructor.

Información sobre métodos

commit

()método
public function commit(itemsOrCollections:Array = null, cascadeCommit:Boolean = false):mx.rpc:AsyncToken

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Commits the changes in the batch. Typically called with no arguments.

Parámetros

itemsOrCollections:Array (default = null) — If you want to commit only some of the changes in the batch, you can commit changes for an item at a time or a collection of items at a time by setting the itemsOrCollections parameter.
 
cascadeCommit:Boolean (default = false) — Set to true to ensure that changes to associated items are also included in the commit.

Valor devuelto
mx.rpc:AsyncToken — AsyncToken reference to the token that will identify this operation in a result or fault event dispatched from this service.

commitRequiredOn

()método 
public function commitRequiredOn(item:Object):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3.1
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Indicates if there are pending changes for this particular item.

Parámetros

item:Object — The object that might have changes.

Valor devuelto
Booleantrue if the item has pending changes.

getMessage

()método 
public function getMessage(messageId:String):DataMessage

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Returns the message with the given id. Returns null of no message with the given id exists in this batch.

Parámetros

messageId:String — id of desired message.

Valor devuelto
DataMessage — the message with the given id. Returns null of no message with the given id exists in this batch.

readExternal

()método 
public function readExternal(input:IDataInput):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

This method deserializes the message batch. It expects the input byte stream to have the following structure:

  • numberOfElements:int - this is the total number of elements serialized [repeated element (once for every message in the batch)] t]
  • destination:String - the destination of the associated DataService
  • uid:String - the UID of the associated item
  • message:DataMessage - the message for the associated change

Parámetros

input:IDataInput — input stream

removeMessage

()método 
public function removeMessage(msg:DataMessage):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Removes the specified message from this batch.

Parámetros

msg:DataMessage — message to be removed.

revertChanges

()método 
public function revertChanges(item:IManaged = null):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Reverts the changes for this batch, either all changes if no item is supplied, or just the changes for the specified item if it is supplied. You should typically only revert changes in the most recent batch as the system does not resolve or fix dependencies if you revert an older change which was depended upon by a later change.

Parámetros

item:IManaged (default = null) — The item to revert.

Valor devuelto
Booleantrue if the revert completed successfully.

revertChangesForCollection

()método 
public function revertChangesForCollection(collection:ListCollectionView):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Reverts the changes for all items in the specified managed collection.

Parámetros

collection:ListCollectionView — The collection to revert.

Valor devuelto
Booleantrue if the revert completed successfully.

toString

()método 
override public function toString():String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Returns a String representation of this object.

Valor devuelto
String — A String representation of this object.

writeExternal

()método 
public function writeExternal(output:IDataOutput):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

This method serializes the batch with the following stucture:

  • numberOfElements:int - this is the total number of elements serialized [repeated element (once for every message in the batch)]
  • destination:String - the destination of the associated DataService
  • uid:String - the UID of the associated item
  • message:DataMessage - the message for the associated change

Because the message currently contains a copy of the item we don't have to serialize the message in a special way.

Parámetros

output:IDataOutput — object to write serialized bytes to.

Información sobre constantes

items

Constante
public const items:ArrayCollection

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

This stores the list of MessageCacheItem instances which represent the changes in the batch. It is bindable so you can listen for change events on this collection to be notified of new changes.





[ X ]¿Por qué hay texto en inglés?
Cierto contenido de la Referencia de ActionScript 3.0 se muestra en inglés

No todo el contenido de la Referencia de ActionScript 3.0 se traduce a todos los idiomas. Si un elemento del lenguaje no se traduce, aparecerá en inglés. Por ejemplo, la clase ga.controls.HelpBox no está traducida en ningún idioma. Por lo tanto, en la versión en español de la referencia, la clase ga.controls.HelpBox aparecerá en inglés.