Package org.scictrl.csshell
Interface ConnectionCache<C extends Connection<?,?,?>>
- Type Parameters:
C
- class implementingConnection
interface
- All Known Implementing Classes:
AbstractConnector.DefaultConnectionCache
public interface ConnectionCache<C extends Connection<?,?,?>>
Interfaces for simple connection cache, which it is used inside a Connector.
- Author:
- igor@scictrl.com
-
Method Summary
-
Method Details
-
add
Adds connection to the cache by it's name. If any connection by same name already exists, it is released and returned.- Parameters:
ch
- the connection to be placed in cache- Returns:
- previous connection with this name, if it was any, otherwise
null
-
remove
Removes connection from cache.- Parameters:
name
- the name of connection to be removed from cache- Returns:
- the removed connection, is exists, otherwise
null
-
get
Returns connection, which has provided name. Ornull
if no such connection.- Parameters:
name
- the connection name- Returns:
- the connection, or null
-
cleanup
void cleanup()Removes all dead references and deleted connections.
-