# serviceloader

The Java ServiceLoader facility for discovering and loading services, supported by Spring factory beans.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Making ServiceLoader usable: a provider factory

DevFeed: [Making ServiceLoader usable: a provider factory](<https://devfeed.tech/articles/making-serviceloader-usable-a-provider-factory-18932.md>)

Original publisher: [Read original article](<https://blog.frankel.ch/serviceloader-provider-factory/>)

Author: Stefano Fago

Published: 2026-07-12T00:00:00Z

Content type: article

Language: en

Sources: [Nicolas Fränkel](<https://devfeed.tech/sources/nicolas-frankel.md>)

Topics: [serviceloader](<https://devfeed.tech/topics/serviceloader.md>), [adapter pattern](<https://devfeed.tech/topics/adapter-pattern.md>), [JSON Web Tokens](<https://devfeed.tech/topics/jwt.md>)

Tags: [constructor](<https://devfeed.tech/tags/constructor.md>), [decoupling](<https://devfeed.tech/tags/decoupling.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [discovery](<https://devfeed.tech/tags/discovery.md>), [environment](<https://devfeed.tech/tags/environment.md>), [example](<https://devfeed.tech/tags/example.md>), [factory](<https://devfeed.tech/tags/factory.md>), [java](<https://devfeed.tech/tags/java.md>), [json](<https://devfeed.tech/tags/json.md>), [jwt](<https://devfeed.tech/tags/jwt.md>), [key](<https://devfeed.tech/tags/key.md>), [limits](<https://devfeed.tech/tags/limits.md>), [load](<https://devfeed.tech/tags/load.md>), [loader](<https://devfeed.tech/tags/loader.md>), [mock](<https://devfeed.tech/tags/mock.md>), [payments](<https://devfeed.tech/tags/payments.md>), [paypal](<https://devfeed.tech/tags/paypal.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [serviceloader](<https://devfeed.tech/tags/serviceloader.md>), [spi](<https://devfeed.tech/tags/spi.md>)

### AI overview

The proposed pattern loads a small factory through ServiceLoader instead of loading the service implementation directly. The factory has the required public no-argument constructor and creates the real service, which can take configuration such as a payments provider's API key. This addresses ServiceLoader's constructor constraint. The factory also provides a place to select among implementations, since ServiceLoader itself returns discovered providers in roughly classpath order without IDs, priorities, or applicability checks. The author says Java 9's static provider method can construct an object but does not solve selection. The excerpt introduces the pattern but ends before showing how selection is implemented.

### Source excerpt

I keep coming back to java.util.ServiceLoader. I have used it to put a JSON layer behind a contract, so the core code carries no direct dependency on any particular JSON library, and I can swap the implementation without touching callers. The same shape works for JWT handling, where the concrete library might be jose4j or another JOSE implementation, and you can easily find other decoupling use-cases.

## AutoValue Extensions

DevFeed: [AutoValue Extensions](<https://devfeed.tech/articles/autovalue-extensions-30586.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2016/05/autovalue-extensions/>)

Published: 2016-05-16T07:00:00Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Code generation](<https://devfeed.tech/topics/code-generation.md>), [Extension](<https://devfeed.tech/topics/extension.md>), [Code](<https://devfeed.tech/topics/code.md>), [Java](<https://devfeed.tech/topics/java.md>), [serviceloader](<https://devfeed.tech/topics/serviceloader.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>)

Tags: [annotation-processor](<https://devfeed.tech/tags/annotation-processor.md>), [article](<https://devfeed.tech/tags/article.md>), [code](<https://devfeed.tech/tags/code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [java](<https://devfeed.tech/tags/java.md>), [maven](<https://devfeed.tech/tags/maven.md>), [serviceloader](<https://devfeed.tech/tags/serviceloader.md>)

### AI overview

This tutorial explains AutoValue Extensions, which extend AutoValue's compile-time generation of immutable Java value types. It describes how extensions add functionality to generated implementations, are discovered through Java ServiceLoader, and can support integrations such as JSON, Protocol Buffers, databases, and Android Parcelable.

### Source excerpt

This is the third article in a series on AutoValue. The first article introduced AutoValue, the code generating annotation processor for value types. The second took a more in depth look at the code generated by AutoValue, and the benefits of compile time code generation. In a previous article introducing AutoValue, I briefly mentioned AutoValue Extensions. Now it's time to go a bit more in depth to look at what extensions are, how they work, and how they can help you get even more out of AutoValue.