Package com.tnsai.coordination.pool
Record Class PoolConfig
java.lang.Object
java.lang.Record
com.tnsai.coordination.pool.PoolConfig
- Record Components:
minIdle- minimum number of idle agents to maintainmaxSize- maximum total agents (idle + active)idleTimeoutMs- time in ms before an idle agent is evictedactivationPolicy- how agents are created and maintained
public record PoolConfig(int minIdle, int maxSize, long idleTimeoutMs, ActivationPolicy activationPolicy)
extends Record
Configuration for a
LazyAgentPool.-
Constructor Summary
ConstructorsConstructorDescriptionPoolConfig(int minIdle, int maxSize, long idleTimeoutMs, ActivationPolicy activationPolicy) Creates an instance of aPoolConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactivationPolicyrecord component.static PoolConfigdefaults()Returns a default configuration: minIdle=0, maxSize=10, idleTimeoutMs=60000, ON_DEMAND.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theidleTimeoutMsrecord component.intmaxSize()Returns the value of themaxSizerecord component.intminIdle()Returns the value of theminIdlerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PoolConfig
Creates an instance of aPoolConfigrecord class.- Parameters:
minIdle- the value for theminIdlerecord componentmaxSize- the value for themaxSizerecord componentidleTimeoutMs- the value for theidleTimeoutMsrecord componentactivationPolicy- the value for theactivationPolicyrecord component
-
-
Method Details
-
defaults
Returns a default configuration: minIdle=0, maxSize=10, idleTimeoutMs=60000, ON_DEMAND. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
minIdle
public int minIdle()Returns the value of theminIdlerecord component.- Returns:
- the value of the
minIdlerecord component
-
maxSize
public int maxSize()Returns the value of themaxSizerecord component.- Returns:
- the value of the
maxSizerecord component
-
idleTimeoutMs
public long idleTimeoutMs()Returns the value of theidleTimeoutMsrecord component.- Returns:
- the value of the
idleTimeoutMsrecord component
-
activationPolicy
Returns the value of theactivationPolicyrecord component.- Returns:
- the value of the
activationPolicyrecord component
-