private ReferenceFactory < ? > createFactory ( final Constructor < ? > constructor ) { return manager -> { try { return ( ReferenceCounted < ? > ) constructor . newInstance ( manager ) ; } catch ( InstantiationException | IllegalAccessException | InvocationTargetException e ) { throw new SerializationException ( "failed to instantiate reference" , e ) ; } } ; }
Dynamically created a reference factory for a pooled type .