| 1 |
package org.astrogrid.samp.xmlrpc.apache; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
import org.astrogrid.samp.xmlrpc.SampXmlRpcServer; |
| 5 |
import org.astrogrid.samp.xmlrpc.SampXmlRpcServerFactory; |
| 6 |
|
| 7 |
/** |
| 8 |
* SampXmlRpcServerFactory implementation which uses Apache classes. |
| 9 |
* Server construction is lazy and the same server is returned each time. |
| 10 |
* |
| 11 |
* @author Mark Taylor |
| 12 |
* @since 22 Aug 2008 |
| 13 |
*/ |
| 14 |
public class ApacheServerFactory implements SampXmlRpcServerFactory { |
| 15 |
private SampXmlRpcServer server_; |
| 16 |
|
| 17 |
public synchronized SampXmlRpcServer getServer() throws IOException { |
| 18 |
if ( server_ == null ) { |
| 19 |
server_ = new ApacheServer(); |
| 20 |
} |
| 21 |
return server_; |
| 22 |
} |
| 23 |
} |