类 RabbitPoolFactory

  • 所有已实现的接口:
    org.apache.commons.pool2.PooledObjectFactory<com.rabbitmq.client.Connection>

    public final class RabbitPoolFactory
    extends java.lang.Object
    implements org.apache.commons.pool2.PooledObjectFactory<com.rabbitmq.client.Connection>
    RabbitMQ连接池
    版本:
    1.0 2018-9-30
    作者:
    帮帮组
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void activateObject​(org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> pooledObject)
      激活池对象
      void destroyObject​(org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> pooledObject)
      销毁池对象
      org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> makeObject()
      创建一个新的池对象
      void passivateObject​(org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> pooledObject)
      钝化池对象,清除旧数据
      boolean validateObject​(org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> pooledObject)
      验证池对象是否有效
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • RabbitPoolFactory

        public RabbitPoolFactory()
    • 方法详细资料

      • makeObject

        public org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> makeObject()
        创建一个新的池对象
        指定者:
        makeObject 在接口中 org.apache.commons.pool2.PooledObjectFactory<com.rabbitmq.client.Connection>
        返回:
        一个新的池对象
      • destroyObject

        public void destroyObject​(org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> pooledObject)
        销毁池对象
        指定者:
        destroyObject 在接口中 org.apache.commons.pool2.PooledObjectFactory<com.rabbitmq.client.Connection>
        参数:
        pooledObject - 池对象
      • validateObject

        public boolean validateObject​(org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> pooledObject)
        验证池对象是否有效
        指定者:
        validateObject 在接口中 org.apache.commons.pool2.PooledObjectFactory<com.rabbitmq.client.Connection>
        参数:
        pooledObject - 池对象
        返回:
        是否有效
      • activateObject

        public void activateObject​(org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> pooledObject)
        激活池对象
        指定者:
        activateObject 在接口中 org.apache.commons.pool2.PooledObjectFactory<com.rabbitmq.client.Connection>
        参数:
        pooledObject - 池对象
      • passivateObject

        public void passivateObject​(org.apache.commons.pool2.PooledObject<com.rabbitmq.client.Connection> pooledObject)
                             throws java.lang.Exception
        钝化池对象,清除旧数据
        指定者:
        passivateObject 在接口中 org.apache.commons.pool2.PooledObjectFactory<com.rabbitmq.client.Connection>
        参数:
        pooledObject - 池对象
        抛出:
        java.lang.Exception