how to implement java service
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.
精彩评论