org.apache.axis2.transport.http
Class SimpleHTTPServer

java.lang.Object
  extended byorg.apache.axis2.transport.TransportListener
      extended byorg.apache.axis2.transport.http.SimpleHTTPServer

public class SimpleHTTPServer
extends TransportListener

This is a simple implementation of an HTTP server for processing SOAP requests via Apache's xml-axis. This is not intended for production use. Its intended uses are for demos, debugging, and performance profiling. Note this classes uses static objects to provide a thread pool, so you should not use multiple instances of this class in the same JVM/classloader unless you want bad things to happen at shutdown.


Field Summary
protected  ConfigurationContext configurationContext
          Field systemContext
protected  Log log
          Field log
 
Fields inherited from class org.apache.axis2.transport.TransportListener
PARAM_PORT
 
Constructor Summary
SimpleHTTPServer()
          Constructor SimpleHTTPServer
SimpleHTTPServer(ConfigurationContext systemContext, int port)
          Constructor SimpleHTTPServer
SimpleHTTPServer(java.lang.String dir, int port)
          Constructor SimpleHTTPServer
 
Method Summary
protected  void finalize()
          stop the server if not already told to.
 ConfigurationContext getSystemContext()
          Method getSystemContext
 void init(ConfigurationContext axisConf, TransportInDescription transprtIn)
          init method in TransportListener
 boolean isRunning()
          Checks if this HTTP server instance is running.
static void main(java.lang.String[] args)
          Method main
 EndpointReference replyToEPR(java.lang.String serviceName)
          replyToEPR
 void start()
          Start this server as a NON-daemon.
 void stop()
          Stop this server.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Log log
Field log


configurationContext

protected ConfigurationContext configurationContext
Field systemContext

Constructor Detail

SimpleHTTPServer

public SimpleHTTPServer()
Constructor SimpleHTTPServer


SimpleHTTPServer

public SimpleHTTPServer(ConfigurationContext systemContext,
                        int port)
                 throws java.io.IOException
Constructor SimpleHTTPServer

Parameters:
systemContext -

SimpleHTTPServer

public SimpleHTTPServer(java.lang.String dir,
                        int port)
                 throws AxisFault
Constructor SimpleHTTPServer

Parameters:
dir -
Throws:
AxisFault
Method Detail

isRunning

public boolean isRunning()
Checks if this HTTP server instance is running.

Returns:
true/false

finalize

protected void finalize()
                 throws java.lang.Throwable
stop the server if not already told to.

Throws:
java.lang.Throwable

start

public void start()
           throws AxisFault
Start this server as a NON-daemon.

Specified by:
start in class TransportListener
Throws:
AxisFault

stop

public void stop()
Stop this server. Can be called safely if the system is already stopped, or if it was never started. This will interrupt any pending accept().

Specified by:
stop in class TransportListener

getSystemContext

public ConfigurationContext getSystemContext()
Method getSystemContext

Returns:
the system context

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Method main

Parameters:
args -
Throws:
java.lang.Exception

replyToEPR

public EndpointReference replyToEPR(java.lang.String serviceName)
                             throws AxisFault
replyToEPR

Specified by:
replyToEPR in class TransportListener
Parameters:
serviceName -
Returns:
an EndpointReference
Throws:
AxisFault
See Also:
TransportListener.replyToEPR(java.lang.String)

init

public void init(ConfigurationContext axisConf,
                 TransportInDescription transprtIn)
          throws AxisFault
init method in TransportListener

Specified by:
init in class TransportListener
Parameters:
axisConf -
transprtIn -
Throws:
AxisFault