T
- Service interfacepublic final class ServiceLoader<T> extends Object
ServiceLoader
.Constructor and Description |
---|
ServiceLoader(Class<? extends T> service,
Class<?>... argumentTypes) |
Modifier and Type | Method and Description |
---|---|
T |
create(String name,
Object... arguments)
Creates a defined service implementation.
|
Collection<T> |
createAll(Object... arguments)
Creates all registered service implementations.
|
List<T> |
createList(String list)
Creates service implementations from a comma separated list of names.
|
String |
toSimpleClassName(String name)
Generates the simple class name from an acronym.
|
public T create(String name, Object... arguments)
The acronym for org.tinylog.writers.RollingFileWriter
is for example rolling file
.
name
- Acronym or class name of service implementationarguments
- Arguments for constructor of service implementationnull
if failed to create servicepublic List<T> createList(String list)
list
- Comma separated list of names with optional argumentspublic Collection<T> createAll(Object... arguments)
arguments
- Arguments for constructors of service implementationspublic String toSimpleClassName(String name)
The acronym rolling file
, for example, will be transformed into RollingFileWriter
for the service
interface Writer
.
name
- Simplified acronymCopyright © 2024. All rights reserved.