@Instantiator(value=STANDARD) public class UnsafeFactoryInstantiator<T> extends java.lang.Object implements ObjectInstantiator<T>
sun.misc.Unsafe.allocateInstance()
. Unsafe and its methods are implemented by most
modern JVMs.ObjectInstantiator
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<T> |
type |
private sun.misc.Unsafe |
unsafe |
Constructor and Description |
---|
UnsafeFactoryInstantiator(java.lang.Class<T> type) |
Modifier and Type | Method and Description |
---|---|
T |
newInstance()
Returns a new instance of an object.
|
private final sun.misc.Unsafe unsafe
private final java.lang.Class<T> type
public UnsafeFactoryInstantiator(java.lang.Class<T> type)
public T newInstance()
ObjectInstantiator
newInstance
in interface ObjectInstantiator<T>