org.keridwen.core.data.storage.packet
Class ObjectAccessorSafe<ObjectType extends Serializable>

java.lang.Object
  extended by org.keridwen.core.data.storage.packet.ObjectAccessorSafe<ObjectType>
All Implemented Interfaces:
Accessor<ObjectType>, AccessorSafe<ObjectType>

public class ObjectAccessorSafe<ObjectType extends Serializable>
extends Object
implements AccessorSafe<ObjectType>

Accessor to any kind of serializable objects in safe mode using serialization

Author:
JeT - Artenum, Benoit Thiebault - Artenum

Constructor Summary
ObjectAccessorSafe(Class<ObjectType> objectClass)
          Constructor
 
Method Summary
 ObjectType getContent()
           
 Class<?>[] getDataTypes()
          get the list of data types this accessor can manage
 AccessorId getId()
          Get the Id
 AccessorMode getMode()
          tell if the accessor is safe or not
 void readSafe(DataPacketSafe<ObjectType> packet)
          read data from a DataPacket in safe mode
 void safeWrite(DataPacketSafe<ObjectType> packet)
          write data to the DataPacket in safe mode
 void setContent(ObjectType serializableObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectAccessorSafe

public ObjectAccessorSafe(Class<ObjectType> objectClass)
Constructor

Parameters:
value -
Method Detail

getId

public AccessorId getId()
Description copied from interface: Accessor
Get the Id

Specified by:
getId in interface Accessor<ObjectType extends Serializable>
See Also:
Accessor.getId()

getDataTypes

public Class<?>[] getDataTypes()
Description copied from interface: Accessor
get the list of data types this accessor can manage

Specified by:
getDataTypes in interface Accessor<ObjectType extends Serializable>
See Also:
Accessor.getDataTypes()

readSafe

public void readSafe(DataPacketSafe<ObjectType> packet)
              throws DataIOException,
                     DataConcurrencyException
Description copied from interface: AccessorSafe
read data from a DataPacket in safe mode

Specified by:
readSafe in interface AccessorSafe<ObjectType extends Serializable>
Throws:
DataIOException
DataConcurrencyException
See Also:
AccessorSafe.readSafe(org.keridwen.core.data.storage.packet.DataPacketSafe)

safeWrite

public void safeWrite(DataPacketSafe<ObjectType> packet)
               throws DataIOException,
                      DataConcurrencyException
Description copied from interface: AccessorSafe
write data to the DataPacket in safe mode

Specified by:
safeWrite in interface AccessorSafe<ObjectType extends Serializable>
Throws:
DataIOException
DataConcurrencyException
See Also:
AccessorSafe.safeWrite(org.keridwen.core.data.storage.packet.DataPacketSafe)

getContent

public ObjectType getContent()
Specified by:
getContent in interface AccessorSafe<ObjectType extends Serializable>
Returns:
the object

setContent

public void setContent(ObjectType serializableObject)
Specified by:
setContent in interface AccessorSafe<ObjectType extends Serializable>
Parameters:
serializableObject - the object to set

getMode

public AccessorMode getMode()
Description copied from interface: Accessor
tell if the accessor is safe or not

Specified by:
getMode in interface Accessor<ObjectType extends Serializable>
See Also:
org.keridwen.core.data.storage.packet.Accessor#isSafe()


Copyright © 2010-2013 Artenum. All Rights Reserved.