Skip to main content

Provider v.s. @Provider

· 2 min read
Jack

A Provider is an interface defined in JSR 330. It is part of the general dependency injection concept in Java.

Whether we are on Java SR or EE, Provider will always be loadable from classpath. For example, the HK2 is an implementation of JSR-330 in a JavaSE environment and it conforms to the JSR 330 standard by loading the Provider in its implementations.

@Provider, on the other hand, is a Java EE/Jakarta EE concept. If we are developing Java EE applications, we can use both (Provider & @Provider) at the same time.