用户工具

站点工具


light4j:service
  • 单例:SingletonServiceFactory.getBean(Class<T> interfaceClass)
- com.networknt.handler.HandlerProvider:
  - com.networknt.server.TestHandlerProvider
  • 多个实例:SingletonServiceFactory.getBeans(Class<T> interfaceClass)
- com.networknt.server.ShutdownHookProvider:
  - com.networknt.server.Test1ShutdownHook
  - com.networknt.server.Test2ShutdownHook
  • 实例支持set字段
- com.networknt.service.L:
  - com.networknt.service.LImpl:
      protocol: https
      host: localhost
      port: 8080
      parameters:
        key1: value1
        key2: value2
  • 支持多参数构造函数
- com.networknt.service.M:
  - com.networknt.service.MImpl:
    - java.lang.String: Steve
    - int: 2
    - int: 3
  • 支持自动构造注入:ConsulRegistry(URL url, ConsulClient client)
- com.networknt.registry.URL:
  - com.networknt.registry.URLImpl:
      protocol: light
      host: localhost
      port: 8080
      path: consul
      parameters:
        registryRetryPeriod: '30000'
- com.networknt.consul.client.ConsulClient:
  - com.networknt.consul.client.ConsulClientImpl:
- com.networknt.registry.Registry:
  - com.networknt.consul.ConsulRegistry
  • 支持静态工厂类
- com.networknt.service.ChannelMapping: com.networknt.service.ServiceInitializer::channelMapping
  • 接口支持泛型:SingletonServiceFactory.getBean(Class<T> interfaceClass, Class typeClass)
- com.networknt.service.Validator<com.networknt.service.Contact>:
  - com.networknt.service.ContactValidator
  • 接口支持逗号分隔
- com.networknt.service.D1, com.networknt.service.D2:
  - com.networknt.service.DImpl
- com.networknt.service.E,com.networknt.service.F:
  - com.networknt.service.EF1Impl
  - com.networknt.service.EF2Impl
light4j/service.txt · 最后更改: 2020/07/01 00:10 由 admin