This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Context, API and Provider Thread Safety

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


In more detail: Contexts and apis are thread-safe. Regarding whether APIs are singleton or not, the api objects (all apis have just one impl which is the proxy that generates the http requests) are generated here. That provider class is declared to be a singleton, but that applies only to the provider itself; not to the result produced by its get() method. The provider and the api class are bound to the Guice context here and here, and as you can see those bindings are not using .in(Scopes.SINGLETON), so every time the provider is called (an injection is requested or an instance is directly requested to the Guice injector) a new api proxy will be created.