Class MQTTConnectionPool
- java.lang.Object
-
- org.apache.commons.pool2.BaseObject
-
- org.apache.commons.pool2.impl.BaseGenericObjectPool<T>
-
- org.apache.commons.pool2.impl.GenericObjectPool<org.fusesource.mqtt.client.BlockingConnection>
-
- org.apache.iotdb.db.engine.trigger.utils.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>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAndClose()voidconnect()static MQTTConnectionPoolgetInstance(java.lang.String host, int port, java.lang.String username, MQTTConnectionFactory factory, int size)voidpublish(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 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
-
-
-
-
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
-
-