|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.otfeed.support.CommonDelegate<T>
T
- delegate type (the type of event object).public class CommonDelegate<T>
Common delegate implements all delegate intefaces
of the org.otfeed API. Hence, it can be passed
as xxxDelegate
paramater to any command
object.
dataWriter
object, that defaults
to SimpleDataWriter
.
Arbitrary id string can be (optionally) associated with
this object, allowing to use multiple instancies of
this object with a single dataWriter
.
In this case id strings help to identify the source
of the record in the dataWriter
.
Constructor Summary | |
---|---|
CommonDelegate()
Creates new CommonDelegate, with no id ,
and null dataWriter. |
|
CommonDelegate(IDataWriter writer)
Creates new CommonDelegate with no id, and given output destination. |
|
CommonDelegate(java.lang.String id)
Creates new CommonDelegate with the given id string. |
|
CommonDelegate(java.lang.String id,
IDataWriter writer)
Creates new CommonDelegate with the given id string, and given output destination. |
Method Summary | |
---|---|
IDataWriter |
getDataWriter()
Ouptut destination. |
java.lang.String |
getId()
Arbitrary string, identifying this listener. |
void |
onData(T data)
Handles data arrival event. |
void |
onDataEnd(OTError error)
Handles end-of-stream event. |
void |
setDataWriter(IDataWriter val)
Sets output writer. |
void |
setId(java.lang.String val)
Sets id string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommonDelegate()
id
,
and null
dataWriter.
public CommonDelegate(java.lang.String id)
id
string.
id
- arbitrary id string. Identifies
this listener.public CommonDelegate(java.lang.String id, IDataWriter writer)
id
- id string.writer
- output destination.public CommonDelegate(IDataWriter writer)
writer
- destination.Method Detail |
---|
public java.lang.String getId()
public void setId(java.lang.String val)
val
- id string.public IDataWriter getDataWriter()
public void setDataWriter(IDataWriter val)
val
- writer.public void onData(T data)
IDataDelegate
onData
in interface IDataDelegate<T>
data
- Data event.public void onDataEnd(OTError error)
ICompletionDelegate
error
parameter will be not null. On normal stream
completion, error
parameter is null.
It is guarnteed, that this method will be called before
request completes.
onDataEnd
in interface ICompletionDelegate
error
- error code, if stream completion was abnormal.
Null otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |