The behavior of this annotation depends on it's usage:
@Service on both type and type_use will result in a definition
error.
Where this annotation is used affects how service scopes are supported:
@SingleComponent,
@FactoryComponent or @Dependent
bean - The provided service can be of any scope. The bean can either
implement ServiceFactory or
PrototypeServiceFactory or use
@Bundle or @Prototype to set it's
service scope. If none of those options are used the service is a singleton
scope service.@ApplicationScoped bean - The provided service
is a singleton scope service unless the bean implements ServiceFactory or PrototypeServiceFactory.
It cannot use @Bundle or @Prototype
to set it's service scope. Use of those annotations in this case will result
in a definition error.| Modifier and Type | Class and Description |
|---|---|
| public static class | Service.
Support inline instantiation of the |
| Modifier and Type | Method and Description |
|---|---|
| public Class |
| value | back to summary |
|---|---|
| public Class Override the interfaces under which this service is published.
| |
Service annotation.
| Modifier and Type | Field and Description |
|---|---|
| private final Class | |
| private static final long |
| Modifier and Type | Method and Description |
|---|---|
| public static final Service. | |
| public Class | value()
Implements org. Override the interfaces under which this service is published. |
| _interfaces | back to summary |
|---|---|
| private final Class<?>[] _interfaces | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides javax. | |
| Literal | back to summary |
|---|---|
| private Literal(Class<?>[] interfaces) | |
| of | back to summary |
|---|---|
| public static final Service. | |
| value | back to summary |
|---|---|
| public Class Implements org. Doc from org. Override the interfaces under which this service is published. | |