org.astrogrid.samp.xmlrpc.apache
Class ApacheServer

java.lang.Object
  extended byorg.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
ApacheServer()
          Constructs a new server starting up a new WebServer object.
ApacheServer(org.apache.xmlrpc.WebServer webServer, int port)
          Constructs a new server based on a given WebServer object.
 
Method Summary
 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 Detail

ApacheServer

public ApacheServer(org.apache.xmlrpc.WebServer webServer,
                    int port)
Constructs a new server based on a given WebServer object. Responsibility for starting 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.

Method Detail

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


Copyright © 2008 AstroGrid. All Rights Reserved.