Creates a new object factory using the environment supplied.
The environment parameter is owned by the caller. The implementation will not modify the object or keep a reference to it, although it may keep a reference to a clone or copy.
|The possibly null object for which to create a factory.|
|Environment to use when creating the factory. Can be null.|
|If an object factory cannot be created.|