net.sourceforge.xmote.http
Class XmoteHttpServer

java.lang.Object
  extended by net.sourceforge.xmote.http.XmoteHttpServer

public class XmoteHttpServer
extends java.lang.Object

Author:
Jason Rush

Field Summary
protected  org.mortbay.jetty.Connector connector
           
protected  org.mortbay.jetty.handler.ContextHandlerCollection contexts
           
protected  int count
           
protected  org.mortbay.jetty.Server server
           
 
Constructor Summary
XmoteHttpServer(java.lang.String host, int port)
           
 
Method Summary
 java.lang.String addService(java.lang.Object service)
          Add a service to the server.
protected  org.mortbay.jetty.Connector createConnector()
          Creates a Connector instance for this server.
 java.lang.String getHost()
           
 int getPort()
           
 void start()
          Start the HTTP server.
 void stop()
          Stop the HTTP server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connector

protected org.mortbay.jetty.Connector connector

contexts

protected org.mortbay.jetty.handler.ContextHandlerCollection contexts

server

protected org.mortbay.jetty.Server server

count

protected int count
Constructor Detail

XmoteHttpServer

public XmoteHttpServer(java.lang.String host,
                       int port)
                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

createConnector

protected org.mortbay.jetty.Connector createConnector()
Creates a Connector instance for this server. Subclasses generally override this method to create different implementations of the Connector (e.g. SelectChannelConnector, BlockingChannelConnector, SocketConnector, SslSocketConnector).

Returns:
A new Connector instance.

start

public void start()
           throws java.lang.Exception
Start the HTTP server.

Throws:
java.lang.Exception - If an Exception occurs starting the HTTP server.

stop

public void stop()
          throws java.lang.Exception
Stop the HTTP server.

Throws:
java.lang.Exception - If an Exception occurs stopping the HTTP server.

getHost

public java.lang.String getHost()
Returns:
The host the server is bound to.

getPort

public int getPort()
Returns:
The port the server is bound to.

addService

public java.lang.String addService(java.lang.Object service)
                            throws XmoteException
Add a service to the server.

Parameters:
service - The service to add.
Returns:
The URL the service is located at.
Throws:
XmoteException - if an exception occurs starting the HTTP server or context.
See Also:
XmoteServer


Copyright (C) 2007 Jason Rush. All Rights Reserved.