diff options
author | Simone Bordet | 2015-12-19 10:51:04 +0000 |
---|---|---|
committer | Simone Bordet | 2015-12-21 10:47:05 +0000 |
commit | bcd282a8dd1e3acf7304c8666abf48878ce5a561 (patch) | |
tree | c8530e3f147b83d14f50a88ebe5178368cf1dc9c /jetty-io | |
parent | 22f9c9826da9f348c2daff039b8bfb90c984565c (diff) | |
download | org.eclipse.jetty.project-bcd282a8dd1e3acf7304c8666abf48878ce5a561.tar.gz org.eclipse.jetty.project-bcd282a8dd1e3acf7304c8666abf48878ce5a561.tar.xz org.eclipse.jetty.project-bcd282a8dd1e3acf7304c8666abf48878ce5a561.zip |
Updated javadocs and added missing removeListener() method.
Diffstat (limited to 'jetty-io')
-rw-r--r-- | jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java | 6 | ||||
-rw-r--r-- | jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java | 39 |
2 files changed, 33 insertions, 12 deletions
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java index 1ae1a7a0c3..cf83f1c750 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java @@ -61,6 +61,12 @@ public abstract class AbstractConnection implements Connection listeners.add(listener); } + @Override + public void removeListener(Listener listener) + { + listeners.remove(listener); + } + public int getInputBufferSize() { return _inputBufferSize; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java index a0f7a5d29d..cc53f9cc1f 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java @@ -33,12 +33,28 @@ import org.eclipse.jetty.util.component.Container; */ public interface Connection extends Closeable { + /** + * <p>Adds a listener of connection events.</p> + * + * @param listener the listener to add + */ public void addListener(Listener listener); + /** + * <p>Removes a listener of connection events.</p> + * + * @param listener the listener to remove + */ + public void removeListener(Listener listener); + + /** + * <p>Callback method invoked when this connection is opened.</p> + * <p>Creators of the connection implementation are responsible for calling this method.</p> + */ public void onOpen(); /** - * <p>Callback method invoked when this {@link Connection} is closed.</p> + * <p>Callback method invoked when this connection is closed.</p> * <p>Creators of the connection implementation are responsible for calling this method.</p> */ public void onClose(); @@ -47,7 +63,7 @@ public interface Connection extends Closeable * @return the {@link EndPoint} associated with this {@link Connection} */ public EndPoint getEndPoint(); - + /** * <p>Performs a logical close of this connection.</p> * <p>For simple connections, this may just mean to delegate the close to the associated @@ -62,23 +78,24 @@ public interface Connection extends Closeable public long getBytesIn(); public long getBytesOut(); public long getCreatedTimeStamp(); - + public interface UpgradeFrom extends Connection { - /* ------------------------------------------------------------ */ - /** Take the input buffer from the connection on upgrade. + /** + * <p>Takes the input buffer from the connection on upgrade.</p> * <p>This method is used to take any unconsumed input from - * a connection during an upgrade. + * a connection during an upgrade.</p> + * * @return A buffer of unconsumed input. The caller must return the buffer * to the bufferpool when consumed and this connection must not. */ ByteBuffer onUpgradeFrom(); } - + public interface UpgradeTo extends Connection { /** - * <p>Callback method invoked when this {@link Connection} is upgraded.</p> + * <p>Callback method invoked when this connection is upgraded.</p> * <p>This must be called before {@link #onOpen()}.</p> * @param prefilled An optional buffer that can contain prefilled data. Typically this * results from an upgrade of one protocol to the other where the old connection has buffered @@ -87,10 +104,8 @@ public interface Connection extends Closeable */ void onUpgradeTo(ByteBuffer prefilled); } - - - /* ------------------------------------------------------------ */ - /** + + /** * <p>A Listener for connection events.</p> * <p>Listeners can be added to a {@link Connection} to get open and close events. * The AbstractConnectionFactory implements a pattern where objects implement |