| Modifier and Type | Method and Description |
|---|---|
Windward |
delete(String relativePath,
Consumer<SimpleWindwardContext> consumer)
register function with delete method
|
Windward |
delete(String relativePath,
Function<EnhancedWindwardContext,?> function)
register function with delete method
|
<R> Windward |
delete(String relativePath,
Supplier<R> supplier)
register function with delete method
|
static List<ExceptionHandler> |
exceptionHandlers()
get exception handlers
|
static List<Filter> |
filters()
get filters
|
static <I> FunctionMetaInfo<I> |
findRouter(String relativePath,
String method)
find out registered function by specific path
|
Windward |
get(String relativePath,
Consumer<SimpleWindwardContext> consumer)
register function with get method
|
Windward |
get(String relativePath,
Function<EnhancedWindwardContext,?> function)
register function with get method
|
<R> Windward |
get(String relativePath,
Supplier<R> supplier)
register function with get method
|
String |
getContextPath() |
String |
getResourceRoot() |
RouterGroup<Windward> |
group(String relativePath)
define new router with specific relativePath
|
Windward |
http(HttpMethod httpMethod,
String relativePath,
Consumer<SimpleWindwardContext> consumer)
register function with specific method
|
Windward |
http(HttpMethod httpMethod,
String relativePath,
Function<EnhancedWindwardContext,?> function)
register function with specific method
|
<R> Windward |
http(HttpMethod httpMethod,
String relativePath,
Supplier<R> supplier)
register function with specific method
|
static <T extends Plugin> |
plugin(Class<T> clazz)
get plugin
|
static <T extends Plugin> |
plugins(Class<T> clazz)
get plugins by super or self
|
Windward |
post(String relativePath,
Consumer<SimpleWindwardContext> consumer)
register function with post method
|
Windward |
post(String relativePath,
Function<EnhancedWindwardContext,?> function)
register function with post method
|
<R> Windward |
post(String relativePath,
Supplier<R> supplier)
register function with post method
|
Windward |
put(String relativePath,
Consumer<SimpleWindwardContext> consumer)
register function with put method
|
Windward |
put(String relativePath,
Function<EnhancedWindwardContext,?> function)
register function with put method
|
<R> Windward |
put(String relativePath,
Supplier<R> supplier)
register function with put method
|
Windward |
registerExceptionHandler(ExceptionHandler... exceptionHandlers)
register exception handler
|
Windward |
registerFilter(Filter... filters)
register filter
|
Windward |
registerPlugin(Class<? extends Plugin> clazz,
Plugin plugin)
register plugin or overwrite existed
|
void |
run()
run server
|
static Windward |
setup() |
static Windward |
setup(int port,
Filter... filters)
prepare core engine of Windward
|
static Windward |
setup(int port,
String contextPath,
Filter... filters)
prepare core engine of Windward
|
static Windward |
setup(int port,
String contextPath,
String resourceRoot,
Filter... filters)
prepare core engine of Windward
|
Windward |
then() |
Windward |
ws(String relativePath,
Consumer<WebSocketWindwardContext> consumer)
register websocket function
|
public static Windward setup()
public static Windward setup(int port, Filter... filters)
port - server portfilters - request filterspublic static Windward setup(int port, String contextPath, Filter... filters)
port - server portcontextPath - path of rootfilters - request filterspublic static Windward setup(int port, String contextPath, String resourceRoot, Filter... filters)
port - server portcontextPath - path of rootresourceRoot - root for resourcefilters - request filterspublic void run()
throws ServerException
ServerException - exceptionpublic RouterGroup<Windward> group(String relativePath)
relativePath - relativePathpublic Windward registerFilter(Filter... filters)
filters - filterpublic Windward registerExceptionHandler(ExceptionHandler... exceptionHandlers)
exceptionHandlers - exception handlerpublic Windward registerPlugin(Class<? extends Plugin> clazz, Plugin plugin)
clazz - plugin classplugin - pluginpublic static <I> FunctionMetaInfo<I> findRouter(String relativePath, String method)
I - routers metadatarelativePath - relativePathmethod - http methods namepublic static List<ExceptionHandler> exceptionHandlers()
public static <T extends Plugin> T plugin(Class<T> clazz)
T - plugin typeclazz - class of pluginpublic static <T extends Plugin> List<T> plugins(Class<T> clazz)
T - class typeclazz - super or self classpublic String getContextPath()
public String getResourceRoot()
public Windward then()
public <R> Windward http(HttpMethod httpMethod, String relativePath, Supplier<R> supplier)
public Windward http(HttpMethod httpMethod, String relativePath, Consumer<SimpleWindwardContext> consumer)
public Windward http(HttpMethod httpMethod, String relativePath, Function<EnhancedWindwardContext,?> function)
public <R> Windward get(String relativePath, Supplier<R> supplier)
public Windward get(String relativePath, Consumer<SimpleWindwardContext> consumer)
public Windward get(String relativePath, Function<EnhancedWindwardContext,?> function)
public <R> Windward put(String relativePath, Supplier<R> supplier)
public Windward put(String relativePath, Consumer<SimpleWindwardContext> consumer)
public Windward put(String relativePath, Function<EnhancedWindwardContext,?> function)
public <R> Windward post(String relativePath, Supplier<R> supplier)
public Windward post(String relativePath, Consumer<SimpleWindwardContext> consumer)
public Windward post(String relativePath, Function<EnhancedWindwardContext,?> function)
public <R> Windward delete(String relativePath, Supplier<R> supplier)
public Windward delete(String relativePath, Consumer<SimpleWindwardContext> consumer)
public Windward delete(String relativePath, Function<EnhancedWindwardContext,?> function)
Copyright © 2023 flmelody. All rights reserved.