net.sf.asyncobjects.io.util
Class MulticastOutput<D extends BatchedData<D>,O extends AOutput<D>>

java.lang.Object
  extended by net.sf.asyncobjects.AsyncUnicastServer<O>
      extended by net.sf.asyncobjects.io.util.MulticastOutput<D,O>
Type Parameters:
D - a batched data type
O - an output type
All Implemented Interfaces:
ACloseable, AsyncObject, ExplicitSharing, AOutput<D>
Direct Known Subclasses:
MulticastByteOutput, MulticastTextOutput

public class MulticastOutput<D extends BatchedData<D>,O extends AOutput<D>>
extends AsyncUnicastServer<O>
implements AOutput<D>

A stream that copies data written to it into streams passed to it as arguments. Close operation closes all streams. A error in one stream causes an WaitAllException to be thrown.

Author:
const

Constructor Summary
MulticastOutput(O... outputs)
          A constructor
 
Method Summary
 Promise<Void> close()
          Close stream
 Promise<Void> flush()
          Flush data
 Promise<Void> write(D data)
          Write data
 
Methods inherited from class net.sf.asyncobjects.AsyncUnicastServer
dereference, export, isImmediate, myVat, promise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.asyncobjects.AsyncObject
dereference, isImmediate
 

Constructor Detail

MulticastOutput

public MulticastOutput(O... outputs)
A constructor

Parameters:
outputs - outputs to wrap
Method Detail

write

public Promise<Void> write(D data)
Write data

Specified by:
write in interface AOutput<D extends BatchedData<D>>
Parameters:
data - a data to write
Returns:
a promise that resolves when write operation finishes
See Also:
AOutput.write(net.sf.asyncobjects.io.BatchedData)

flush

public Promise<Void> flush()
Flush data

Specified by:
flush in interface AOutput<D extends BatchedData<D>>
Returns:
a promise that resolves when flush operation finishes
See Also:
AOutput.flush()

close

public Promise<Void> close()
Close stream

Specified by:
close in interface ACloseable
Returns:
a promise that resolves when close operation finishes
See Also:
ACloseable.close()


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.