public class PokerFace extends Object
Modifier and Type | Field and Description |
---|---|
protected org.apache.http.nio.reactor.ConnectingIOReactor |
connectingReactor |
protected org.apache.http.nio.reactor.IOEventDispatch |
connectionDispatcher |
protected org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper |
handlerRegistry |
protected org.apache.http.nio.reactor.IOEventDispatch |
listeningDispatcher |
protected org.apache.http.nio.reactor.ListeningIOReactor |
listeningReactor |
protected static org.slf4j.Logger |
Logger |
protected NavigableMap<String,ScriptObjectMirror> |
scripts |
Constructor and Description |
---|
PokerFace()
Primary / Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
config(HierarchicalConfiguration config)
Configures all the needed components, but does not actually start the server.
|
protected boolean |
configureScripts(List<Path> jsLibs,
HierarchicalConfiguration scriptConfig,
Path baseScriptDirectory,
boolean watchScriptDirectory)
If requested by the user, this method walks the script directory discovering, loading, compiling, and initialing an .js javascript files it finds in the specified directory or it's children.
|
protected boolean |
loadScriptLibrary(Path lib)
Load the specified JavaScript library into the global scope of the Nashorn engine
|
boolean |
start()
All user definable configuration has occurred, fire up the server.
|
void |
stop()
Shut it all down.
|
protected static final org.slf4j.Logger Logger
protected org.apache.http.nio.reactor.ConnectingIOReactor connectingReactor
protected org.apache.http.nio.reactor.IOEventDispatch connectionDispatcher
protected org.apache.http.nio.reactor.ListeningIOReactor listeningReactor
protected org.apache.http.nio.reactor.IOEventDispatch listeningDispatcher
protected org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper handlerRegistry
protected NavigableMap<String,ScriptObjectMirror> scripts
public void config(HierarchicalConfiguration config) throws Exception
config
- Contains all information needed to fully wire up the http, https, and httpclient components of this reverse proxy.Exception
- Yeah, a lot can go wrong here, but at least it will be caught immediately :-)protected boolean configureScripts(List<Path> jsLibs, HierarchicalConfiguration scriptConfig, Path baseScriptDirectory, boolean watchScriptDirectory)
baseScriptDirectory
- The contents of this directory should be structured in the same layout as the url's we wish to interfere with.watchScriptDirectory
- If true, a watch will be placed on baseScriptDirectory
and any javascript file modifications (cud) will be dynamically rebuilt and reflected in the running server.protected boolean loadScriptLibrary(Path lib)
lib
- Path to the JavaScript library.public boolean start()
public void stop() throws IOException
IOException
Copyright © 2015–2024 Frank Stock. All rights reserved.