Class MQTTConnectionPool

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.commons.pool2.impl.GenericObjectPoolMXBean, org.apache.commons.pool2.ObjectPool<org.fusesource.mqtt.client.BlockingConnection>, org.apache.commons.pool2.UsageTracking<org.fusesource.mqtt.client.BlockingConnection>

    public class MQTTConnectionPool
    extends org.apache.commons.pool2.impl.GenericObjectPool<org.fusesource.mqtt.client.BlockingConnection>
    • Field Summary

      • Fields inherited from class org.apache.commons.pool2.impl.BaseGenericObjectPool

        abandonedConfig, MEAN_TIMING_STATS_CACHE_SIZE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearAndClose()  
      void connect()  
      static MQTTConnectionPool getInstance​(java.lang.String host, int port, java.lang.String username, MQTTConnectionFactory factory, int size)  
      void publish​(java.lang.String topic, byte[] payload, org.fusesource.mqtt.client.QoS qos, boolean retain)  
      • Methods inherited from class org.apache.commons.pool2.impl.GenericObjectPool

        addObject, borrowObject, borrowObject, borrowObject, clear, close, evict, getFactory, getFactoryType, getMaxIdle, getMinIdle, getNumActive, getNumIdle, getNumWaiters, invalidateObject, invalidateObject, listAllObjects, preparePool, returnObject, setConfig, setMaxIdle, setMinIdle, toStringAppendFields, use
      • Methods inherited from class org.apache.commons.pool2.impl.BaseGenericObjectPool

        getBlockWhenExhausted, getBorrowedCount, getCreatedCount, getCreationStackTrace, getDestroyedByBorrowValidationCount, getDestroyedByEvictorCount, getDestroyedCount, getDurationBetweenEvictionRuns, getEvictionPolicy, getEvictionPolicyClassName, getEvictorShutdownTimeout, getEvictorShutdownTimeoutDuration, getEvictorShutdownTimeoutMillis, getFairness, getJmxName, getLifo, getLogAbandoned, getMaxBorrowWaitTimeMillis, getMaxTotal, getMaxWaitDuration, getMaxWaitMillis, getMeanActiveTimeMillis, getMeanBorrowWaitTimeMillis, getMeanIdleTimeMillis, getMessageStatistics, getMinEvictableIdleDuration, getMinEvictableIdleTime, getMinEvictableIdleTimeMillis, getNumTestsPerEvictionRun, getRemoveAbandonedOnBorrow, getRemoveAbandonedOnMaintenance, getRemoveAbandonedTimeout, getRemoveAbandonedTimeoutDuration, getReturnedCount, getSoftMinEvictableIdleDuration, getSoftMinEvictableIdleTime, getSoftMinEvictableIdleTimeMillis, getSwallowedExceptionListener, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRuns, getTimeBetweenEvictionRunsMillis, isAbandonedConfig, isClosed, markReturningState, setAbandonedConfig, setBlockWhenExhausted, setConfig, setEvictionPolicy, setEvictionPolicyClassName, setEvictionPolicyClassName, setEvictorShutdownTimeout, setEvictorShutdownTimeoutMillis, setLifo, setMaxTotal, setMaxWait, setMaxWaitMillis, setMessagesStatistics, setMinEvictableIdle, setMinEvictableIdleTime, setMinEvictableIdleTimeMillis, setNumTestsPerEvictionRun, setSoftMinEvictableIdle, setSoftMinEvictableIdleTime, setSoftMinEvictableIdleTimeMillis, setSwallowedExceptionListener, setTestOnBorrow, setTestOnCreate, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRuns, setTimeBetweenEvictionRunsMillis
      • Methods inherited from class org.apache.commons.pool2.BaseObject

        toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.apache.commons.pool2.impl.GenericObjectPoolMXBean

        getBlockWhenExhausted, getBorrowedCount, getCreatedCount, getCreationStackTrace, getDestroyedByBorrowValidationCount, getDestroyedByEvictorCount, getDestroyedCount, getFairness, getLifo, getLogAbandoned, getMaxBorrowWaitTimeMillis, getMaxTotal, getMaxWaitMillis, getMeanActiveTimeMillis, getMeanBorrowWaitTimeMillis, getMeanIdleTimeMillis, getMinEvictableIdleTimeMillis, getNumTestsPerEvictionRun, getRemoveAbandonedOnBorrow, getRemoveAbandonedOnMaintenance, getRemoveAbandonedTimeout, getReturnedCount, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, isAbandonedConfig, isClosed
      • Methods inherited from interface org.apache.commons.pool2.ObjectPool

        addObjects
    • Method Detail

      • getInstance

        public static MQTTConnectionPool getInstance​(java.lang.String host,
                                                     int port,
                                                     java.lang.String username,
                                                     MQTTConnectionFactory factory,
                                                     int size)
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • connect

        public void connect()
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • clearAndClose

        public void clearAndClose()
      • publish

        public void publish​(java.lang.String topic,
                            byte[] payload,
                            org.fusesource.mqtt.client.QoS qos,
                            boolean retain)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception