Package io.helidon.microprofile.server
Annotation Interface RoutingName
Binds an
Application
or Service
to a specific (named) routing
on WebServer
. 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) {
rules.get("/hello", (req, res) -> res.send("Hello WebServer"));
}
}
Example configuration (yaml):
com.example.MyService.routing-name: name: "@default" required: false
-
Required Element Summary
-
Optional Element Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Configuration key of the routing name, appended after the fully qualified class name (does not contain the leading dot).static final String
Configuration key of the routing name required flag, appended after the fully qualified class name (does not contain the leading dot).static final String
Name (reserved) for the default listener of WebServer.
-
Field Details
-
CONFIG_KEY_NAME
Configuration key of the routing name, appended after the fully qualified class name (does not contain the leading dot).- See Also:
-
CONFIG_KEY_REQUIRED
Configuration key of the routing name required flag, appended after the fully qualified class name (does not contain the leading dot).- See Also:
-
DEFAULT_NAME
Name (reserved) for the default listener of WebServer.- See Also:
-
-
Element Details
-
value
String valueName of a routing to bind this application/service to.- Returns:
- name of a routing (or listener host/port) on WebServer
-
-
-
required
boolean requiredSet to true if thevalue()
MUST be configured.- Returns:
true
to enforce existence of the named routing
- Default:
- false
-