-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
None
-
sparc
-
generic
KeyTab needs to be Enhanced to handle multiple instances.
Users can obtain multiple instances of KeyTab for the same keytab file
or different keytab file. We need to handle this apprpriately and
efficiently. The code has originally designed with the concept
of singleton, so only one Keytab instance can exist. Although with
the current code, this is not the case.
Currently KeyTab.getInstance(String) invokes KeyTab.getInstance(file)
which in turn invokes init (init is already sync'ed) If we synchronized both
getIntance methods, user will have to hold 3 locks to create an instance of KeyTab. May not be any big performace issue, but ideally user should have not
to hold 3 locks to get an instance of the keytab.
Moreover, in some places KeyTab.getInstance(file) is invoked, while in other
KeyTab.getInstance(String) is invoked. The entire KeyTab needs enhanced,
removing all the singleton dilemma.
Keytab currently defines two class variables Keytab and name, which are
static but get modified by all the getInstance methods.
Keytab.getIntance methods are invoked from other static methods.
We need to justify if the calling methods need to be static as well e.g
1) Credentials.getServiceCreds
2) EncryptionKey.acquireSecretKey
3) EncryptionKey.acquireSecretKeys
The above methods are defined to be static and invoke static KeyTab.getInstance
methods.
Users can obtain multiple instances of KeyTab for the same keytab file
or different keytab file. We need to handle this apprpriately and
efficiently. The code has originally designed with the concept
of singleton, so only one Keytab instance can exist. Although with
the current code, this is not the case.
Currently KeyTab.getInstance(String) invokes KeyTab.getInstance(file)
which in turn invokes init (init is already sync'ed) If we synchronized both
getIntance methods, user will have to hold 3 locks to create an instance of KeyTab. May not be any big performace issue, but ideally user should have not
to hold 3 locks to get an instance of the keytab.
Moreover, in some places KeyTab.getInstance(file) is invoked, while in other
KeyTab.getInstance(String) is invoked. The entire KeyTab needs enhanced,
removing all the singleton dilemma.
Keytab currently defines two class variables Keytab and name, which are
static but get modified by all the getInstance methods.
Keytab.getIntance methods are invoked from other static methods.
We need to justify if the calling methods need to be static as well e.g
1) Credentials.getServiceCreds
2) EncryptionKey.acquireSecretKey
3) EncryptionKey.acquireSecretKeys
The above methods are defined to be static and invoke static KeyTab.getInstance
methods.