Package com.sun.ejb.base.sfsb.util
Class ScrambledKeyGenerator
java.lang.Object
com.sun.ejb.base.sfsb.util.SimpleKeyGenerator
com.sun.ejb.base.sfsb.util.ScrambledKeyGenerator
- All Implemented Interfaces:
SFSBUUIDUtil<SimpleKeyGenerator.SimpleSessionKey>,org.glassfish.ha.store.util.KeyTransformer<SimpleKeyGenerator.SimpleSessionKey>
A utility class that generates stateful session keys using two longs
The session id generated by this class is guarenteed to be unique as
long as the system clock is never reset to a previous value
The hashCode of the SessionKey generated by ScrambledKeyGenerator
also allows uniform distribution of keys when hashed in a HashMap
- Author:
- Mahesh Kannan
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.ejb.base.sfsb.util.SimpleKeyGenerator
SimpleKeyGenerator.SimpleSessionKey -
Field Summary
Fields inherited from class com.sun.ejb.base.sfsb.util.SimpleKeyGenerator
idCounter, prefix, suffix -
Constructor Summary
ConstructorsConstructorDescriptionScrambledKeyGenerator(byte[] ipAddress, int port) ScrambledKeyGenerator(long val) -
Method Summary
Modifier and TypeMethodDescriptionCreate and return the sessionKey.Methods inherited from class com.sun.ejb.base.sfsb.util.SimpleKeyGenerator
byteArrayToKey, keyToByteArray
-
Constructor Details
-
ScrambledKeyGenerator
public ScrambledKeyGenerator() -
ScrambledKeyGenerator
public ScrambledKeyGenerator(byte[] ipAddress, int port) -
ScrambledKeyGenerator
public ScrambledKeyGenerator(long val)
-
-
Method Details
-
createSessionKey
Create and return the sessionKey.- Specified by:
createSessionKeyin interfaceSFSBUUIDUtil<SimpleKeyGenerator.SimpleSessionKey>- Overrides:
createSessionKeyin classSimpleKeyGenerator- Returns:
- the sessionKey object
-