Package org.astrogrid.samp.xmlrpc.apache

# Class ApacheServer

java.lang.Object
org.astrogrid.samp.xmlrpc.apache.ApacheServer

All Implemented Interfaces:
  `SampXmlRpcServer`

public class ApacheServer extends Object implements SampXmlRpcServer
SampXmlRpcServer implementation based on Apache XML-RPC library.

Since:
  22 Aug 2008
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`ApacheServer()`
Constructs a new server starting up a new WebServer object.
`ApacheServer(WebServer webServer, int port)`
Constructs a new server based on a given WebServer object.

## Method Summary

Modifier and Type
Method
Description
`void`
`addHandler(SampXmlRpcHandler handler)`
Adds a handler which can service certain XML-RPC methods.
`URL`
`getEndpoint()`
Returns the server's endpoint.
`void`
`removeHandler(SampXmlRpcHandler handler)`
Removes a previously-added handler.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ApacheServer

public ApacheServer(WebServer webServer, int port)
Constructs a new server based on a given WebServer object. Responsibility for `start`ing the WebServer and performing any other required configuration lies with the caller.

Parameters:
  `webServer` - apache xmlrpc webserver object
  `port` - port number on which the server is running

### ApacheServer

public ApacheServer() throws IOException
Constructs a new server starting up a new WebServer object. The server runs in a daemon thread.

Throws:
  `IOException`

## Method Details

### getEndpoint

public URL getEndpoint()
Description copied from interface: `SampXmlRpcServer`
Returns the server's endpoint.

Specified by:
  `getEndpoint` in interface `SampXmlRpcServer`
Returns:
  URL to which XML-RPC requests are POSTed

### addHandler

public void addHandler(SampXmlRpcHandler handler)
Description copied from interface: `SampXmlRpcServer`
Adds a handler which can service certain XML-RPC methods.

Specified by:
  `addHandler` in interface `SampXmlRpcServer`
Parameters:
  `handler` - handler to add

### removeHandler

public void removeHandler(SampXmlRpcHandler handler)
Description copied from interface: `SampXmlRpcServer`
Removes a previously-added handler.

Specified by:
  `removeHandler` in interface `SampXmlRpcServer`
Parameters:
  `handler` - handler to remove