Package io.micronaut.web.router.version
Class VersionAwareRouterListener
java.lang.Object
io.micronaut.web.router.version.VersionAwareRouterListener
- All Implemented Interfaces:
BeanCreatedEventListener<Router>
,EventListener
@Singleton
@Requires(property="micronaut.router.versioning.enabled",value="true") @Requires(beans=RoutesVersioningConfiguration.class)
public class VersionAwareRouterListener
extends Object
implements BeanCreatedEventListener<Router>
Configuration to decorate
Router
with version matching logic.- Since:
- 1.1.0
- Author:
- Bogdan Oros
-
Constructor Summary
ConstructorDescriptionCreates a configuration to decorate existingRouter
beans with aFilteredRouter
. -
Method Summary
Modifier and TypeMethodDescriptiononCreated
(BeanCreatedEvent<Router> event) Returns a wrappedRouter
toFilteredRouter
.
-
Constructor Details
-
VersionAwareRouterListener
Creates a configuration to decorate existingRouter
beans with aFilteredRouter
.- Parameters:
filter
- AVersionRouteMatchFilter
to delegate routes filtering
-
-
Method Details
-
onCreated
Returns a wrappedRouter
toFilteredRouter
.- Specified by:
onCreated
in interfaceBeanCreatedEventListener<Router>
- Parameters:
event
- TheRouter
bean created event- Returns:
- The wrapper router bean
-