This content has been marked as final. Show 1 reply
I assume you are using POF and is a PofSerializer that you want to pass dependencies to. One option is to provide a custom PofContext implementation, more than likely an extension of ConfigurablePofContext. There would be two strategies; to inject dependencies upon serializer creation or upon access to the serializer for de/serialzing an object. Generally I would have thought the former as a more efficient mechanism however the latter can be carried out with an easier hook.
To achieve dependency injection of serializer creation in 3.7.1 you will have to provide your own implementation of createPofConfig. You could delegate to the parent (CPC) and walk through the serializers performing your injection to avoid having to re-write the logic in createPofConfig. In the next major release of Coherence we have teased these two things apart a little such that there is an overridable method for creating custom serializers. The alternative is to inject upon access which you could achieve by overriding CPC.getPofSerializer. You may want to put some effort in ensuring this has a small cost.