Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
# Why you should use this project?

If you want to use a service provider interface (_SPI_) you need to register your service implementation in the _/META-INF/services/<Full qualified spi interface name>_ file.
Additionally you usually need to write a service locator to be able to use the service implementation.
Additionally, you usually need to write a service locator to be able to use the service implementation.

The annotation processor offered by this project provides exactly this. It allows you to create the service locator file just by adding an annotation to you spi implementation.
Additionally it will generate a service locator for you.
Additionally, it will generate a service locator for you.

# Prerequisites
- The generated ServiceLocator code requires at least JDK 8.

# Features
Annotation processor that
Expand Down Expand Up @@ -76,12 +79,13 @@ To create multiple service locators in the same package use @SpiServiceLocators:

@SpiServiceLocators({
@SpiServiceLocator(FirstExampleSpiInterface.class),
@SpiServiceLocator(SecondExampleSpiInterface.class),
@SpiServiceLocator(SecondExampleSpiInterface.class)
})
package your.target.package;

import io.toolisticon.spiap.api.SpiServiceLocator;
import your.spi.package.ExampleSpiInterface;
import your.spi.package.FirstExampleSpiInterface;
import your.spi.package.SecondExampleSpiInterface;

## How to register a service implementation
Just add a Service annotation to your service implementation:
Expand All @@ -97,7 +101,7 @@ Just add a Service annotation to your service implementation:
Service annotations mandatory value must declare the SPI you want the service class to be registered to.
All other annotation attributes are optional.

- id defines a custom id which can be used to locate a specific servics implementation via the generated service locator class. Defaults to fully qualified service class name in generated service locator.
- id defines a custom id which can be used to locate a specific services implementation via the generated service locator class. Defaults to fully qualified service class name in generated service locator.
- description declares a short description about the implementation
- priority is used to define a specific order in which the services are located

Expand Down
2 changes: 0 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@
<encoding>UTF-8</encoding>

<java.version>1.8</java.version>

<java.compile.source.version>${java.version}</java.compile.source.version>
<java.compile.target.version>${java.version}</java.compile.target.version>


<cute.version>0.12.0</cute.version>
<aptk.version>0.20.0</aptk.version>

Expand Down
Loading