com.alipay.remoting
Class ConnectionPool

java.lang.Object
  extended by com.alipay.remoting.ConnectionPool
All Implemented Interfaces:
Scannable

public class ConnectionPool
extends Object
implements Scannable

Connection pool


Constructor Summary
ConnectionPool(ConnectionSelectStrategy strategy)
          Constructor
 
Method Summary
 void add(Connection connection)
          add a connection
 boolean contains(Connection connection)
          check weather a connection already added
 Connection get()
          get a connection
 List<Connection> getAll()
          get all connections
 long getLastAccessTimestamp()
          Getter method for property lastAccessTimestamp.
 boolean isAsyncCreationDone()
          is async create connection done
 boolean isEmpty()
          is connection pool empty
 void markAsyncCreationDone()
          do mark async create connection done
 void markAsyncCreationStart()
          do mark async create connection start
 void removeAllAndTryClose()
          remove all connections
 void removeAndTryClose(Connection connection)
          removeAndTryClose a connection
 void scan()
          Scan it.
 int size()
          connection pool size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPool

public ConnectionPool(ConnectionSelectStrategy strategy)
Constructor

Parameters:
strategy -
Method Detail

add

public void add(Connection connection)
add a connection

Parameters:
connection -

contains

public boolean contains(Connection connection)
check weather a connection already added

Parameters:
connection -
Returns:

removeAndTryClose

public void removeAndTryClose(Connection connection)
removeAndTryClose a connection

Parameters:
connection -

removeAllAndTryClose

public void removeAllAndTryClose()
remove all connections


get

public Connection get()
get a connection

Returns:

getAll

public List<Connection> getAll()
get all connections

Returns:

size

public int size()
connection pool size

Returns:

isEmpty

public boolean isEmpty()
is connection pool empty

Returns:

getLastAccessTimestamp

public long getLastAccessTimestamp()
Getter method for property lastAccessTimestamp.

Returns:
property value of lastAccessTimestamp

isAsyncCreationDone

public boolean isAsyncCreationDone()
is async create connection done

Returns:

markAsyncCreationDone

public void markAsyncCreationDone()
do mark async create connection done


markAsyncCreationStart

public void markAsyncCreationStart()
do mark async create connection start


scan

public void scan()
Description copied from interface: Scannable
Scan it.

Specified by:
scan in interface Scannable
See Also:
Scannable.scan()


Copyright © 2018. All rights reserved.