gr.uoa.di.madgik.grs.store.buffer.multiplex
Class FirstAvailableMultiplex

java.lang.Object
  extended by gr.uoa.di.madgik.grs.store.buffer.multiplex.FirstAvailableMultiplex
All Implemented Interfaces:
IMultiplex

public class FirstAvailableMultiplex
extends java.lang.Object
implements IMultiplex

Implementation of the IMultiplex interface for the IBufferStore.MultiplexType.FirstAvailable type of multiplexing

Author:
gpapanikos

Constructor Summary
FirstAvailableMultiplex()
          Creates a new instance
 
Method Summary
 void dispose()
          Dispose all internally managed information but not the externally provided entries
 void multiplex()
          Perform the multiplexing operation
 void setBufferStore(IBufferStore bufferStore)
          The IBufferStore that is receiving the multiplexed Records
 void setEntries(java.util.ArrayList<BufferStoreEntry> entries)
          The entries over which the implementation needs to act
 void setModificationNotify(java.lang.Object notify)
          Set the synchronization object to be used in a standard wait / notify block to notify when a new Record has been made available from any of the readers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstAvailableMultiplex

public FirstAvailableMultiplex()
Creates a new instance

Method Detail

setModificationNotify

public void setModificationNotify(java.lang.Object notify)
Set the synchronization object to be used in a standard wait / notify block to notify when a new Record has been made available from any of the readers

Specified by:
setModificationNotify in interface IMultiplex
Parameters:
notify - the synchronization object
See Also:
IMultiplex.setModificationNotify(java.lang.Object)

setEntries

public void setEntries(java.util.ArrayList<BufferStoreEntry> entries)
The entries over which the implementation needs to act

Specified by:
setEntries in interface IMultiplex
Parameters:
entries - the entries to multiplex
See Also:
IMultiplex.setEntries(java.util.ArrayList)

setBufferStore

public void setBufferStore(IBufferStore bufferStore)
The IBufferStore that is receiving the multiplexed Records

Specified by:
setBufferStore in interface IMultiplex
Parameters:
bufferStore - the IBufferStore this multiplex implementation is acting for
See Also:
IMultiplex.setBufferStore(gr.uoa.di.madgik.grs.store.buffer.IBufferStore)

dispose

public void dispose()
Dispose all internally managed information but not the externally provided entries

Specified by:
dispose in interface IMultiplex
See Also:
IMultiplex.dispose()

multiplex

public void multiplex()
               throws GRS2BufferStoreException
Perform the multiplexing operation

Specified by:
multiplex in interface IMultiplex
Throws:
GRS2BufferStoreException - there was a problem during the multiplexing procedure
See Also:
IMultiplex.multiplex()