Package com.robothy.netty.router
Class SpringWebRouter
java.lang.Object
com.robothy.netty.router.AbstractRouter
com.robothy.netty.router.SpringWebRouter
- All Implemented Interfaces:
Router
public class SpringWebRouter extends AbstractRouter
-
Field Summary
Fields inherited from interface com.robothy.netty.router.Router
DEFAULT_NOT_FOUND_HANDLER
-
Constructor Summary
Constructors Constructor Description SpringWebRouter()
-
Method Summary
Modifier and Type Method Description HttpRequestHandler
match(HttpRequest request)
Find a handler for the given request according to registered routes.Router
route(Route rule)
Register a handler for the request that matched rule.Methods inherited from class com.robothy.netty.router.AbstractRouter
exceptionHandler, findExceptionHandler, notFound, notFoundHandler, staticResource, staticResourceMatcher
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SpringWebRouter
public SpringWebRouter()
-
-
Method Details
-
route
Description copied from interface:Router
Register a handler for the request that matched rule.- Parameters:
rule
- match conditions- Returns:
- this
-
match
Description copied from interface:Router
Find a handler for the given request according to registered routes. And set the extracted path parameters to HttpRequest.parameters(String).- Parameters:
request
- HTTP request.- Returns:
- a matched handler; or
null
if no matched handlers.
-