public static class SessionFrameListener.Adapter extends Object implements SessionFrameListener
Empty implementation of SessionFrameListener
SessionFrameListener.Adapter| Constructor and Description |
|---|
SessionFrameListener.Adapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(Session session,
Throwable x)
Callback invoked when an exception is thrown during the processing of an event on a
SPDY session.
|
void |
onGoAway(Session session,
GoAwayResultInfo goAwayResultInfo)
Callback invoked when the other peer signals that it is closing the connection.
|
void |
onPing(Session session,
PingResultInfo pingResultInfo)
Callback invoked when a ping request has completed its round-trip.
|
void |
onRst(Session session,
RstInfo rstInfo)
Callback invoked when a stream error happens.
|
void |
onSettings(Session session,
SettingsInfo settingsInfo)
Callback invoked when a request to configure the SPDY connection has been received.
|
StreamFrameListener |
onSyn(Stream stream,
SynInfo synInfo)
Callback invoked when a request to create a stream has been received.
|
public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
SessionFrameListenerCallback invoked when a request to create a stream has been received.
Application code should implement this method and reply to the stream creation, eventually sending data:
public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
{
// Do something with the metadata contained in synInfo
if (stream.isHalfClosed()) // The other peer will not send data
{
stream.reply(new ReplyInfo(false));
stream.data(new StringDataInfo("foo", true));
return null; // Not interested in further stream events
}
...
}
Alternatively, if the stream creation requires reading data sent from the other peer:
public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
{
// Do something with the metadata contained in synInfo
if (!stream.isHalfClosed()) // The other peer will send data
{
stream.reply(new ReplyInfo(true));
return new Stream.FrameListener.Adapter() // Interested in stream events
{
public void onData(Stream stream, DataInfo dataInfo)
{
// Do something with the incoming data in dataInfo
}
};
}
...
}
onSyn in interface SessionFrameListenerstream - the stream just createdsynInfo - the metadata sent on stream creationpublic void onRst(Session session, RstInfo rstInfo)
SessionFrameListenerCallback invoked when a stream error happens.
onRst in interface SessionFrameListenersession - the sessionrstInfo - the metadata of the stream errorpublic void onSettings(Session session, SettingsInfo settingsInfo)
SessionFrameListenerCallback invoked when a request to configure the SPDY connection has been received.
onSettings in interface SessionFrameListenersession - the sessionsettingsInfo - the metadata sent to configurepublic void onPing(Session session, PingResultInfo pingResultInfo)
SessionFrameListenerCallback invoked when a ping request has completed its round-trip.
onPing in interface SessionFrameListenersession - the sessionpingResultInfo - the metadata receivedpublic void onGoAway(Session session, GoAwayResultInfo goAwayResultInfo)
SessionFrameListenerCallback invoked when the other peer signals that it is closing the connection.
onGoAway in interface SessionFrameListenersession - the sessiongoAwayResultInfo - the metadata sentpublic void onFailure(Session session, Throwable x)
SessionFrameListenerCallback invoked when an exception is thrown during the processing of an event on a SPDY session.
Examples of such conditions are invalid frames received, corrupted headers compression state, etc.
onFailure in interface SessionFrameListenersession - the sessionx - the exception that caused the event processing failureCopyright © 1995-2014 Mort Bay Consulting. All Rights Reserved.