We now have a number of cases where metadata entity implementations must have Spring beans injected into them. This support should be handled at the BaseJcrProvider level in a general way rather than the one-off support that is happening now.
The base provider can be made to be ApplicationContext aware and provide functions to perform injection on entity instances as the entities are created.