开发者

how to implement java service

开发者 https://www.devze.com 2023-01-15 05:20 出处:网络
I w开发者_JAVA百科ant to create service using Java service provider inferface. Please help me how to create service in Java.

I w开发者_JAVA百科ant to create service using Java service provider inferface. Please help me how to create service in Java.

Thanks


A service provider interface (or SPI) for short is a concrete implementation of an API formalized as a set of java interfaces.

So the short answer is to create a set of classes which implement the API interfaces for which you want to create a concrete implementation.

Here is an article which goes into more detail.


There's a pretty useful script to wrap up a java app as a windows service here: http://wrapper.tanukisoftware.com/doc/english/download.jsp


Maybe you can look to java.util.ServiceLoader to see how you can use it.

0

精彩评论

暂无评论...
验证码 换一张
取 消