Define Java service providers by annotating them directly

Overview

Annotated Service Provider

Define JVM service providers by annotating the provider class directly.

Maven Central Snapshot License

This annotation processor will add to the class-path services deployment (META-INF/services/) provider types that are annotated with the @Provides annotation.

Example usage

package io.github.emilyydev.asp.demo;

import io.github.emilyydev.asp.Provides;
import java.sql.Driver;

@Provides(Driver.class)
public class SqlDriverImpl implements Driver {
  // implementation...
}

The annotation processor will read the class, ensure it meets the required criterion specified by the ServiceLoader documentation and add the provider type to the corresponding service file META-INF/services/java.sql.Driver as a new entry, in case that same jar file provides multiple providers for the same service.

Adding it to your project

ASP is released on Maven Central under the coordinates io.github.emilyy-dev:annotated-service-provider:{version}. The current version released is shown at the top of this readme. Snapshot builds can be found in OSS sonatype (https://s01.oss.sonatype.org/content/repositories/snapshots/)

Importing ASP to your project:

  • Using Gradle
plugins {
    id("java")
}

repositories {
    mavenCentral()
}

dependencies {
    compileOnly("io.github.emilyy-dev:annotated-service-provider:{version}")
    annotationProcessor("io.github.emilyy-dev:annotated-service-provider:{version}")
}
  • Using Maven
<project>
    <!--  ...-->
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>io.github.emilyy-dev</groupId>
                                <artifactId>annotated-service-provider</artifactId>
                                <version>{version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>
        <dependency>
            <groupId>io.github.emilyy-dev</groupId>
            <artifactId>annotated-service-provider</artifactId>
            <version>{version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

License

This project is licensed under the MIT license.

You might also like...

WSO2 Microservices Framework for Java (MSF4J)

WSO2 Microservices Framework for Java (MSF4J)

Build status: WSO2 Microservices Framework for Java (MSF4J) WSO2 Microservices Framework for Java (MSF4J) is a lightweight high performance framework

Dec 27, 2022

Sample application demonstrating an order fulfillment system decomposed into multiple independant components (e.g. microservices). Showing concrete implementation alternatives using e.g. Java, Spring Boot, Apache Kafka, Camunda, Zeebe, ...

Sample application demonstrating an order fulfillment system decomposed into multiple independant components (e.g. microservices). Showing concrete implementation alternatives using e.g. Java, Spring Boot, Apache Kafka, Camunda, Zeebe, ...

Sample application demonstrating an order fulfillment system decomposed into multiple independant components (e.g. microservices). Showing concrete implementation alternatives using e.g. Java, Spring Boot, Apache Kafka, Camunda, Zeebe, ...

Dec 14, 2022

Source Code for 'Pro Java Microservices with Quarkus and Kubernetes' by Nebrass Lamouchi

Apress Source Code This repository accompanies Pro Java Microservices with Quarkus and Kubernetes by Nebrass Lamouchi (Apress, 2021). Download the fil

Oct 31, 2022

Takin is an Java-based, open-source system designed to measure online or test environmental performance test for full-links, Especially for microservices

Takin is an Java-based, open-source system designed to measure online or test environmental performance test for full-links, Especially for microservices

Takin is an Java-based, open-source system designed to measure online environmental performance test for full-links, Especially for microservices. Through Takin, middlewares and applications can identify real online traffic and test traffic, ensure that they enter the right databases.

Dec 21, 2022

Govern Service is a lightweight, low-cost service registration, service discovery, and configuration service SDK.

Govern Service is a lightweight, low-cost service registration, service discovery, and configuration service SDK.

Govern Service is a lightweight, low-cost service registration, service discovery, and configuration service SDK. By using Redis in the existing infrastructure (I believe you have already deployed Redis), it doesn’t need to bring extra to the operation and maintenance deployment. Cost and burden. With the high performance of Redis, Govern Service provides ultra-high TPS&QPS (10W+/s JMH Benchmark).

Nov 22, 2022

Annotation/Reflection Based Bukkit Command API. Containing many features such as help-service, command providers, tab completion, and many more!

CommandAPI Annotation/Reflection Based Command API that just does what you want it to do without any problems. Importing Maven repository id

Jun 13, 2022

A platform that links service providers with clients using Angular & Springboot

A platform that links service providers with clients using Angular & Springboot

Bricoly : Engineer Your Life The Way It Should Be... 📘 Description This project's aims to connect people who are able to grant services with clients

May 28, 2022

A fairly Simple Game made in Java,You can adopt Pets, name them, and take care of them for XpPoints and level up!

A fairly Simple Game made in Java,You can adopt Pets, name them, and take care of them for XpPoints and level up!

Introducing PetGame! A simple console based game made by @denzven in Java ☕ About the Game PetGame is my first big project in Java, the rules are simp

Jun 7, 2022

Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Jan 2, 2023

CoSky is a lightweight, low-cost service registration, service discovery, and configuration service SDK.

CoSky is a lightweight, low-cost service registration, service discovery, and configuration service SDK.

High-performance, low-cost microservice governance platform. Service Discovery and Configuration Service

Nov 22, 2022

A handy plugin for copying requests/responses directly from Burp, some extra magic included.

RIO BurpSuite plugin Request Input Output BurpSuite plugin A.K.A RIO - A handy plugin for copying requests/responses directly from Burp, some extra ma

Nov 22, 2022

Toloka has a powerful open API, it allows you to integrate an on-demand workforce directly into your processes, and to build scalable and fully automated human-in-the-loop ML pipelines.

Toloka has a powerful open API, it allows you to integrate an on-demand workforce directly into your processes, and to build scalable and fully automated human-in-the-loop ML pipelines.

Toloka Java SDK Documentation Website | API Documentation | Platform Designed by engineers for engineers, Toloka lets you integrate an on-demand workf

Apr 27, 2022

Nano-library which provides the ability to define typesafe (!) configuration templates for applications.

Configur8 Nano-library which provides the ability to define typesafe (!) Configuration templates for applications. Concept: A Configuration is a set o

Oct 3, 2022

Deploy this 🔥🔥🔥 BLAZING FAST 🔥🔥🔥 API to get instant access to ✨✨✨ INNOVATIVE ✨✨✨ API to quickly define whether the numbers are odd or even.

Deploy this 🔥🔥🔥 BLAZING FAST 🔥🔥🔥 API to get instant access to ✨✨✨ INNOVATIVE ✨✨✨ API to quickly define whether the numbers are odd or even.

Is Odd API This 👈 is 🅱 💰 a 🐍 simple API that 🍑 returns 💌 whether 📊 📊 a 🔥 number 💦 🔢 is 🙈 💦 odd 🤥 or 💰 not. ♂ With 👏 👼 this 🏽 👈 API

Sep 23, 2022

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

pact-jvm JVM implementation of the consumer driven contract library pact. From the Ruby Pact website: Define a pact between service consumers and prov

Dec 31, 2022

Android service daemon ,keep background service alive

安卓后台保活2021新姿势 适配华为大部分系列手机,vivo,OPPO 部分机型,小米的不支持,可见小米在对抗后台自保上做得最好 本项目原本是给某个公司合作开发的,最后给了对方SDK之后由于付款问题闹得很郁闷,想着这个代码拿在自己手上也没用,就发出来给大家参考参考。目前分析的结果来看,这个是全网目前

Nov 29, 2022

:package: Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.

JavaPackager JavaPackager is a hybrid plugin for Maven and Gradle which provides an easy way to package Java applications in native Windows, Mac OS X

Jan 8, 2023

Generate getter and setter on Java with ease! PS: Intended to use for labs where typing them are still the norm!!

Generate getter and setter on Java with ease! PS: Intended to use for labs where typing them are still the norm!!

GenerateGetterSetter Generate getter and setter on Java with ease! PS: Intended to use for labs where typing them are still the norm!! How to use Clon

Jan 4, 2022
Comments
  • Pretty Hot

    Pretty Hot

    This is a pretty hot annotation processer. Hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot hot

    opened by PulseBeat02 0
Owner
Emily
Enthusiast, nerd -- Emily#6789
Emily
Annotation/Reflection Based Bukkit Command API. Containing many features such as help-service, command providers, tab completion, and many more!

CommandAPI Annotation/Reflection Based Command API that just does what you want it to do without any problems. Importing Maven <repository> <id>

damt 1 Jun 13, 2022
CoSky is a lightweight, low-cost service registration, service discovery, and configuration service SDK.

High-performance, low-cost microservice governance platform. Service Discovery and Configuration Service

Ahoo Wang 61 Nov 22, 2022
AWS Service registry for resilient mid-tier load balancing and failover.

Eureka Eureka is a REST (Representational State Transfer) based service that is primarily used in the AWS cloud for locating services for the purpose

Netflix, Inc. 11.6k Dec 30, 2022
Drone Service REST API in Spring boot

Drones Service REST API ?? START Introduction There is a major new technology that is destined to be a disruptive force in the field of transportation

Moses-K 1 Feb 4, 2022
Microserver is a Java 8 native, zero configuration, standards based, battle hardened library to run Java Rest Microservices via a standard Java main class. Supporting pure Microservice or Micro-monolith styles.

Microserver is a Java 8 native, zero configuration, standards based, battle hardened library to run Java Rest Microservices via a standard Java main class. Supporting pure Microservice or Micro-monolith styles.

AOL 936 Dec 19, 2022
[JAVA] Projeto exemplo de uma arquitetura modular em Java

Arquitetura modular O objetivo do bom design de software, como já diria Robert C. Martin, em seu livro 'Clean Architecture: A Craftsman's Guide to Sof

HelpDEV 97 Dec 29, 2022
Java client for Consul HTTP API

consul-api Java client for Consul HTTP API (http://consul.io) Supports all API endpoints (http://www.consul.io/docs/agent/http.html), all consistency

Ecwid 402 Jan 6, 2023
Apache Dubbo is a high-performance, java based, open source RPC framework.

Apache Dubbo Project Apache Dubbo is a high-performance, Java-based open-source RPC framework. Please visit official site for quick start and document

The Apache Software Foundation 38.3k Jan 9, 2023
Lightweight framework for building java microservices

Ja-micro Ja-micro is a lightweight Java framework for building microservices. Introduction Ja-micro is a framework that allows developers to easily de

Sixt 621 Aug 21, 2022