uk.ac.starlink.soap
Class AppHttpSOAPServer

java.lang.Object
  extended by org.mortbay.util.Container
      extended by org.mortbay.http.HttpServer
          extended by uk.ac.starlink.soap.AppHttpSOAPServer
All Implemented Interfaces:
Serializable, org.mortbay.util.EventProvider, org.mortbay.util.LifeCycle

public class AppHttpSOAPServer
extends org.mortbay.http.HttpServer

A HTTP and SOAP server for embedding in applications.

This should be used in applications that want to offer web services for clients to use. The web services offered are SOAP RPC requests for the activation of registered methods in classes that are part of the application.

A special property of this server over the standard Jetty one is that it requires only resources that are available locally and are located using the classloader (so the resource files can be packaged in jar files).

If the given port number is in use, then a search for a free port will be undertaken by incrementing the given port number.

The configuration of this server is builtin to provide Axis SOAP services.

Start up sequence:

    AppHttpSOAPServer server = new AppHttpSOAPServer( port_number );
    server.start();
    server.addSOAPServices(  );
 

Since:
22-MAY-2002
Version:
$Id$
Author:
Peter W. Draper, Alasdair Allan
See Also:
Serialized Form

Constructor Summary
AppHttpSOAPServer(int portNum)
          Constructor loads the default configuration and starts a HTTP/SOAP server on a given port.
 
Method Summary
 org.mortbay.jetty.servlet.WebApplicationContext addAxisSOAPServices(String direct)
          Add the Axis SOAP services (this is loaded when parsing the "jetty.xml" file).
 void addSOAPService(URL deployURL)
          Add new services to the SOAP server.
 int getPort()
          Return the port number being used.
static void main(String[] arg)
           
protected  org.mortbay.http.HttpContext newHttpContext()
          Create a new ServletHttpContext.
protected  void setDefaultPort(int portNum)
          Set the default port number to use, will try the suggested port number and if free will set the port number to that.
 
Methods inherited from class org.mortbay.http.HttpServer
addComponent, addContext, addContext, addContext, addContext, addEventListener, addHostAlias, addListener, addListener, addListener, addRealm, destroy, doStart, doStop, findHandler, getConnections, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsOpen, getConnectionsOpenMax, getConnectionsRequestsAve, getConnectionsRequestsMax, getContext, getContext, getContext, getContexts, getErrors, getHostMap, getHttpServerList, getHttpServers, getListeners, getRealm, getRequestLog, getRequests, getRequestsActive, getRequestsActiveMax, getRequestsDurationAve, getRequestsDurationMax, getRequestsPerGC, getResolveRemoteHost, getStatsOn, getStatsOnMs, getStopGracefully, getTrace, join, removeComponent, removeContext, removeEventListener, removeListener, removeRealm, save, service, setAnonymous, setContexts, setListeners, setRequestLog, setRequestsPerGC, setResolveRemoteHost, setStatsOn, setStopGracefully, setTrace, statsReset, stop
 
Methods inherited from class org.mortbay.util.Container
getComponents, isStarted, isStarting, isStopping, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mortbay.util.LifeCycle
isStarted, start, stop
 

Constructor Detail

AppHttpSOAPServer

public AppHttpSOAPServer(int portNum)
                  throws IOException
Constructor loads the default configuration and starts a HTTP/SOAP server on a given port. To complete this sequence you should "start()" the server and then load any application SOAP services.

Parameters:
portNum - the requested port on which to establish the HTTP services, this may not be the port actually used.
Throws:
IOException
Method Detail

newHttpContext

protected org.mortbay.http.HttpContext newHttpContext()
Create a new ServletHttpContext. This method is called by HttpServer to create new contexts. Thus calls to addContext or getContext that result in a new Context being created will return an ServletHttpContext instance (rather than a non-servlet type).

Overrides:
newHttpContext in class org.mortbay.http.HttpServer
Parameters:
contextPathSpec -
Returns:
ServletHttpContext

addAxisSOAPServices

public org.mortbay.jetty.servlet.WebApplicationContext addAxisSOAPServices(String direct)
                                                                    throws IOException
Add the Axis SOAP services (this is loaded when parsing the "jetty.xml" file). The WAR file may be stored in a jar file.

Parameters:
direct - name of the Axis war file.
Returns:
WebApplicationContext
Throws:
IOException

addSOAPService

public void addSOAPService(URL deployURL)
Add new services to the SOAP server. These are defined in a "Web Service Deployment Descriptor" (wsdd) file that is located using a URL (which can consequently be in a jar file, use the "getResource" method of "Class" to locate a file stored with the application classes).

Parameters:
deployURL - URL of a wsdd file containing deployment descriptions for the SOAP services to be offered by the application.

setDefaultPort

protected void setDefaultPort(int portNum)
Set the default port number to use, will try the suggested port number and if free will set the port number to that. However if that port is in use it will in incremement the number until it finds a free port (within the next 1000 ports). It will then put the server on that port.

Parameters:
portNum - the port number.

getPort

public int getPort()
Return the port number being used. This may differ from the port number asked for.


main

public static void main(String[] arg)


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.