Class AbstractConnection
- java.lang.Object
-
- org.eclipse.jetty.io.AbstractConnection
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Connection
- Direct Known Subclasses:
AbstractWebSocketConnection
,HttpConnection
,HttpConnectionOverHTTP
,NegotiatingClientConnection
,NegotiatingServerConnection
,SslConnection
@Deprecated(since="2021-05-27") public abstract class AbstractConnection extends java.lang.Object implements Connection
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A convenience base implementation of
Connection
.This class uses the capabilities of the
EndPoint
API to provide a more traditional style of async reading. A call tofillInterested()
will schedule a callback toonFillable()
oronFillInterestedFailed(Throwable)
as appropriate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addListener(Connection.Listener listener)
Deprecated.Adds a listener of connection events.void
close()
Deprecated.Performs a logical close of this connection.void
fillInterested()
Deprecated.Utility method to be called to register read interest.long
getBytesIn()
Deprecated.long
getBytesOut()
Deprecated.long
getCreatedTimeStamp()
Deprecated.EndPoint
getEndPoint()
Deprecated.int
getInputBufferSize()
Deprecated.long
getMessagesIn()
Deprecated.long
getMessagesOut()
Deprecated.boolean
isFillInterested()
Deprecated.void
onClose()
Deprecated.Callback method invoked when this connection is closed.abstract void
onFillable()
Deprecated.Callback method invoked when the endpoint is ready to be read.boolean
onIdleExpired()
Deprecated.Callback method invoked upon an idle timeout event.void
onOpen()
Deprecated.Callback method invoked when this connection is opened.void
removeListener(Connection.Listener listener)
Deprecated.Removes a listener of connection events.void
setInputBufferSize(int inputBufferSize)
Deprecated.java.lang.String
toConnectionString()
Deprecated.java.lang.String
toString()
Deprecated.void
tryFillInterested()
Deprecated.void
tryFillInterested(Callback callback)
Deprecated.
-
-
-
Method Detail
-
addListener
public void addListener(Connection.Listener listener)
Deprecated.Description copied from interface:Connection
Adds a listener of connection events.
- Specified by:
addListener
in interfaceConnection
- Parameters:
listener
- the listener to add
-
removeListener
public void removeListener(Connection.Listener listener)
Deprecated.Description copied from interface:Connection
Removes a listener of connection events.
- Specified by:
removeListener
in interfaceConnection
- Parameters:
listener
- the listener to remove
-
getInputBufferSize
public int getInputBufferSize()
Deprecated.
-
setInputBufferSize
public void setInputBufferSize(int inputBufferSize)
Deprecated.
-
fillInterested
public void fillInterested()
Deprecated.Utility method to be called to register read interest.
After a call to this method,
onFillable()
oronFillInterestedFailed(Throwable)
will be called back as appropriate.- See Also:
onFillable()
-
tryFillInterested
public void tryFillInterested()
Deprecated.
-
tryFillInterested
public void tryFillInterested(Callback callback)
Deprecated.
-
isFillInterested
public boolean isFillInterested()
Deprecated.
-
onFillable
public abstract void onFillable()
Deprecated.Callback method invoked when the endpoint is ready to be read.
- See Also:
fillInterested()
-
onOpen
public void onOpen()
Deprecated.Description copied from interface:Connection
Callback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpen
in interfaceConnection
-
onClose
public void onClose()
Deprecated.Description copied from interface:Connection
Callback method invoked when this connection is closed.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onClose
in interfaceConnection
-
getEndPoint
public EndPoint getEndPoint()
Deprecated.- Specified by:
getEndPoint
in interfaceConnection
- Returns:
- the
EndPoint
associated with this Connection.
-
close
public void close()
Deprecated.Description copied from interface:Connection
Performs a logical close of this connection.
For simple connections, this may just mean to delegate the close to the associated
EndPoint
but, for example, SSL connections should write the SSL close message before closing the associatedEndPoint
.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceConnection
-
onIdleExpired
public boolean onIdleExpired()
Deprecated.Description copied from interface:Connection
Callback method invoked upon an idle timeout event.
Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.
When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.
- Specified by:
onIdleExpired
in interfaceConnection
- Returns:
- true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.
-
getMessagesIn
public long getMessagesIn()
Deprecated.- Specified by:
getMessagesIn
in interfaceConnection
-
getMessagesOut
public long getMessagesOut()
Deprecated.- Specified by:
getMessagesOut
in interfaceConnection
-
getBytesIn
public long getBytesIn()
Deprecated.- Specified by:
getBytesIn
in interfaceConnection
-
getBytesOut
public long getBytesOut()
Deprecated.- Specified by:
getBytesOut
in interfaceConnection
-
getCreatedTimeStamp
public long getCreatedTimeStamp()
Deprecated.- Specified by:
getCreatedTimeStamp
in interfaceConnection
-
toString
public final java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
toConnectionString
public java.lang.String toConnectionString()
Deprecated.
-
-