org.keridwen.core.data.storage.packet
Class MemoryDataPacketSafe<ObjectType>

java.lang.Object
  extended by org.keridwen.core.data.storage.packet.DataPacket<ObjectType>
      extended by org.keridwen.core.data.storage.packet.DataPacketSafe<ObjectType>
          extended by org.keridwen.core.data.storage.packet.MemoryDataPacketSafe<ObjectType>

public class MemoryDataPacketSafe<ObjectType>
extends DataPacketSafe<ObjectType>

Author:
JeT - Artenum, Benoit Thiebault - Artenum This DataModel class is the storage space of any kind of data within Keridwen. It stores the data content in memory

Constructor Summary
MemoryDataPacketSafe(Class<?> packetDataType, UniqueIdGenerator<DataPacketId> idGenerator)
          Constructor
 
Method Summary
 boolean closeIn(InputStream in)
          close the input stream used to read data
 boolean closeOut(OutputStream out)
          close the output stream used to write data
 Class<?> getPacketDataType()
          Type of data managed by this packet
 InputStream openIn()
          Create a new input stream used to read data.
 OutputStream openOut()
          Open the only output stream used to write data TODO: manage concurrency (throw DataModelConcurrencyException ?)
 
Methods inherited from class org.keridwen.core.data.storage.packet.DataPacket
addDataPacketListener, fireDataPacketEvent, forceReadLockRelease, forceWriteLockRelease, getPacketId, isReadInProgress, isWriteInProgress, removeDataPacketListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryDataPacketSafe

public MemoryDataPacketSafe(Class<?> packetDataType,
                            UniqueIdGenerator<DataPacketId> idGenerator)
Constructor

Parameters:
packetName -
packetDataType -
Method Detail

getPacketDataType

public Class<?> getPacketDataType()
Description copied from class: DataPacketSafe
Type of data managed by this packet

Specified by:
getPacketDataType in class DataPacketSafe<ObjectType>
Returns:
the packetDataType
See Also:
DataPacket.getPacketDataType()

openIn

public InputStream openIn()
                   throws DataIOException
Description copied from class: DataPacketSafe
Create a new input stream used to read data. The returned input stream must be closed afterward using InputStream.close() method

Specified by:
openIn in class DataPacketSafe<ObjectType>
Returns:
a newly created input stream
Throws:
DataIOException
See Also:
org.keridwen.core.data.storage.packet.DataPacket#openIn()

openOut

public OutputStream openOut()
                     throws DataIOException
Description copied from class: DataPacketSafe
Open the only output stream used to write data TODO: manage concurrency (throw DataModelConcurrencyException ?) the output stream must be closed using DataPacket.closeOut() method

Specified by:
openOut in class DataPacketSafe<ObjectType>
Returns:
the output stream
Throws:
DataIOException
See Also:
org.keridwen.core.data.storage.packet.DataPacket#openOut()

closeIn

public boolean closeIn(InputStream in)
                throws DataIOException
Description copied from class: DataPacketSafe
close the input stream used to read data

Specified by:
closeIn in class DataPacketSafe<ObjectType>
Throws:
DataIOException
See Also:
org.keridwen.core.data.storage.packet.DataPacket#closeIn(java.io.InputStream)

closeOut

public boolean closeOut(OutputStream out)
                 throws DataIOException
Description copied from class: DataPacketSafe
close the output stream used to write data

Specified by:
closeOut in class DataPacketSafe<ObjectType>
Throws:
DataIOException
See Also:
org.keridwen.core.data.storage.packet.DataPacket#closeOut()


Copyright © 2010-2013 Artenum. All Rights Reserved.