php.java.bridge.http
Class HttpServer

java.lang.Object
  extended by php.java.bridge.http.HttpServer
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
JavaBridgeRunner

public abstract class HttpServer
extends java.lang.Object
implements java.lang.Runnable

This class can be used to create a simple HTTP server. It is used when running local scripts like e.eval(new StringReader('<?php phpinfo(); ?>'));. For remote scripts use a HttpProxy and URLReader instead.

Author:
jostb
See Also:
HttpRequest, HttpResponse, Continuation, URLReader, Continuation

Field Summary
static java.lang.String GET
          Request method PUT
static java.lang.String POST
          Request method POST
static java.lang.String PUT
          Request method GET
 
Method Summary
abstract  ISocketFactory bind(java.lang.String addr)
          Create a server socket.
abstract  ISocketFactory bindSecure(java.lang.String addr)
          Create a server socket.
 void destroy()
          Stop the HTTP server.
 ISocketFactory getSocket()
          Returns the server socket.
 void run()
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUT

public static final java.lang.String PUT
Request method GET

See Also:
Constant Field Values

GET

public static final java.lang.String GET
Request method PUT

See Also:
Constant Field Values

POST

public static final java.lang.String POST
Request method POST

See Also:
Constant Field Values
Method Detail

bind

public abstract ISocketFactory bind(java.lang.String addr)
                             throws java.io.IOException
Create a server socket.

Parameters:
addr - The host address, either INET:port or INET_LOCAL:port
Returns:
The server socket.
Throws:
java.io.IOException

bindSecure

public abstract ISocketFactory bindSecure(java.lang.String addr)
                                   throws java.io.IOException
Create a server socket.

Parameters:
addr - The host address, either INET:port or INET_LOCAL:port
Returns:
The server socket.
Throws:
java.io.IOException

run

public void run()

Specified by:
run in interface java.lang.Runnable

destroy

public void destroy()
Stop the HTTP server.


getSocket

public ISocketFactory getSocket()
Returns the server socket.

Returns:
The server socket.