JBR API is an interface for the functionality specific to
JetBrains Runtime aka JBR.
JBR API provides a standalone jar with classes and interfaces representing various APIs
allowing the client code to be compiled against any JDK, while enjoying unique
features provided by JBR at run time without worrying about compatibility and runtime errors.
API methods marked with @Extension are optional, meaning that the service would still be
considered supported even if some of its extension methods are not.
Such extensions must be explicitly enabled when retrieving the service with JBR.get<NAME>(Extensions...).
Extension methods may appear not only in services but in regular interfaces too.
In that case the set of enabled extensions is implicitly propagated to objects retrieved from that service.
SomeService service;Foo foo;service = JBR.getSomeService();foo = service.getFoo();foo.bar(); // UnsupportedOperationException: Foo.bar - extension BAR is disabledservice = JBR.getSomeService(Extensions.BAR);foo = service.getFoo();foo.bar(); // OK
JBR API releases follow semantic versioning.
API and implementation versions can be retrieved from the JBR class:
JBR.getApiVersion() - the version of jbr-api.jar currently used.
JBR.getImplVersion() - the version of JBR API implemented by the current runtime.
Versions should not be used for any purpose other than logging.
Neither the API nor implementation versions are used in compatibility
checks or when determining the service availability.
However, you can assume that when
impl.major == api.major && impl.minor >= api.minor,
all services currently present in that JBR API are guaranteed to be supported
by that implementation.