Open cgoudie opened 8 years ago
I've refactored the agent to have an interface NotSoSerial with a single method onBeforeResolveClass.
The default implementation of this interface implements the current behaviour.
Users may replace the default implementation via the ServiceLoader.
This gives complete control over what should be done. As such this allows the implementation of a custom whitelist / blacklist logic, runtime overrides as mentioned in #14, and also pluggable events as mentioned in #16.
If reuse of default behaviour is wanted, we could discuss refactoring DefaultNotSoSerial to make it easier to customise.
Thought?
I would like to see a whitelist/blacklist interface for determining the lists.
Something like: public interface SerializationControl { boolean isWhitelisted(String classname) boolean isBlacklisted(String classname) }
with the default implementation being your configuration reader/writer, but swappable either by way of using an agent argument or system property.