seda.sandStorm.lib.aDisk
Class AFileImpl

java.lang.Object
  extended by seda.sandStorm.core.SimpleSink
      extended by seda.sandStorm.lib.aDisk.AFileImpl
All Implemented Interfaces:
ProfilableIF, SinkIF
Direct Known Subclasses:
AFileTPImpl

abstract class AFileImpl
extends SimpleSink

Package-access only abstract class representing an implementation of the AFile interface. By creating a subclass of AFileImpl and tying it into the implementation-selection code in AFile, you can introduce new implementations of AFile behind this interface.

See Also:
AFile

Constructor Summary
AFileImpl()
           
 
Method Summary
abstract  void close()
          Close the file after all enqueued requests have completed.
abstract  boolean enqueue_lossy(QueueElementIF req)
          Enqueues the given request (which must be an AFileRequest) to the file.
abstract  void enqueue_many(QueueElementIF[] elements)
          Enqueues the given requests (which must be AFileRequests) to the file.
abstract  void enqueue(QueueElementIF req)
          Enqueues the given request (which must be an AFileRequest) to the file.
abstract  void flush()
          Causes a SinkFlushedEvent to be posted on the file's completion queue when all pending requests have completed.
(package private) abstract  AFileStat stat()
          Return information on the properties of the file.
 
Methods inherited from class seda.sandStorm.core.SimpleSink
enqueue_abort, enqueue_commit, enqueue_prepare, getEnqueuePredicate, profileSize, setEnqueuePredicate, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AFileImpl

AFileImpl()
Method Detail

enqueue

public abstract void enqueue(QueueElementIF req)
                      throws SinkException
Enqueues the given request (which must be an AFileRequest) to the file.

Specified by:
enqueue in interface SinkIF
Specified by:
enqueue in class SimpleSink
Parameters:
req - The QueueElementIF to enqueue
Throws:
SinkFullException - Indicates that the sink is temporarily full.
SinkClosedException - Indicates that the sink is no longer being serviced.
SinkException

enqueue_lossy

public abstract boolean enqueue_lossy(QueueElementIF req)
Enqueues the given request (which must be an AFileRequest) to the file.

Specified by:
enqueue_lossy in interface SinkIF
Overrides:
enqueue_lossy in class SimpleSink
Parameters:
req - The QueueElementIF to enqueue
Returns:
true if the element was enqueued, false otherwise.

enqueue_many

public abstract void enqueue_many(QueueElementIF[] elements)
                           throws SinkException
Enqueues the given requests (which must be AFileRequests) to the file.

Specified by:
enqueue_many in interface SinkIF
Overrides:
enqueue_many in class SimpleSink
Parameters:
elements - The element array to enqueue
Throws:
SinkFullException - Indicates that the sink is temporarily full.
SinkClosedException - Indicates that the sink is no longer being serviced.
SinkException

stat

abstract AFileStat stat()
Return information on the properties of the file.


close

public abstract void close()
Close the file after all enqueued requests have completed. Disallows any additional requests to be enqueued on this file. A SinkClosedEvent will be posted on the file's completion queue when the close is complete.


flush

public abstract void flush()
Causes a SinkFlushedEvent to be posted on the file's completion queue when all pending requests have completed.