Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

raining.client.* (6)raining.core.* (3)raining.examples.* (2)
raining.protocol.* (7)raining.protocol.http.* (7)raining.server.* (5)
raining.util.* (2)

Package Samples:

raining.core
raining.server
raining.client
raining.protocol.http
raining.examples
raining.util

Classes:

NioSocket: A Java 1.4.2 NIO-based non-blocking I/O framework, with buffered input and output. This abstracts the NIO, so that a user may extend this class and only override some events. It also tries to be as functional as possible so that a user can get away with as little overriding as possible. Many fields are public - deliberately so that applications arent slowed down using a get/set method. Anyone doing NIO work would be sensible enough to use these values sensibly :) Some event handles could have passed data to user, but due to tricky buffer handling, i didnt do that. I may extend this class, and move ...
HttpClient: A sample HTTPClient that extends NioSocket. Command line for: - file to take URLs from - use proxy, server, port, authstring FOr Testing or loading (this should go into another extends) - how many concurrent connections (A) - how long to keep hitting URL - any pause between A's - max hits RK modified on 20031004 13:08:05 Made proxy setting once and for all. User should just set and forget. I am removing the stupid idea of allowing setting encoded string in the command line. just makes things more complic for developers. TODO As much as i dislike wasting my time on the proxy thing, i wd like to ...
DefaultPriorityHandler: a default priority handler - handles priority of read and host (on connect). Connects: Checks a debarred(deny) hosts list and returns -1. Checks a allowed hosts list. if it exists then only these are allowed, all else are debarred. If not, it checks a deny list, all these are denied, all else are allowed. Checks a favored hosts list and returns 1. For all others returns 0. Needs to look into subnets also. Needs to pick from a file. Read: Checks operations. Returns 1 for GET and 0 for POST. Returns -1 for others. Checks resource. returns -1 for some folders returns 1 for some resources returns 0 ...
FileInfo: Maintains cacheable information of a file such as content, when last updated in cache, and methods to update the cache, and tell the cache if it needs updating. TODO: should store as ByteBuffers also i can keep header and content separate, and use a gathered write. First i need to change that in NioSocket. TODO: server_root needs to be set, i think. RK modified on 20031116 14:44:39: header is now part of content. Taken from Bulka's code (Java Performance and Scalability) and modified. This needs to be redone. The server sample wasn't written in an OO manner. I need to look into caching the header. ...
HttpOKResponse: Interface for Response, including response header creation. TODO:Remember that headers need to cached as does data. I suggest if not found in cache, we can store these contents using getContent. Else we just send the content as a whole without coming here. What about when file is updated. We need the header to be generated. Acco to RFC 2616 a server SHOULD send a "Date:" header, with the closest approximation of the time. THis means we have to keep updating this header and store it separately. However, the RFC states that if we cant give an accurate time, then we SHOULD not. XXX XXX i have begun ...
SocketBlaster: A Load Tester program that generates a high number of http requests to send to one URL. FIXME: Not working with proxies any longer. Command line for: - file to take URLs from, usually these would be different URLs on one server - use proxy, server, port, authstring FOr Testing or loading (this should go into another extends) - how many concurrent connections (A) - how long to keep hitting URL - any pause between A's - max hits We shd be able to inherit cl parsing and add/override our options ? Many things will have to be done ONCE not each time, since URLs are the same - URL parse, GET, base64 ...
ProxyServer: A very simple proxy server taking requests from clients and forwarding them to a server/s, and returning the results. This is based on the python proxy server example on nightmare.com/medusa/ However, this is not pipelined - i need to make a PipelinedNioSocket. We could use the Server class already developed or just make on from scratch here. First we scratch, then reuse. handle_read in NioSocket needed a terminator check for connect and read cases also. it was only there for accept channels.
AdvServer: A more functional server that permits handlers and protocols to be defined and passed in. TODO: refactor the http processing out of here, so it can be reused. TODO: read from priority file TODO: handle different mime-types. ?? TODO: handle errors 400: if request not a GET TODO: 304 if not modified since TODO: send last-modified TODO: try later, and close if beyond a limit TODO: flow control, if beyond a limit, rather than just close conn TODO: take care of absolute URL
UrlCache: Object that takes care of caching of a fileinfo object . This should probably implement a ContentCacheManager interface with get and put methods. The FileInfo param should also be a CachedObject class RK modified on 20031029 16:50:28 - added an LinkedHashMap that removes eldest entry after crossing max.
LRUHashMap: An extension of LinkedHashMap that removes eldest accessed entry after crossing the max_entries. Pls note that each access of an LRU obviously changes the underlying list. I need to do some performance testing on this, against some other implementation, or a home grown one.
Http503Response: Interface for Response, including response header creation. Remember that headers need to b cached as does data. TODO. I need to refactor this. only the 503 200 resp code differs. XXX : Are we even required to send content? i think we can SHOULD avoid.
HttpRequest: Class for representing HttpRequests. The server uses this to retrieve operations, and urls/paths from a request. RK added on 20031206 00:06:31 : added parsing of request using MessageHeader class. The URL etc should also be done from here.
SBHttpClient: An HTTPClient that extends the basic HTTPClient, with the ability to generate loads. FOr Testing or loading : - how many concurrent connections (A) - how long to keep hitting URL - any pause between A's - max hits
OptionProcessor: Interface for command line processing. Used by ClientParser. Developers using ClientParser would specify to the parser, how to process options, that they have added using Options.addOption().
Http404Response: Interface for Response, including response header creation. Remember that headers need to b cached as does data. TODO. I need to refactor this. only the 404 200 resp code differs.
LazyDate: a date that updates every "refresh" millis. copied from Bulka. There are 2 millis() happening in a row. can that be improved.
Response: Interface for Response, including response header creation. Remember that headers need to cached as does data.
Request: Interface for Requests. The server uses this to retrieve operations, and urls/paths from a request.
Processer: Processes incoming request as a runnable thread. This thread is fed to the PooledExecutor.
Http400Response: Class representing a bad request (non GET) or request without correct request headers.
ClientParser: A generic commandline parser for client programs. Extend this to add more options.
Server: A very simple server taking requests from clients and returns an OK.
Http501Response: Class representing a request (non GET) our server doesnt understand.
Http304Response: Class representing a request (non GET) our server doesnt understand.
Incoming: this class represents an incoming TCP socket.

Home | Contact Us | Privacy Policy | Terms of Service