|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.util.http.HTTPServer
public class HTTPServer
Provides a shell under which a Jetty HTTP server is run. This is a singleton class, as there is only one HTTP server per running instance of Ceryle (indeed, per machine).
To obtain the instance of this class and start the server:
HTTPServer httpserver = HTTPServer.getInstance();
httpserver.start();
| Field Summary | |
|---|---|
static String |
DEFAULT_HOST
The default hostname to use for communications. |
static int |
DEFAULT_PORT
The default socket to use for communications. |
protected static String |
m_base
The web server's virtual base context path. |
protected static String |
m_host
The hostname to use for communications. |
protected static int |
m_port
The current socket to use for communications. |
protected static File |
m_root
The web server's virtual root/context path. |
protected static String |
m_rootURL
The root HTTP URL of the running server. |
protected MessageHandler |
mh
|
protected PropertyManager |
pm
|
static String |
SERVER_VERSION
HTTP Server version. |
protected Services |
srvs
|
| Method Summary | |
|---|---|
protected void |
doStop()
Actually performs the stop server action. |
protected void |
fireEvent()
Fires a ChangeEvent to all registered listeners, indicating some significant change in server status. |
static String |
getBaseContext()
Returns the base context, whose default is "/". |
static HTTPServer |
getInstance()
As this is a singleton class, this returns the single instance of this class using the defaults provided by the application properties file and settings. |
int |
getPort()
Returns the currently-used HTTP port. |
String |
getRootURL()
Returns the root HTTP URL of the server. |
static String |
getSampleBaseURL(String hostname,
int port)
A simple utility that returns a sample base URL based on the supplied hostname and port. |
WikiUtils |
getWikiUtils()
Return the WikiUtils if there is a wiki installation, null if not. |
void |
halt()
Halts the HTTP server. |
static boolean |
hasInstance()
Returns true if there is an HTTP server instance (running or not). |
static boolean |
isRunning()
Returns true if the HTTP server is running and accepting new service requests. |
void |
kill()
Immediately stops the HTTP server. |
void |
loadProperties()
Loads server properties from the PropertyManager. |
void |
presetServices()
Preset the Wiki listener so that when the WikiEngine starts the initialization events will be captured. |
void |
serverIsRunning()
Called by the start process after the server is running. |
void |
start()
Starts up the HTTP server. |
protected void |
writeLog(String s)
Write the String s to the log file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SERVER_VERSION
public static final String DEFAULT_HOST
protected static String m_host
public static final int DEFAULT_PORT
protected static int m_port
DEFAULT_PORT.
The property for this setting is: http://purl.org/ceryle/prop/#HTTPport.
protected static File m_root
protected static String m_rootURL
protected static String m_base
protected Services srvs
protected MessageHandler mh
protected PropertyManager pm
| Method Detail |
|---|
public static HTTPServer getInstance()
public static String getBaseContext()
public String getRootURL()
public int getPort()
public void start()
public WikiUtils getWikiUtils()
public void presetServices()
public void serverIsRunning()
public void loadProperties()
throws IOException
IOExceptionpublic static boolean isRunning()
public static boolean hasInstance()
public void halt()
public void kill()
protected void doStop()
protected void writeLog(String s)
public static String getSampleBaseURL(String hostname,
int port)
protected final void fireEvent()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||