Class KeyExchangeGenerator
- java.lang.Object
-
- org.activecomponents.udp.asymciphers.KeyExchangeGenerator
-
public class KeyExchangeGenerator extends java.lang.ObjectKey exchange generator which can be used to pre-generate exchanges in background.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.reflect.Constructor<?>conConstructor for the key exchangeprotected static intDEFAULT_TARGET_PREGENThe default target number of pre-gen key exchanges.protected java.util.concurrent.BlockingQueue<IKeyExchange>pregenexPre-generated exchange mechanisms.protected booleanrunningRunning flag.protected java.util.concurrent.CyclicBarriershutdownbarrierBarrier for coordinating shutdown.protected java.lang.RunnabletaskGeneration task.
-
Constructor Summary
Constructors Constructor Description KeyExchangeGenerator(java.lang.String exchangeclass)KeyExchangeGenerator(java.lang.String exchangeclass, int targetkeys)Creates a new key exchange generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IKeyExchangegetKeyExchange()Returns a new key exchange mechanism.voidstart(IThreadExecutor texec)Starts the background key exchange generation.voidstop()Stops the background key exchange generation.
-
-
-
Field Detail
-
DEFAULT_TARGET_PREGEN
protected static final int DEFAULT_TARGET_PREGEN
The default target number of pre-gen key exchanges.- See Also:
- Constant Field Values
-
pregenex
protected java.util.concurrent.BlockingQueue<IKeyExchange> pregenex
Pre-generated exchange mechanisms.
-
running
protected volatile boolean running
Running flag.
-
shutdownbarrier
protected java.util.concurrent.CyclicBarrier shutdownbarrier
Barrier for coordinating shutdown.
-
con
protected java.lang.reflect.Constructor<?> con
Constructor for the key exchange
-
task
protected java.lang.Runnable task
Generation task.
-
-
Constructor Detail
-
KeyExchangeGenerator
public KeyExchangeGenerator(java.lang.String exchangeclass)
-
KeyExchangeGenerator
public KeyExchangeGenerator(java.lang.String exchangeclass, int targetkeys)Creates a new key exchange generator.- Parameters:
exchangeclass- Class used for key exchange.targetkeys- Target number of pre-generated exchanges.
-
-
Method Detail
-
start
public void start(IThreadExecutor texec)
Starts the background key exchange generation.
-
stop
public void stop()
Stops the background key exchange generation.
-
getKeyExchange
public IKeyExchange getKeyExchange()
Returns a new key exchange mechanism.- Returns:
- Key exchange mechanism.
-
-