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
 
 
- 
- 
Constructor Summary
Constructors Constructor Description OneTimeSecurityFactory(SecurityFactory<T> factory)Creates a new factory instance. 
 - 
 
- 
- 
Constructor Detail
- 
OneTimeSecurityFactory
public 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
- 
create
public T create() throws GeneralSecurityException
Description copied from interface:SecurityFactoryCreate an instance.- Specified by:
 createin interfaceSecurityFactory<T>- Returns:
 - the new instance
 - Throws:
 GeneralSecurityException- if instantiation fails for some reason
 
 - 
 
 -