| 1 |
package org.astrogrid.samp.xmlrpc; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
|
| 5 |
/** |
| 6 |
* Defines a factory for SampXmlRpcServer instances. |
| 7 |
* In most cases it will make sense to implement this class so that |
| 8 |
* a single server instance is constructed lazily, and the same instance |
| 9 |
* is always returned from the {@link #getServer} method. |
| 10 |
* This means that the same server can be used for everything that requires |
| 11 |
* an XML-RPC server, thus keeping resource usage down. |
| 12 |
* Users of this class must keep this implementation model in mind, |
| 13 |
* so must not assume that a new instance is returned each time. |
| 14 |
* But if an implementation wants to return a new instance each time for |
| 15 |
* some reason, that is permissible. |
| 16 |
* |
| 17 |
* @author Mark Taylor |
| 18 |
* @since 22 Aug 2008 |
| 19 |
*/ |
| 20 |
public interface SampXmlRpcServerFactory { |
| 21 |
|
| 22 |
/** |
| 23 |
* Returns an XML-RPC server implementation. |
| 24 |
* Implementations are permitted, but not required, to return the same |
| 25 |
* object from different calls of this method. |
| 26 |
* |
| 27 |
* @return new or re-used server |
| 28 |
*/ |
| 29 |
SampXmlRpcServer getServer() throws IOException; |
| 30 |
} |