T
- type of data model objectspublic class StreamDrainDriver<T> extends Object implements DrainDriver<T>
SourceDriver
using binary InputStream
.Constructor and Description |
---|
StreamDrainDriver(String resourceName,
String processName,
OutputStreamProvider streamProvider,
DataModelStreamSupport<? super T> streamSupport)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Disposes this object.
|
void |
prepare()
Prepares this driver to invoke
DrainDriver.put(Object) method. |
void |
put(T object)
Puts each data model object into the connected resource.
|
public StreamDrainDriver(String resourceName, String processName, OutputStreamProvider streamProvider, DataModelStreamSupport<? super T> streamSupport)
resourceName
- original resource nameprocessName
- current process namestreamProvider
- provides target OutputStream
streamSupport
- converts data model objects into binary dataIllegalArgumentException
- if some parameters were null
public void prepare() throws IOException
DrainDriver
DrainDriver.put(Object)
method.
This method will be invoked before DrainDriver.put(Object)
only once.
This operation can execute only on the same thread as created this object.prepare
in interface DrainDriver<T>
prepare
in interface Preparable
IOException
- if failed to beginpublic void put(T object) throws IOException
DrainDriver
put
in interface DrainDriver<T>
object
- the data model object to be putIOException
- if failed to put datapublic void close() throws IOException
DrainDriver
close
in interface DrainDriver<T>
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if failed to connectCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.