org.spicefactory.pimento.io
Class AbstractApplicableEntitySnapshot

java.lang.Object
  extended by org.spicefactory.pimento.io.AbstractEntitySnapshot
      extended by org.spicefactory.pimento.io.AbstractApplicableEntitySnapshot
All Implemented Interfaces:
Externalizable, ApplicableEntitySnapshot, EntitySnapshot
Direct Known Subclasses:
FullEntitySnapshot, PartialEntitySnapshot

public abstract class AbstractApplicableEntitySnapshot
extends AbstractEntitySnapshot
implements ApplicableEntitySnapshot

Abstract base implementation for the ApplicableEntitySnapshot interface.

Author:
Jens Halm

Constructor Summary
AbstractApplicableEntitySnapshot()
          Creates a new instance.
AbstractApplicableEntitySnapshot(int metadataId, Object entityId)
          Creates a new instance.
AbstractApplicableEntitySnapshot(int metadataId, Object entityId, int temporaryEntityId)
          Creates a new instance representing a transient entity.
 
Method Summary
static void clearInvocationCache()
           
 Object getEntity()
          Returns the entity that this snapshot was applied to.
protected  List<Object> getProperties()
          Returns the property values of this snapshot.
 boolean hasEntity()
          Indicates whether the entity that this snapshot was applied to has been set.
 boolean isTransient()
          Checks whether the entity represented by this snapshot is transient.
 void readExternal(DataInput input)
          Restores the content of this object from the DataInput instance.
 void setEntity(Object entity)
          Sets the entity that this snapshot was applied to.
 void writeExternal(DataOutput output)
          Saves the content of this object to the DataOutput instance.
 
Methods inherited from class org.spicefactory.pimento.io.AbstractEntitySnapshot
equals, getEntityId, getLogString, getMetadataId, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.spicefactory.pimento.io.ApplicableEntitySnapshot
prepareUpdate
 
Methods inherited from interface org.spicefactory.pimento.io.EntitySnapshot
getEntityId, getLogString, getMetadataId
 

Constructor Detail

AbstractApplicableEntitySnapshot

public AbstractApplicableEntitySnapshot()
Creates a new instance. The default constructor will only be used by the AMF decoder.


AbstractApplicableEntitySnapshot

public AbstractApplicableEntitySnapshot(int metadataId,
                                        Object entityId)
Creates a new instance.

Parameters:
metadataId - the id of the metadata for this entity
entityId - the id of the entity

AbstractApplicableEntitySnapshot

public AbstractApplicableEntitySnapshot(int metadataId,
                                        Object entityId,
                                        int temporaryEntityId)
Creates a new instance representing a transient entity. The temporary id is used to synchronize persistent entities with the client.

Parameters:
metadataId - the id of the metadata for this entity
entityId - the id of the entity
temporaryEntityId - the temporary id of the transient entity
Method Detail

isTransient

public boolean isTransient()
Description copied from interface: ApplicableEntitySnapshot
Checks whether the entity represented by this snapshot is transient.

Specified by:
isTransient in interface ApplicableEntitySnapshot
Returns:
true if the entity represented by this snapshot is transient

getProperties

protected List<Object> getProperties()
Returns the property values of this snapshot.

Returns:
the property values of this snapshot

readExternal

public void readExternal(DataInput input)
Description copied from interface: Externalizable
Restores the content of this object from the DataInput instance. Values must be read in the same sequence as they were written on the client side.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class AbstractEntitySnapshot
Parameters:
input - the AMF3 data to read from

writeExternal

public void writeExternal(DataOutput output)
Description copied from interface: Externalizable
Saves the content of this object to the DataOutput instance.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class AbstractEntitySnapshot
Parameters:
output - the output to write to

getEntity

public Object getEntity()
Description copied from interface: ApplicableEntitySnapshot
Returns the entity that this snapshot was applied to.

Specified by:
getEntity in interface ApplicableEntitySnapshot
Returns:
the entity that this snapshot was applied to

hasEntity

public boolean hasEntity()
Description copied from interface: ApplicableEntitySnapshot
Indicates whether the entity that this snapshot was applied to has been set.

Specified by:
hasEntity in interface ApplicableEntitySnapshot
Returns:
true if the entity that this snapshot was applied to has been set

setEntity

public void setEntity(Object entity)
Description copied from interface: ApplicableEntitySnapshot
Sets the entity that this snapshot was applied to.

Specified by:
setEntity in interface ApplicableEntitySnapshot
Parameters:
entity - the entity that this snapshot was applied to

clearInvocationCache

public static void clearInvocationCache()