final class sun.security.pkcs11.SessionManager
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: sun.security.pkcs11.SessionManager
super_class: java.lang.Object
{
private static final int DEFAULT_MAX_SESSIONS;
descriptor: I
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 32
private static final sun.security.util.Debug debug;
descriptor: Lsun/security/util/Debug;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private final sun.security.pkcs11.Token token;
descriptor: Lsun/security/pkcs11/Token;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final int maxSessions;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private java.util.concurrent.atomic.AtomicInteger activeSessions;
descriptor: Ljava/util/concurrent/atomic/AtomicInteger;
flags: (0x0002) ACC_PRIVATE
private final sun.security.pkcs11.SessionManager$Pool objSessions;
descriptor: Lsun/security/pkcs11/SessionManager$Pool;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final sun.security.pkcs11.SessionManager$Pool opSessions;
descriptor: Lsun/security/pkcs11/SessionManager$Pool;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private int maxActiveSessions;
descriptor: I
flags: (0x0002) ACC_PRIVATE
private java.lang.Object maxActiveSessionsLock;
descriptor: Ljava/lang/Object;
flags: (0x0002) ACC_PRIVATE
private final long openSessionFlags;
descriptor: J
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc "pkcs11"
invokestatic sun.security.util.Debug.getInstance:(Ljava/lang/String;)Lsun/security/util/Debug;
putstatic sun.security.pkcs11.SessionManager.debug:Lsun/security/util/Debug;
return
LocalVariableTable:
Start End Slot Name Signature
void <init>(sun.security.pkcs11.Token);
descriptor: (Lsun/security/pkcs11/Token;)V
flags: (0x0000)
Code:
stack=5, locals=4, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new java.util.concurrent.atomic.AtomicInteger
dup
invokespecial java.util.concurrent.atomic.AtomicInteger.<init>:()V
putfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
2: aload 1
invokevirtual sun.security.pkcs11.Token.isWriteProtected:()Z
ifeq 6
3: aload 0
ldc 4
putfield sun.security.pkcs11.SessionManager.openSessionFlags:J
4: aload 1
getfield sun.security.pkcs11.Token.tokenInfo:Lsun/security/pkcs11/wrapper/CK_TOKEN_INFO;
getfield sun.security.pkcs11.wrapper.CK_TOKEN_INFO.ulMaxSessionCount:J
lstore 2
start local 2 5: goto 8
end local 2 6: StackMap locals: sun.security.pkcs11.SessionManager sun.security.pkcs11.Token
StackMap stack:
aload 0
ldc 6
putfield sun.security.pkcs11.SessionManager.openSessionFlags:J
7: aload 1
getfield sun.security.pkcs11.Token.tokenInfo:Lsun/security/pkcs11/wrapper/CK_TOKEN_INFO;
getfield sun.security.pkcs11.wrapper.CK_TOKEN_INFO.ulMaxRwSessionCount:J
lstore 2
start local 2 8: StackMap locals: long
StackMap stack:
lload 2
lconst_0
lcmp
ifne 11
9: ldc 2147483647
lstore 2
10: goto 13
StackMap locals:
StackMap stack:
11: lload 2
ldc -1
lcmp
ifeq 12
lload 2
lconst_0
lcmp
ifge 13
12: StackMap locals:
StackMap stack:
ldc 32
lstore 2
13: StackMap locals:
StackMap stack:
aload 0
lload 2
ldc 2147483647
invokestatic java.lang.Math.min:(JJ)J
l2i
putfield sun.security.pkcs11.SessionManager.maxSessions:I
14: aload 0
aload 1
putfield sun.security.pkcs11.SessionManager.token:Lsun/security/pkcs11/Token;
15: aload 0
new sun.security.pkcs11.SessionManager$Pool
dup
aload 0
iconst_1
invokespecial sun.security.pkcs11.SessionManager$Pool.<init>:(Lsun/security/pkcs11/SessionManager;Z)V
putfield sun.security.pkcs11.SessionManager.objSessions:Lsun/security/pkcs11/SessionManager$Pool;
16: aload 0
new sun.security.pkcs11.SessionManager$Pool
dup
aload 0
iconst_0
invokespecial sun.security.pkcs11.SessionManager$Pool.<init>:(Lsun/security/pkcs11/SessionManager;Z)V
putfield sun.security.pkcs11.SessionManager.opSessions:Lsun/security/pkcs11/SessionManager$Pool;
17: getstatic sun.security.pkcs11.SessionManager.debug:Lsun/security/util/Debug;
ifnull 19
18: aload 0
new java.lang.Object
dup
invokespecial java.lang.Object.<init>:()V
putfield sun.security.pkcs11.SessionManager.maxActiveSessionsLock:Ljava/lang/Object;
19: StackMap locals:
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 20 0 this Lsun/security/pkcs11/SessionManager;
0 20 1 token Lsun/security/pkcs11/Token;
5 6 2 n J
8 20 2 n J
MethodParameters:
Name Flags
token
boolean lowMaxSessions();
descriptor: ()Z
flags: (0x0000)
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield sun.security.pkcs11.SessionManager.maxSessions:I
bipush 32
if_icmpgt 1
iconst_1
ireturn
StackMap locals:
StackMap stack:
1: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lsun/security/pkcs11/SessionManager;
sun.security.pkcs11.Session getObjSession();
descriptor: ()Lsun/security/pkcs11/Session;
flags: (0x0000)
Code:
stack=2, locals=2, args_size=1
start local 0 0: aload 0
getfield sun.security.pkcs11.SessionManager.objSessions:Lsun/security/pkcs11/SessionManager$Pool;
invokevirtual sun.security.pkcs11.SessionManager$Pool.poll:()Lsun/security/pkcs11/Session;
astore 1
start local 1 1: aload 1
ifnull 3
2: aload 0
aload 1
invokevirtual sun.security.pkcs11.SessionManager.ensureValid:(Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
areturn
3: StackMap locals: sun.security.pkcs11.Session
StackMap stack:
aload 0
getfield sun.security.pkcs11.SessionManager.opSessions:Lsun/security/pkcs11/SessionManager$Pool;
invokevirtual sun.security.pkcs11.SessionManager$Pool.poll:()Lsun/security/pkcs11/Session;
astore 1
4: aload 1
ifnull 6
5: aload 0
aload 1
invokevirtual sun.security.pkcs11.SessionManager.ensureValid:(Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
areturn
6: StackMap locals:
StackMap stack:
aload 0
invokevirtual sun.security.pkcs11.SessionManager.openSession:()Lsun/security/pkcs11/Session;
astore 1
7: aload 0
aload 1
invokevirtual sun.security.pkcs11.SessionManager.ensureValid:(Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lsun/security/pkcs11/SessionManager;
1 8 1 session Lsun/security/pkcs11/Session;
Exceptions:
throws sun.security.pkcs11.wrapper.PKCS11Exception
sun.security.pkcs11.Session getOpSession();
descriptor: ()Lsun/security/pkcs11/Session;
flags: (0x0000)
Code:
stack=3, locals=2, args_size=1
start local 0 0: aload 0
getfield sun.security.pkcs11.SessionManager.opSessions:Lsun/security/pkcs11/SessionManager$Pool;
invokevirtual sun.security.pkcs11.SessionManager$Pool.poll:()Lsun/security/pkcs11/Session;
astore 1
start local 1 1: aload 1
ifnull 3
2: aload 0
aload 1
invokevirtual sun.security.pkcs11.SessionManager.ensureValid:(Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
areturn
3: StackMap locals: sun.security.pkcs11.Session
StackMap stack:
aload 0
getfield sun.security.pkcs11.SessionManager.maxSessions:I
ldc 2147483647
if_icmpeq 5
4: aload 0
getfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.get:()I
aload 0
getfield sun.security.pkcs11.SessionManager.maxSessions:I
if_icmpge 7
5: StackMap locals:
StackMap stack:
aload 0
invokevirtual sun.security.pkcs11.SessionManager.openSession:()Lsun/security/pkcs11/Session;
astore 1
6: aload 0
aload 1
invokevirtual sun.security.pkcs11.SessionManager.ensureValid:(Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
areturn
7: StackMap locals:
StackMap stack:
aload 0
getfield sun.security.pkcs11.SessionManager.objSessions:Lsun/security/pkcs11/SessionManager$Pool;
invokevirtual sun.security.pkcs11.SessionManager$Pool.poll:()Lsun/security/pkcs11/Session;
astore 1
8: aload 1
ifnull 10
9: aload 0
aload 1
invokevirtual sun.security.pkcs11.SessionManager.ensureValid:(Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
areturn
10: StackMap locals:
StackMap stack:
new java.security.ProviderException
dup
ldc "Could not obtain session"
invokespecial java.security.ProviderException.<init>:(Ljava/lang/String;)V
athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lsun/security/pkcs11/SessionManager;
1 11 1 session Lsun/security/pkcs11/Session;
Exceptions:
throws sun.security.pkcs11.wrapper.PKCS11Exception
private sun.security.pkcs11.Session ensureValid(sun.security.pkcs11.Session);
descriptor: (Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokevirtual sun.security.pkcs11.Session.id:()J
pop2
1: aload 1
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lsun/security/pkcs11/SessionManager;
0 2 1 session Lsun/security/pkcs11/Session;
MethodParameters:
Name Flags
session
sun.security.pkcs11.Session killSession(sun.security.pkcs11.Session);
descriptor: (Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
flags: (0x0000)
Code:
stack=4, locals=3, args_size=2
start local 0 start local 1 0: aload 1
ifnull 1
aload 0
getfield sun.security.pkcs11.SessionManager.token:Lsun/security/pkcs11/Token;
invokevirtual sun.security.pkcs11.Token.isValid:()Z
ifne 2
1: StackMap locals:
StackMap stack:
aconst_null
areturn
2: StackMap locals:
StackMap stack:
getstatic sun.security.pkcs11.SessionManager.debug:Lsun/security/util/Debug;
ifnull 7
3: new java.lang.Exception
dup
invokespecial java.lang.Exception.<init>:()V
invokevirtual java.lang.Exception.getStackTrace:()[Ljava/lang/StackTraceElement;
iconst_2
aaload
invokevirtual java.lang.StackTraceElement.toString:()Ljava/lang/String;
astore 2
start local 2 4: getstatic java.lang.System.out:Ljava/io/PrintStream;
new java.lang.StringBuilder
dup
ldc "Killing session ("
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 2
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
ldc ") active: "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
5: aload 0
getfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.get:()I
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
6: invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
end local 2 7: StackMap locals:
StackMap stack:
aload 0
aload 1
invokevirtual sun.security.pkcs11.SessionManager.closeSession:(Lsun/security/pkcs11/Session;)V
8: aconst_null
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lsun/security/pkcs11/SessionManager;
0 9 1 session Lsun/security/pkcs11/Session;
4 7 2 location Ljava/lang/String;
MethodParameters:
Name Flags
session
sun.security.pkcs11.Session releaseSession(sun.security.pkcs11.Session);
descriptor: (Lsun/security/pkcs11/Session;)Lsun/security/pkcs11/Session;
flags: (0x0000)
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
ifnull 1
aload 0
getfield sun.security.pkcs11.SessionManager.token:Lsun/security/pkcs11/Token;
invokevirtual sun.security.pkcs11.Token.isValid:()Z
ifne 2
1: StackMap locals:
StackMap stack:
aconst_null
areturn
2: StackMap locals:
StackMap stack:
aload 1
invokevirtual sun.security.pkcs11.Session.hasObjects:()Z
ifeq 5
3: aload 0
getfield sun.security.pkcs11.SessionManager.objSessions:Lsun/security/pkcs11/SessionManager$Pool;
aload 1
invokevirtual sun.security.pkcs11.SessionManager$Pool.release:(Lsun/security/pkcs11/Session;)V
4: goto 6
5: StackMap locals:
StackMap stack:
aload 0
getfield sun.security.pkcs11.SessionManager.opSessions:Lsun/security/pkcs11/SessionManager$Pool;
aload 1
invokevirtual sun.security.pkcs11.SessionManager$Pool.release:(Lsun/security/pkcs11/Session;)V
6: StackMap locals:
StackMap stack:
aconst_null
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lsun/security/pkcs11/SessionManager;
0 7 1 session Lsun/security/pkcs11/Session;
MethodParameters:
Name Flags
session
void demoteObjSession(sun.security.pkcs11.Session);
descriptor: (Lsun/security/pkcs11/Session;)V
flags: (0x0000)
Code:
stack=4, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield sun.security.pkcs11.SessionManager.token:Lsun/security/pkcs11/Token;
invokevirtual sun.security.pkcs11.Token.isValid:()Z
ifne 2
1: return
2: StackMap locals:
StackMap stack:
getstatic sun.security.pkcs11.SessionManager.debug:Lsun/security/util/Debug;
ifnull 6
3: getstatic java.lang.System.out:Ljava/io/PrintStream;
new java.lang.StringBuilder
dup
ldc "Demoting session, active: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
4: aload 0
getfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.get:()I
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
5: invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
6: StackMap locals:
StackMap stack:
aload 0
getfield sun.security.pkcs11.SessionManager.objSessions:Lsun/security/pkcs11/SessionManager$Pool;
aload 1
invokevirtual sun.security.pkcs11.SessionManager$Pool.remove:(Lsun/security/pkcs11/Session;)Z
istore 2
start local 2 7: iload 2
ifne 9
8: return
9: StackMap locals: int
StackMap stack:
aload 0
getfield sun.security.pkcs11.SessionManager.opSessions:Lsun/security/pkcs11/SessionManager$Pool;
aload 1
invokevirtual sun.security.pkcs11.SessionManager$Pool.release:(Lsun/security/pkcs11/Session;)V
10: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lsun/security/pkcs11/SessionManager;
0 11 1 session Lsun/security/pkcs11/Session;
7 11 2 present Z
MethodParameters:
Name Flags
session
private sun.security.pkcs11.Session openSession();
descriptor: ()Lsun/security/pkcs11/Session;
flags: (0x0002) ACC_PRIVATE
Code:
stack=7, locals=5, args_size=1
start local 0 0: aload 0
getfield sun.security.pkcs11.SessionManager.maxSessions:I
ldc 2147483647
if_icmpeq 3
1: aload 0
getfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.get:()I
aload 0
getfield sun.security.pkcs11.SessionManager.maxSessions:I
if_icmplt 3
2: new java.security.ProviderException
dup
ldc "No more sessions available"
invokespecial java.security.ProviderException.<init>:(Ljava/lang/String;)V
athrow
3: StackMap locals:
StackMap stack:
aload 0
getfield sun.security.pkcs11.SessionManager.token:Lsun/security/pkcs11/Token;
getfield sun.security.pkcs11.Token.p11:Lsun/security/pkcs11/wrapper/PKCS11;
4: aload 0
getfield sun.security.pkcs11.SessionManager.token:Lsun/security/pkcs11/Token;
getfield sun.security.pkcs11.Token.provider:Lsun/security/pkcs11/SunPKCS11;
getfield sun.security.pkcs11.SunPKCS11.slotID:J
aload 0
getfield sun.security.pkcs11.SessionManager.openSessionFlags:J
aconst_null
aconst_null
5: invokevirtual sun.security.pkcs11.wrapper.PKCS11.C_OpenSession:(JJLjava/lang/Object;Lsun/security/pkcs11/wrapper/CK_NOTIFY;)J
lstore 1
start local 1 6: new sun.security.pkcs11.Session
dup
aload 0
getfield sun.security.pkcs11.SessionManager.token:Lsun/security/pkcs11/Token;
lload 1
invokespecial sun.security.pkcs11.Session.<init>:(Lsun/security/pkcs11/Token;J)V
astore 3
start local 3 7: aload 0
getfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.incrementAndGet:()I
pop
8: getstatic sun.security.pkcs11.SessionManager.debug:Lsun/security/util/Debug;
ifnull 18
9: aload 0
getfield sun.security.pkcs11.SessionManager.maxActiveSessionsLock:Ljava/lang/Object;
dup
astore 4
monitorenter
10: aload 0
getfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.get:()I
aload 0
getfield sun.security.pkcs11.SessionManager.maxActiveSessions:I
if_icmple 14
11: aload 0
aload 0
getfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.get:()I
putfield sun.security.pkcs11.SessionManager.maxActiveSessions:I
12: aload 0
getfield sun.security.pkcs11.SessionManager.maxActiveSessions:I
bipush 10
irem
ifne 14
13: getstatic java.lang.System.out:Ljava/io/PrintStream;
new java.lang.StringBuilder
dup
ldc "Open sessions: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 0
getfield sun.security.pkcs11.SessionManager.maxActiveSessions:I
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
14: StackMap locals: long sun.security.pkcs11.Session java.lang.Object
StackMap stack:
aload 4
monitorexit
15: goto 18
StackMap locals:
StackMap stack: java.lang.Throwable
16: aload 4
monitorexit
17: athrow
18: StackMap locals:
StackMap stack:
aload 3
areturn
end local 3 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 19 0 this Lsun/security/pkcs11/SessionManager;
6 19 1 id J
7 19 3 session Lsun/security/pkcs11/Session;
Exception table:
from to target type
10 15 16 any
16 17 16 any
Exceptions:
throws sun.security.pkcs11.wrapper.PKCS11Exception
private void closeSession(sun.security.pkcs11.Session);
descriptor: (Lsun/security/pkcs11/Session;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokevirtual sun.security.pkcs11.Session.close:()V
1: aload 0
getfield sun.security.pkcs11.SessionManager.activeSessions:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.decrementAndGet:()I
pop
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lsun/security/pkcs11/SessionManager;
0 3 1 session Lsun/security/pkcs11/Session;
MethodParameters:
Name Flags
session
}
SourceFile: "SessionManager.java"
NestMembers:
sun.security.pkcs11.SessionManager$Pool
InnerClasses:
public final Pool = sun.security.pkcs11.SessionManager$Pool of sun.security.pkcs11.SessionManager