Package org.wildfly.security
Class OneTimeSecurityFactory<T>
- java.lang.Object
- 
- org.wildfly.security.OneTimeSecurityFactory<T>
 
- 
- All Implemented Interfaces:
- SecurityFactory<T>
 
 public final class OneTimeSecurityFactory<T> extends Object implements SecurityFactory<T> ASecurityFactoryimplementation which calls delegated factory at first and returns created object for any other create call. Thread safe.- Author:
- David M. Lloyd
 
- 
- 
Field SummaryFields Modifier and Type Field Description private SecurityFactory<T>factoryprivate Tobj
 - 
Constructor SummaryConstructors Constructor Description OneTimeSecurityFactory(SecurityFactory<T> factory)Creates a new factory instance.
 
- 
- 
- 
Field Detail- 
factoryprivate volatile SecurityFactory<T> factory 
 - 
objprivate volatile T obj 
 
- 
 - 
Constructor Detail- 
OneTimeSecurityFactorypublic OneTimeSecurityFactory(SecurityFactory<T> factory) Creates a new factory instance.- Parameters:
- factory- a security factory to use to obtain object which should be returned by this factory every time
 
 
- 
 - 
Method Detail- 
createpublic T create() throws GeneralSecurityException Description copied from interface:SecurityFactoryCreate an instance.- Specified by:
- createin interface- SecurityFactory<T>
- Returns:
- the new instance
- Throws:
- GeneralSecurityException- if instantiation fails for some reason
 
 
- 
 
-