Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrudolph/pooling-web-server
A pooling web server in Java
https://github.com/jrudolph/pooling-web-server
Last synced: 25 days ago
JSON representation
A pooling web server in Java
- Host: GitHub
- URL: https://github.com/jrudolph/pooling-web-server
- Owner: jrudolph
- Created: 2010-10-11T11:16:37.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2010-10-12T10:38:04.000Z (about 14 years ago)
- Last Synced: 2023-04-11T05:18:45.686Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 116 KB
- Stars: 14
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
A simple pooling webserver
==========================Features:
---------
* Pooling using java.util.concurrent.Executor
* Static file serving
* Http Keep-alive handling
* Experimental implementation using pooling and nioArchitecture:
-------------
This contains two implementations of a pooling webserver:SimplePooledWebServer:
The main thread waits and accepts connections and then schedules processing of
the connection with the executor. If keep-alive is enabled the thread keeps waiting
for requests for a certain time.NioPooledWebServer:
NioPooledWebServer is an experimental implementation, which uses java.nio to manage the currently idle
keep-alive connections along with new connections in the main thread. See the source code for more explanation
how this works.Classes:
--------
SimplePooledWebServer - The main class accepting connections and scheduling processing of requests
Settings - Global configuration
Handler - An abstraction of a component handling incoming requests in their own thread.
HttpHandler - An abstract handler doing basic Http Request/Response handling
StaticHttpFileHandler - A HttpHandler serving static files from the file-system
PingHandler - An example handler echoing requests directly back to the clientNioPooledWebServer - A more sophisticated web server using both pools and java.nio to
manage keep-alive connections in the main thread.Notes:
------This is a proof of concept of a pooling web server. The real work is finding out the best settings
for pooling and timeouts.In a productive environment you would probably use existing solutions for pooling and socket handling. E.g.
the Jetty webserver or Apache MINA.Run
---
With Maven installed, use `mvn exec:java` to run the simple webserver. Edit the pom.xml if you want to run the
Nio-version.