Added support for a method to be called whenever a new local object is created.