public class JPPFConnectionPool extends AbstractClientConnectionPool implements org.jppf.comm.recovery.HeartbeatConnectionListener
This connection pool also holds a pool of JMX connections to the same remote driver
| Modifier and Type | Method and Description |
|---|---|
JPPFClientConnection |
awaitActiveConnection()
Wait for the a connection to be in the
ACTIVE status. |
List<JPPFClientConnection> |
awaitActiveConnections(org.jppf.utils.ComparisonOperator operator,
int nbConnections)
Wait for the specified number of connections to be in the
ACTIVE status. |
JPPFClientConnection |
awaitConnection(JPPFClientConnectionStatus... statuses)
Wait for a connection to be in one of the specified states.
|
List<JPPFClientConnection> |
awaitConnections(org.jppf.utils.ComparisonOperator operator,
int nbConnections,
JPPFClientConnectionStatus... statuses)
Wait for the specified number of connections to be in one of the specified states.
|
List<JPPFClientConnection> |
awaitConnections(org.jppf.utils.ComparisonOperator operator,
int nbConnections,
long timeout,
JPPFClientConnectionStatus... statuses)
Wait for the specified number of connections to be in one of the specified states, or the specified timeout to expire, whichever happens first.
|
org.jppf.management.JMXDriverConnectionWrapper |
awaitJMXConnection(boolean connectedOnly)
Wait a JMX connection to be in the specified state.
|
List<org.jppf.management.JMXDriverConnectionWrapper> |
awaitJMXConnections(org.jppf.utils.ComparisonOperator operator,
int nbConnections,
boolean connectedOnly)
Wait for the specified number of JMX connections to be in the specified state.
|
List<org.jppf.management.JMXDriverConnectionWrapper> |
awaitJMXConnections(org.jppf.utils.ComparisonOperator operator,
int nbConnections,
long timeout,
boolean connectedOnly)
Wait for the specified number of JMX connections to be in the specified state, or the specified timeout to expire, whichever happens first.
|
JPPFClientConnection |
awaitWorkingConnection()
|
List<JPPFClientConnection> |
awaitWorkingConnections(org.jppf.utils.ComparisonOperator operator,
int nbConnections)
|
org.jppf.management.JMXDriverConnectionWrapper |
awaitWorkingJMXConnection()
Wait an established JMX connection to be available.
|
void |
close() |
void |
heartbeatConnectionFailed(org.jppf.comm.recovery.HeartbeatConnectionEvent event) |
int |
setSize(int newSize)
Set the size of this connection pool, starting or stopping connections as needed.
|
String |
toString() |
compareTo, connectionCount, equals, getClient, getConnection, getConnections, getDriverHost, getDriverIPAddress, getDriverPort, getDriverUuid, getId, getJmxConnection, getJmxConnection, getJMXConnections, getJMXPoolMaxSize, getJMXPoolSize, getJmxPort, getMaxJobs, getName, getPriority, getSystemInfo, hashCode, isSslEnabled, setJMXPoolMaxSize, setJMXPoolSize, setMaxJobsconnectionCount, getConnections, getSize, isEmpty, iteratorclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic int setSize(int newSize)
ConnectionPoolIf any connection to be stopped is currently executing a job, then it will not be stopped.
setSize in interface ConnectionPool<JPPFClientConnection>newSize - the max size as an int.public void heartbeatConnectionFailed(org.jppf.comm.recovery.HeartbeatConnectionEvent event)
heartbeatConnectionFailed in interface org.jppf.comm.recovery.HeartbeatConnectionListenerpublic List<JPPFClientConnection> awaitActiveConnections(org.jppf.utils.ComparisonOperator operator, int nbConnections)
ACTIVE status.
This is a shorthand for awaitConnections(nbConnections, Long.MAX_VALUE, JPPFClientConnectionStatus.ACTIVE).operator - the condition on the number of connections to wait for. If null, it is assumed to be Operator.EQUAL.nbConnections - the expected number of connections to wait for.nbConnections JPPFClientConnection instances with the desired status.public JPPFClientConnection awaitActiveConnection()
ACTIVE status.
This is a shorthand for awaitActiveConnections(Operator.AT_LEAST, 1).get(0).JPPFClientConnection instances with the desired status.public List<JPPFClientConnection> awaitWorkingConnections(org.jppf.utils.ComparisonOperator operator, int nbConnections)
ACTIVE or EXECUTING status.
This is a shorthand for awaitConnections(nbConnections, Long.MAX_VALUE, JPPFClientConnectionStatus.ACTIVE, JPPFClientConnectionStatus.EXECUTING).operator - the condition on the number of connections to wait for. If null, it is assumed to be Operator.EQUAL.nbConnections - the number of connections to wait for.nbConnections JPPFClientConnection instances with the desired status.public JPPFClientConnection awaitWorkingConnection()
ACTIVE or EXECUTING status.
This is a shorthand for awaitWorkingConnections(Operator.AT_LEAST, 1).get(0).nbConnections JPPFClientConnection instances with the desired status.public List<JPPFClientConnection> awaitConnections(org.jppf.utils.ComparisonOperator operator, int nbConnections, JPPFClientConnectionStatus... statuses)
awaitConnections(nbConnections, Long.MAX_VALUE, JPPFstatuses).operator - the condition on the number of connections to wait for. If null, it is assumed to be Operator.EQUAL.nbConnections - the number of connections to wait for.statuses - the possible statuses of the connections to wait for.nbConnections JPPFClientConnection instances.public JPPFClientConnection awaitConnection(JPPFClientConnectionStatus... statuses)
awaitConnections(Operator.AT_LEAST, 1, Long.MAX_VALUE, statuses).get(0).statuses - the possible statuses of the connections to wait for.JPPFClientConnection instance in one of the specified statuses.public List<JPPFClientConnection> awaitConnections(org.jppf.utils.ComparisonOperator operator, int nbConnections, long timeout, JPPFClientConnectionStatus... statuses)
operator - the condition on the number of connections to wait for. If null, it is assumed to be Operator.EQUAL.nbConnections - the number of connections to wait for.timeout - the maximum time to wait, in milliseconds.statuses - the possible statuses of the connections to wait for.JPPFClientConnection instances, possibly less than the requested number if the timeout expired first.public List<org.jppf.management.JMXDriverConnectionWrapper> awaitJMXConnections(org.jppf.utils.ComparisonOperator operator, int nbConnections, boolean connectedOnly)
awaitJMXConnections(nbConnections, Long.MAX_VALUE, connectedOnly).operator - the condition on the number of connections to wait for. If null, it is assumed to be Operator.EQUAL.nbConnections - the number of connections to wait for.connectedOnly - specifies whether to get a connection in connected state only or in any state.nbConnections JMXDriverConnectionWrapper instances.public List<org.jppf.management.JMXDriverConnectionWrapper> awaitJMXConnections(org.jppf.utils.ComparisonOperator operator, int nbConnections, long timeout, boolean connectedOnly)
operator - the condition on the number of connections to wait for. If null, it is assumed to be Operator.EQUAL.nbConnections - the number of connections to wait for.timeout - the maximum time to wait, in milliseconds.connectedOnly - specifies whether to get a connection in connected state only or in any state.JMXDriverConnectionWrapper instances, possibly less than the requested number if the timeout expired first.public org.jppf.management.JMXDriverConnectionWrapper awaitJMXConnection(boolean connectedOnly)
awaitJMXConnections(Operator.AT_LEAST, 1, connectedOnly).get(0).connectedOnly - specifies whether to get a connection in connected state only or in any state.JMXDriverConnectionWrapper instance in the specified connected state.public org.jppf.management.JMXDriverConnectionWrapper awaitWorkingJMXConnection()
awaitJMXConnections(Operator.AT_LEAST, 1, true).get(0).JMXDriverConnectionWrapper instance.public void close()
close in interface AutoCloseableclose in class AbstractClientConnectionPoolpublic String toString()
toString in class AbstractConnectionPool<JPPFClientConnection>Copyright © 2005-2019 JPPF Team.