Package io.helidon.microprofile.server
Annotation Type RoutingName
-
@Target(TYPE) @Retention(RUNTIME) @Documented public @interface RoutingName
Binds anApplication
orService
to a specific (named) routing onWebServer
. The routing should have a corresponding named socket configured on the WebServer to run the routing on. Configuration can be overridden using configuration:- Name of routing:
fully.qualified.ClassName.routing-name.name
to change the name of the named routing. Use "@default" to revert to default named routing. - Whether routing is required:
fully.qualified.ClassName.routing-name.required
@ApplicationScoped @RoutingPath("/myservice") @RoutingName(value = "admin", required = true) public class MyService implements Service { @Override public void update(Routing.Rules rules) {
Example configuration (yaml):rules.get("/hello", (req, res) -> res.send("Hello WebServer"));
} }com.example.MyService.routing-name: name: "@default" required: false
- Name of routing:
-
-
Field Summary
Fields Modifier and Type Fields Description static String
CONFIG_KEY_NAME
Configuration key of the routing name, appended after the fully qualified class name (does not contain the leading dot).static String
CONFIG_KEY_REQUIRED
Configuration key of the routing name required flag, appended after the fully qualified class name (does not contain the leading dot).static String
DEFAULT_NAME
Name (reserved) for the default listener of WebServer.
-
-
-
Field Detail
-
CONFIG_KEY_NAME
static final String CONFIG_KEY_NAME
Configuration key of the routing name, appended after the fully qualified class name (does not contain the leading dot).
-
-
-
CONFIG_KEY_REQUIRED
static final String CONFIG_KEY_REQUIRED
Configuration key of the routing name required flag, appended after the fully qualified class name (does not contain the leading dot).
-
-
-
DEFAULT_NAME
static final String DEFAULT_NAME
Name (reserved) for the default listener of WebServer.
-
-
Element Detail
-
value
String value
Name of a routing to bind this application/service to.- Returns:
- name of a routing (or listener host/port) on WebServer
-
-
-
required
boolean required
Set to true if thevalue()
MUST be configured.- Returns:
true
to enforce existence of the named routing
- Default:
- false
-
-