Package io.hyperfoil.http.config
Enum ConnectionStrategy
- java.lang.Object
-
- java.lang.Enum<ConnectionStrategy>
-
- io.hyperfoil.http.config.ConnectionStrategy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ConnectionStrategy>
public enum ConnectionStrategy extends java.lang.Enum<ConnectionStrategy>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALWAYS_NEWAlways create the connection before the request and close it when it is complete.OPEN_ON_REQUESTConnections are created before request or borrowed from a session-local pool.SESSION_POOLSConnections are created in a shared pool.SHARED_POOLConnections are created in a pool and then borrowed by the session.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConnectionStrategyvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ConnectionStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SHARED_POOL
public static final ConnectionStrategy SHARED_POOL
Connections are created in a pool and then borrowed by the session. When the request is complete the connection is returned to the shared pool.
-
SESSION_POOLS
public static final ConnectionStrategy SESSION_POOLS
Connections are created in a shared pool. When the request is completed it is not returned to the shared pool but to a session-local pool. Subsequent requests by this session first try to acquire the connection from this local pool. When the session completes all connections from the session-local pool are returned to the shared pool.
-
OPEN_ON_REQUEST
public static final ConnectionStrategy OPEN_ON_REQUEST
Connections are created before request or borrowed from a session-local pool. When the request is completed the connection is returned to this pool. When the session completes all connections from the session-local pool are closed.
-
ALWAYS_NEW
public static final ConnectionStrategy ALWAYS_NEW
Always create the connection before the request and close it when it is complete. No pooling of connections.
-
-
Method Detail
-
values
public static ConnectionStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ConnectionStrategy c : ConnectionStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConnectionStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-