Package me.tamkungz.signals.connection
Class ConnectionGroup
java.lang.Object
me.tamkungz.signals.connection.ConnectionGroup
- All Implemented Interfaces:
Connection
Tracks many connections and disconnects them all at once, for example when a plugin disables.
Connections added after the group was disconnected are disconnected immediately.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Connection>
Tadd(T connection) static ConnectionGroupcreate()voidStops this connection from receiving further values.booleanTells whether this connection is still active.static ConnectionGroupof(Connection... connections) intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.tamkungz.signals.connection.Connection
close
-
Constructor Details
-
ConnectionGroup
public ConnectionGroup()
-
-
Method Details
-
create
-
of
-
add
-
size
public int size() -
disconnect
public void disconnect()Description copied from interface:ConnectionStops this connection from receiving further values.- Specified by:
disconnectin interfaceConnection
-
isConnected
public boolean isConnected()Description copied from interface:ConnectionTells whether this connection is still active.- Specified by:
isConnectedin interfaceConnection- Returns:
trueuntilConnection.disconnect()has been called
-