Home  >  Q&A  >  body text

java - WebService:如何实现插件式的WebService呢?

需要用Java为多方提供不同的北向接口

例如部署在现场A的开放接口1、2,部署在现场B的开放接口3

以前的实现方式是将接口1、2、3都打包到工程中,不需要的可以不对外发布,但现在需改为可配置、可插拔的北向接口

我首先想到的是将接口打包成Jar,当需要时随时丢进工程,并重启工程重新加载,请问有实现过类似需求的吗?是怎样的思路呢?

高洛峰高洛峰2743 days ago696

reply all(2)I'll reply

  • 黄舟

    黄舟2017-04-18 10:55:23

    Is it good to implement configurability? The project is still in the form of a jar package, but can you configure your interface through configuration?

    reply
    0
  • 黄舟

    黄舟2017-04-18 10:55:23

    In fact, you can define an identifier on each interface. If the identifier is turned off, the business logic will not be executed, and the interface will not actually return business data, thus achieving the function you want

    reply
    0
  • Cancelreply