Record Class PoolConfig

java.lang.Object
java.lang.Record
com.tnsai.coordination.pool.PoolConfig
Record Components:
minIdle - minimum number of idle agents to maintain
maxSize - maximum total agents (idle + active)
idleTimeoutMs - time in ms before an idle agent is evicted
activationPolicy - how agents are created and maintained

public record PoolConfig(int minIdle, int maxSize, long idleTimeoutMs, ActivationPolicy activationPolicy) extends Record
Configuration for a LazyAgentPool.
  • Constructor Details

    • PoolConfig

      public PoolConfig(int minIdle, int maxSize, long idleTimeoutMs, ActivationPolicy activationPolicy)
      Creates an instance of a PoolConfig record class.
      Parameters:
      minIdle - the value for the minIdle record component
      maxSize - the value for the maxSize record component
      idleTimeoutMs - the value for the idleTimeoutMs record component
      activationPolicy - the value for the activationPolicy record component
  • Method Details

    • defaults

      public static PoolConfig defaults()
      Returns a default configuration: minIdle=0, maxSize=10, idleTimeoutMs=60000, ON_DEMAND.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • minIdle

      public int minIdle()
      Returns the value of the minIdle record component.
      Returns:
      the value of the minIdle record component
    • maxSize

      public int maxSize()
      Returns the value of the maxSize record component.
      Returns:
      the value of the maxSize record component
    • idleTimeoutMs

      public long idleTimeoutMs()
      Returns the value of the idleTimeoutMs record component.
      Returns:
      the value of the idleTimeoutMs record component
    • activationPolicy

      public ActivationPolicy activationPolicy()
      Returns the value of the activationPolicy record component.
      Returns:
      the value of the activationPolicy record component