Many of the library features have two variants: one with a ShutdownFeature and one without. This is a common situation: if a feature is present, use it, otherwise don't. Another example could be JMX: register an MBean if we're using JMX, otherwise don't.
Most such situations could be solved by a no-op fallback provision declared in the feature, e.g.:
Many of the library features have two variants: one with a
ShutdownFeature
and one without. This is a common situation: if a feature is present, use it, otherwise don't. Another example could be JMX: register an MBean if we're using JMX, otherwise don't.Most such situations could be solved by a no-op fallback provision declared in the feature, e.g.:
The traits of fallback provisions are:
The same mechanism is usable for implementing optional extension points: provide a fallback noop extension point if none could be found.