com.prolixtech.jaminid

Class ContentOracle

Known Direct Subclasses:
HelloWorldServer, SimpleServer, StreamingOracle

public class ContentOracle
extends java.lang.Object

The content oracle is a very special class. It completely allows us to delegate the computation of

Field Summary

protected static ContentOracle
theInstance

Method Summary

static ContentOracle
Instance()
pertains to the singleton DESIGN PATTERN
String
demultiplex(Request connRequest, Response connResponse)
the main function of the oracle, is to demux the request and produce an output that is relative to the request.
ContentOracle
getDelegatedOracle(Request serviceRequest)

Field Details

theInstance

protected static ContentOracle theInstance

Method Details

Instance

public static ContentOracle Instance()
pertains to the singleton DESIGN PATTERN
Returns:
ContentOracle

demultiplex

public String demultiplex(Request connRequest,
                          Response connResponse)
the main function of the oracle, is to demux the request and produce an output that is relative to the request. in this example, it is a static HTML, that is all we care about for now.
Parameters:
connRequest -
connResponse -
Returns:
the output

getDelegatedOracle

public ContentOracle getDelegatedOracle(Request serviceRequest)
Returns:
the oracle that will handle the request