Class PooledSender

    • Field Detail

      • sm

        protected static final StringManager sm
        StringManager for internationalized log messages.
    • Constructor Detail

      • PooledSender

        public PooledSender()
        Creates a new PooledSender with the default pool size.
    • Method Detail

      • getNewDataSender

        public abstract DataSender getNewDataSender()
        Creates and returns a new DataSender instance for the pool.
        Returns:
        a new DataSender
      • getSender

        public DataSender getSender()
        Retrieves a sender from the pool, waiting up to maxWait milliseconds.
        Returns:
        a DataSender from the pool, or null if timeout expires
      • returnSender

        public void returnSender​(DataSender sender)
        Returns a sender back to the pool after use.
        Parameters:
        sender - the sender to return
      • connect

        public void connect()
                     throws java.io.IOException
        Description copied from interface: DataSender
        Connect.
        Specified by:
        connect in interface DataSender
        Throws:
        java.io.IOException - when an error occurs
      • getInPoolSize

        public int getInPoolSize()
        Returns the number of senders currently available in the pool.
        Returns:
        the number of senders in the pool
      • getInUsePoolSize

        public int getInUsePoolSize()
        Returns the number of senders currently in use.
        Returns:
        the number of senders in use
      • setPoolSize

        public void setPoolSize​(int poolSize)
        Sets the maximum number of senders in the pool.
        Parameters:
        poolSize - the pool size
      • getPoolSize

        public int getPoolSize()
        Returns the maximum number of senders in the pool.
        Returns:
        the pool size
      • getMaxWait

        public long getMaxWait()
        Returns the maximum time to wait for a sender from the pool, in milliseconds.
        Returns:
        the maximum wait time
      • setMaxWait

        public void setMaxWait​(long maxWait)
        Sets the maximum time to wait for a sender from the pool, in milliseconds.
        Parameters:
        maxWait - the maximum wait time
      • add

        public void add​(Member member)
        Description copied from interface: MultiPointSender
        Send to the specified member.
        Specified by:
        add in interface MultiPointSender
        Parameters:
        member - the member
      • remove

        public void remove​(Member member)
        Description copied from interface: MultiPointSender
        Stop sending to the specified member.
        Specified by:
        remove in interface MultiPointSender
        Parameters:
        member - the member