public class com.mongodb.internal.connection.ConcurrentPool<T> implements com.mongodb.internal.connection.Pool<T>
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: com.mongodb.internal.connection.ConcurrentPool
super_class: java.lang.Object
{
private final int maxSize;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final com.mongodb.internal.connection.ConcurrentPool$ItemFactory<T> itemFactory;
descriptor: Lcom/mongodb/internal/connection/ConcurrentPool$ItemFactory;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Lcom/mongodb/internal/connection/ConcurrentPool$ItemFactory<TT;>;
private final com.mongodb.internal.connection.ConcurrentLinkedDeque<T> available;
descriptor: Lcom/mongodb/internal/connection/ConcurrentLinkedDeque;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Lcom/mongodb/internal/connection/ConcurrentLinkedDeque<TT;>;
private final java.util.concurrent.Semaphore permits;
descriptor: Ljava/util/concurrent/Semaphore;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private volatile boolean closed;
descriptor: Z
flags: (0x0042) ACC_PRIVATE, ACC_VOLATILE
public void <init>(int, com.mongodb.internal.connection.ConcurrentPool$ItemFactory<T>);
descriptor: (ILcom/mongodb/internal/connection/ConcurrentPool$ItemFactory;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new com.mongodb.internal.connection.ConcurrentLinkedDeque
dup
invokespecial com.mongodb.internal.connection.ConcurrentLinkedDeque.<init>:()V
putfield com.mongodb.internal.connection.ConcurrentPool.available:Lcom/mongodb/internal/connection/ConcurrentLinkedDeque;
2: aload 0
iload 1
putfield com.mongodb.internal.connection.ConcurrentPool.maxSize:I
3: aload 0
aload 2
putfield com.mongodb.internal.connection.ConcurrentPool.itemFactory:Lcom/mongodb/internal/connection/ConcurrentPool$ItemFactory;
4: aload 0
new java.util.concurrent.Semaphore
dup
iload 1
iconst_1
invokespecial java.util.concurrent.Semaphore.<init>:(IZ)V
putfield com.mongodb.internal.connection.ConcurrentPool.permits:Ljava/util/concurrent/Semaphore;
5: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
0 6 1 maxSize I
0 6 2 itemFactory Lcom/mongodb/internal/connection/ConcurrentPool$ItemFactory<TT;>;
Signature: (ILcom/mongodb/internal/connection/ConcurrentPool$ItemFactory<TT;>;)V
MethodParameters:
Name Flags
maxSize final
itemFactory final
public void release();
descriptor: (Ljava/lang/Object;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
aload 1
iconst_0
invokevirtual com.mongodb.internal.connection.ConcurrentPool.release:(Ljava/lang/Object;Z)V
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
0 2 1 t TT;
Signature: (TT;)V
MethodParameters:
Name Flags
t final
public void release(T, );
descriptor: (Ljava/lang/Object;Z)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 1
ifnonnull 2
1: new java.lang.IllegalArgumentException
dup
ldc "Can not return a null item to the pool"
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.closed:Z
ifeq 5
3: aload 0
aload 1
invokevirtual com.mongodb.internal.connection.ConcurrentPool.close:(Ljava/lang/Object;)V
4: return
5: StackMap locals:
StackMap stack:
iload 2
ifeq 8
6: aload 0
aload 1
invokevirtual com.mongodb.internal.connection.ConcurrentPool.close:(Ljava/lang/Object;)V
7: goto 9
8: StackMap locals:
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.available:Lcom/mongodb/internal/connection/ConcurrentLinkedDeque;
aload 1
invokevirtual com.mongodb.internal.connection.ConcurrentLinkedDeque.addLast:(Ljava/lang/Object;)V
9: StackMap locals:
StackMap stack:
aload 0
invokevirtual com.mongodb.internal.connection.ConcurrentPool.releasePermit:()V
10: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
0 11 1 t TT;
0 11 2 prune Z
Signature: (TT;Z)V
MethodParameters:
Name Flags
t final
prune final
public T get();
descriptor: ()Ljava/lang/Object;
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
ldc -1
getstatic java.util.concurrent.TimeUnit.MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.internal.connection.ConcurrentPool.get:(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
Signature: ()TT;
public T get(long, java.util.concurrent.TimeUnit);
descriptor: (JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
flags: (0x0001) ACC_PUBLIC
Code:
stack=8, locals=5, args_size=3
start local 0 start local 1 start local 3 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.closed:Z
ifeq 2
1: new java.lang.IllegalStateException
dup
ldc "The pool is closed"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
lload 1
aload 3
invokevirtual com.mongodb.internal.connection.ConcurrentPool.acquirePermit:(JLjava/util/concurrent/TimeUnit;)Z
ifne 4
3: new com.mongodb.MongoTimeoutException
dup
ldc "Timeout waiting for a pooled item after %d %s"
iconst_2
anewarray java.lang.Object
dup
iconst_0
lload 1
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
aastore
dup
iconst_1
aload 3
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial com.mongodb.MongoTimeoutException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.available:Lcom/mongodb/internal/connection/ConcurrentLinkedDeque;
invokevirtual com.mongodb.internal.connection.ConcurrentLinkedDeque.pollLast:()Ljava/lang/Object;
astore 4
start local 4 5: aload 4
ifnonnull 7
6: aload 0
iconst_0
invokevirtual com.mongodb.internal.connection.ConcurrentPool.createNewAndReleasePermitIfFailure:(Z)Ljava/lang/Object;
astore 4
7: StackMap locals: java.lang.Object
StackMap stack:
aload 4
areturn
end local 4 end local 3 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
0 8 1 timeout J
0 8 3 timeUnit Ljava/util/concurrent/TimeUnit;
5 8 4 t TT;
Signature: (JLjava/util/concurrent/TimeUnit;)TT;
MethodParameters:
Name Flags
timeout final
timeUnit final
public void prune();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=5, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.available:Lcom/mongodb/internal/connection/ConcurrentLinkedDeque;
invokevirtual com.mongodb.internal.connection.ConcurrentLinkedDeque.iterator:()Lcom/mongodb/internal/connection/ConcurrentLinkedDeque$RemovalReportingIterator;
astore 1
start local 1 1: goto 10
2: StackMap locals: com.mongodb.internal.connection.ConcurrentLinkedDeque$RemovalReportingIterator
StackMap stack:
aload 1
invokeinterface com.mongodb.internal.connection.ConcurrentLinkedDeque$RemovalReportingIterator.next:()Ljava/lang/Object;
astore 2
start local 2 3: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.itemFactory:Lcom/mongodb/internal/connection/ConcurrentPool$ItemFactory;
aload 2
invokeinterface com.mongodb.internal.connection.ConcurrentPool$ItemFactory.shouldPrune:(Ljava/lang/Object;)Lcom/mongodb/internal/connection/ConcurrentPool$Prune;
astore 3
start local 3 4: aload 3
getstatic com.mongodb.internal.connection.ConcurrentPool$Prune.STOP:Lcom/mongodb/internal/connection/ConcurrentPool$Prune;
if_acmpne 6
5: goto 11
6: StackMap locals: java.lang.Object com.mongodb.internal.connection.ConcurrentPool$Prune
StackMap stack:
aload 3
getstatic com.mongodb.internal.connection.ConcurrentPool$Prune.YES:Lcom/mongodb/internal/connection/ConcurrentPool$Prune;
if_acmpne 10
7: aload 1
invokeinterface com.mongodb.internal.connection.ConcurrentLinkedDeque$RemovalReportingIterator.reportingRemove:()Z
istore 4
start local 4 8: iload 4
ifeq 10
9: aload 0
aload 2
invokevirtual com.mongodb.internal.connection.ConcurrentPool.close:(Ljava/lang/Object;)V
end local 4 end local 3 end local 2 10: StackMap locals:
StackMap stack:
aload 1
invokeinterface com.mongodb.internal.connection.ConcurrentLinkedDeque$RemovalReportingIterator.hasNext:()Z
ifne 2
end local 1 11: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
1 11 1 iter Lcom/mongodb/internal/connection/ConcurrentLinkedDeque$RemovalReportingIterator<TT;>;
3 10 2 cur TT;
4 10 3 shouldPrune Lcom/mongodb/internal/connection/ConcurrentPool$Prune;
8 10 4 removed Z
public void ensureMinSize(int, boolean);
descriptor: (IZ)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=3, args_size=3
start local 0 start local 1 start local 2 0: goto 4
1: StackMap locals:
StackMap stack:
aload 0
ldc 10
getstatic java.util.concurrent.TimeUnit.MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.internal.connection.ConcurrentPool.acquirePermit:(JLjava/util/concurrent/TimeUnit;)Z
ifne 3
2: goto 5
3: StackMap locals:
StackMap stack:
aload 0
aload 0
iload 2
invokevirtual com.mongodb.internal.connection.ConcurrentPool.createNewAndReleasePermitIfFailure:(Z)Ljava/lang/Object;
invokevirtual com.mongodb.internal.connection.ConcurrentPool.release:(Ljava/lang/Object;)V
4: StackMap locals:
StackMap stack:
aload 0
invokevirtual com.mongodb.internal.connection.ConcurrentPool.getCount:()I
iload 1
if_icmplt 1
5: StackMap locals:
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
0 6 1 minSize I
0 6 2 initialize Z
MethodParameters:
Name Flags
minSize final
initialize final
private T createNewAndReleasePermitIfFailure();
descriptor: (Z)Ljava/lang/Object;
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.itemFactory:Lcom/mongodb/internal/connection/ConcurrentPool$ItemFactory;
iload 1
invokeinterface com.mongodb.internal.connection.ConcurrentPool$ItemFactory.create:(Z)Ljava/lang/Object;
astore 2
start local 2 1: aload 2
ifnonnull 3
2: new com.mongodb.MongoInternalException
dup
ldc "The factory for the pool created a null item"
invokespecial com.mongodb.MongoInternalException.<init>:(Ljava/lang/String;)V
athrow
3: StackMap locals: java.lang.Object
StackMap stack:
aload 2
4: areturn
end local 2 5: StackMap locals: com.mongodb.internal.connection.ConcurrentPool int
StackMap stack: java.lang.RuntimeException
astore 2
start local 2 6: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.permits:Ljava/util/concurrent/Semaphore;
invokevirtual java.util.concurrent.Semaphore.release:()V
7: aload 2
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
0 8 1 initialize Z
1 5 2 newMember TT;
6 8 2 e Ljava/lang/RuntimeException;
Exception table:
from to target type
0 4 5 Class java.lang.RuntimeException
Signature: (Z)TT;
MethodParameters:
Name Flags
initialize final
protected boolean acquirePermit(long, java.util.concurrent.TimeUnit);
descriptor: (JLjava/util/concurrent/TimeUnit;)Z
flags: (0x0004) ACC_PROTECTED
Code:
stack=4, locals=5, args_size=3
start local 0 start local 1 start local 3 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.closed:Z
ifeq 2
1: iconst_0
ireturn
2: StackMap locals:
StackMap stack:
lload 1
lconst_0
lcmp
iflt 5
3: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.permits:Ljava/util/concurrent/Semaphore;
lload 1
aload 3
invokevirtual java.util.concurrent.Semaphore.tryAcquire:(JLjava/util/concurrent/TimeUnit;)Z
4: ireturn
5: StackMap locals:
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.permits:Ljava/util/concurrent/Semaphore;
invokevirtual java.util.concurrent.Semaphore.acquire:()V
6: iconst_1
ireturn
7: StackMap locals:
StackMap stack: java.lang.InterruptedException
astore 4
start local 4 8: new com.mongodb.MongoInterruptedException
dup
ldc "Interrupted acquiring a permit to retrieve an item from the pool "
aload 4
invokespecial com.mongodb.MongoInterruptedException.<init>:(Ljava/lang/String;Ljava/lang/Exception;)V
athrow
end local 4 end local 3 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
0 9 1 timeout J
0 9 3 timeUnit Ljava/util/concurrent/TimeUnit;
8 9 4 e Ljava/lang/InterruptedException;
Exception table:
from to target type
0 1 7 Class java.lang.InterruptedException
2 4 7 Class java.lang.InterruptedException
5 6 7 Class java.lang.InterruptedException
MethodParameters:
Name Flags
timeout final
timeUnit final
protected void releasePermit();
descriptor: ()V
flags: (0x0004) ACC_PROTECTED
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.permits:Ljava/util/concurrent/Semaphore;
invokevirtual java.util.concurrent.Semaphore.release:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
public void close();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=3, args_size=1
start local 0 0: aload 0
iconst_1
putfield com.mongodb.internal.connection.ConcurrentPool.closed:Z
1: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.available:Lcom/mongodb/internal/connection/ConcurrentLinkedDeque;
invokevirtual com.mongodb.internal.connection.ConcurrentLinkedDeque.iterator:()Lcom/mongodb/internal/connection/ConcurrentLinkedDeque$RemovalReportingIterator;
astore 1
start local 1 2: goto 6
3: StackMap locals: java.util.Iterator
StackMap stack:
aload 1
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
astore 2
start local 2 4: aload 0
aload 2
invokevirtual com.mongodb.internal.connection.ConcurrentPool.close:(Ljava/lang/Object;)V
5: aload 1
invokeinterface java.util.Iterator.remove:()V
end local 2 6: StackMap locals:
StackMap stack:
aload 1
invokeinterface java.util.Iterator.hasNext:()Z
ifne 3
7: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
2 8 1 iter Ljava/util/Iterator<TT;>;
4 6 2 t TT;
public int getMaxSize();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.maxSize:I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
public int getInUseCount();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.maxSize:I
aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.permits:Ljava/util/concurrent/Semaphore;
invokevirtual java.util.concurrent.Semaphore.availablePermits:()I
isub
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
public int getAvailableCount();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.available:Lcom/mongodb/internal/connection/ConcurrentLinkedDeque;
invokevirtual com.mongodb.internal.connection.ConcurrentLinkedDeque.size:()I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
public int getCount();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
invokevirtual com.mongodb.internal.connection.ConcurrentPool.getInUseCount:()I
aload 0
invokevirtual com.mongodb.internal.connection.ConcurrentPool.getAvailableCount:()I
iadd
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
public java.lang.String toString();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=1
start local 0 0: new java.lang.StringBuilder
dup
invokespecial java.lang.StringBuilder.<init>:()V
astore 1
start local 1 1: aload 1
ldc "pool: "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
2: ldc " maxSize: "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.maxSize:I
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
3: ldc " availableCount "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 0
invokevirtual com.mongodb.internal.connection.ConcurrentPool.getAvailableCount:()I
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
4: ldc " inUseCount "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 0
invokevirtual com.mongodb.internal.connection.ConcurrentPool.getInUseCount:()I
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
pop
5: aload 1
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
1 6 1 buf Ljava/lang/StringBuilder;
private void close();
descriptor: (Ljava/lang/Object;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield com.mongodb.internal.connection.ConcurrentPool.itemFactory:Lcom/mongodb/internal/connection/ConcurrentPool$ItemFactory;
aload 1
invokeinterface com.mongodb.internal.connection.ConcurrentPool$ItemFactory.close:(Ljava/lang/Object;)V
1: goto 3
StackMap locals:
StackMap stack: java.lang.RuntimeException
2: pop
3: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lcom/mongodb/internal/connection/ConcurrentPool<TT;>;
0 4 1 t TT;
Exception table:
from to target type
0 1 2 Class java.lang.RuntimeException
Signature: (TT;)V
MethodParameters:
Name Flags
t final
}
Signature: <T:Ljava/lang/Object;>Ljava/lang/Object;Lcom/mongodb/internal/connection/Pool<TT;>;
SourceFile: "ConcurrentPool.java"
NestMembers:
com.mongodb.internal.connection.ConcurrentPool$ItemFactory com.mongodb.internal.connection.ConcurrentPool$Prune
InnerClasses:
public abstract RemovalReportingIterator = com.mongodb.internal.connection.ConcurrentLinkedDeque$RemovalReportingIterator of com.mongodb.internal.connection.ConcurrentLinkedDeque
public abstract ItemFactory = com.mongodb.internal.connection.ConcurrentPool$ItemFactory of com.mongodb.internal.connection.ConcurrentPool
public final Prune = com.mongodb.internal.connection.ConcurrentPool$Prune of com.mongodb.internal.connection.ConcurrentPool