public class ServerEngineFactory extends Object
Constructor and Description |
---|
ServerEngineFactory() |
Modifier and Type | Method and Description |
---|---|
static ServerEngine |
createEngine()
根据用户引入的HTTP服务器引擎jar,自动创建对应的HTTP客服务器引擎对象
推荐创建的引擎单例使用,此方法每次调用会返回新的引擎 |
static ServerEngine |
createEngine(ServerConfig config)
根据用户引入的HTTP客户端引擎jar,自动创建对应的HTTP服务器引擎对象
推荐创建的引擎单例使用,此方法每次调用会返回新的引擎 对不同引擎个性化配置,使用对应的 ServerConfig 子类:
如果混用这些配置,则个性配置不生效 |
static ServerEngine |
createEngine(String engineName)
创建自定义引擎
|
static ServerEngine |
getEngine()
获得单例的ServerEngine
|
public static ServerEngine getEngine()
public static ServerEngine createEngine(ServerConfig config)
ServerConfig
子类:
如果混用这些配置,则个性配置不生效
config
- Http客户端配置ClientEngine
public static ServerEngine createEngine(String engineName) throws HttpException
engineName
- 引擎名称,忽略大小写,如`Undertow`、`Tomcat`、`Jetty`、`SunHttpServer`HttpException
- 无对应名称的引擎public static ServerEngine createEngine()
ServerEngine
Copyright © 2025. All rights reserved.