Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.eyrie.remctl.client;

Allow plugable strategies for validation that a RemctlConnection is fit for use.

Usually used by RemctlConnectionPool (in conjunction with RemctlConnectionFactory) for validating connections that are in the pool. Actions in isValid will also be performed on idle connections, to keep them alive.

See org.apache.commons.pool.impl.GenericObjectPool.getTestWhileIdle() and org.apache.commons.pool.impl.GenericObjectPool.getTestOnBorrow() for configuring when isValid(org.eyrie.remctl.client.RemctlConnection) will be called, and RemctlConnectionFactory.validateObject(java.lang.Object) for where the strategy is plugged in.

public interface RemctlConnectionValidationStrategy {

Determines if the connection is still valid for use.

When returning true, implementations must leave the connection in a state where it can be re-used. All implementations must be thread safe.

connection The connection to test
true if the connection is ready for use, false otherwise
    boolean isValid(RemctlConnection connection);
New to GrepCode? Check out our FAQ X