Package io.micronaut.data.connection
Interface ConnectionDefinition
- All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
- All Known Implementing Classes:
DefaultConnectionDefinition
public interface ConnectionDefinition
extends io.micronaut.core.annotation.AnnotationMetadataProvider
The connection definition.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Possible propagation values. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ConnectionDefinition
The default transaction definition.static final ConnectionDefinition.Propagation
Use the default propagation value.static final ConnectionDefinition
A read only definition.static final ConnectionDefinition
A requires new definition.Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Method Summary
Modifier and TypeMethodDescription@Nullable String
getName()
Return the name of this connection.@NonNull ConnectionDefinition.Propagation
Return the propagation behavior.Return the connection timeout.Return whether this is a read-only connection.static @NonNull ConnectionDefinition
Create a newConnectionDefinition
with a given name.static @NonNull ConnectionDefinition
of
(@NonNull ConnectionDefinition.Propagation propagationBehaviour) Create a newConnectionDefinition
for the given behaviour.@NonNull ConnectionDefinition
withAnnotationMetadata
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) Connection definition with new annotation metadata.@NonNull ConnectionDefinition
Connection definition with specific name.@NonNull ConnectionDefinition
withPropagation
(ConnectionDefinition.Propagation propagation) Connection definition with specific propagation.Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Field Details
-
PROPAGATION_DEFAULT
Use the default propagation value. -
DEFAULT
The default transaction definition. -
READ_ONLY
A read only definition. -
REQUIRES_NEW
A requires new definition.
-
-
Method Details
-
getPropagationBehavior
Return the propagation behavior.- Returns:
- The propagation behaviour
-
getTimeout
Return the connection timeout.- Returns:
- The optional timeout
-
isReadOnly
Return whether this is a read-only connection.- Returns:
- The optional read only
-
getName
Return the name of this connection.- Returns:
- The optional name
-
withPropagation
@NonNull @NonNull ConnectionDefinition withPropagation(ConnectionDefinition.Propagation propagation) Connection definition with specific propagation.- Parameters:
propagation
- The new propagation- Returns:
- A new connection definition with specified propagation
-
withName
Connection definition with specific name.- Parameters:
name
- The new name- Returns:
- A new connection definition with specified name
-
withAnnotationMetadata
@NonNull @NonNull ConnectionDefinition withAnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) Connection definition with new annotation metadata.- Parameters:
annotationMetadata
- The new annotation metadata- Returns:
- A new connection definition with specified annotation metadata
-
of
@NonNull static @NonNull ConnectionDefinition of(@NonNull @NonNull ConnectionDefinition.Propagation propagationBehaviour) Create a newConnectionDefinition
for the given behaviour.- Parameters:
propagationBehaviour
- The behaviour- Returns:
- The definition
-
named
Create a newConnectionDefinition
with a given name.- Parameters:
name
- The name- Returns:
- The definition
-