Class KryoPoolQueueImpl

  • All Implemented Interfaces:
    KryoPool

    class KryoPoolQueueImpl
    extends java.lang.Object
    implements KryoPool
    A simple Queue based KryoPool implementation, should be built using the KryoPool.Builder.
    • Field Detail

      • queue

        private final java.util.Queue<Kryo> queue
    • Constructor Detail

      • KryoPoolQueueImpl

        KryoPoolQueueImpl​(KryoFactory factory,
                          java.util.Queue<Kryo> queue)
    • Method Detail

      • size

        public int size()
      • borrow

        public Kryo borrow()
        Description copied from interface: KryoPool
        Takes a Kryo instance from the pool or creates a new one (using the factory) if the pool is empty.
        Specified by:
        borrow in interface KryoPool
      • release

        public void release​(Kryo kryo)
        Description copied from interface: KryoPool
        Returns the given Kryo instance to the pool.
        Specified by:
        release in interface KryoPool
      • clear

        public void clear()