org.plovr
Class CompilationServer
java.lang.Object
org.plovr.CompilationServer
- All Implemented Interfaces:
- java.lang.Runnable
public final class CompilationServer
- extends java.lang.Object
- implements java.lang.Runnable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompilationServer
public CompilationServer(java.lang.String listenAddress,
int port)
registerConfig
public void registerConfig(Config config)
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
containsConfigWithId
public boolean containsConfigWithId(java.lang.String id)
getConfigById
public Config getConfigById(java.lang.String id)
getAllConfigs
public java.lang.Iterable<Config> getAllConfigs()
recordCompilation
public void recordCompilation(Config config,
Compilation compilation)
- Records the last compilation for the config.
getLastCompilation
public Compilation getLastCompilation(Config config)
- Returns:
- the last recorded compilation for the specified config
getSourceMapFor
public com.google.javascript.jscomp.SourceMap getSourceMapFor(Config config)
getExportsAsExternsFor
public java.lang.String getExportsAsExternsFor(Config config)
getServerForExchange
public java.lang.String getServerForExchange(com.sun.net.httpserver.HttpExchange exchange)
- Returns the server name using an incoming request to this CompilationServer.
Unfortunately, HttpExchange does not appear to have a getServerName()
method like ServletRequest does, so this method must use a heuristic.
If the hostname is not specified in the config file, and it cannot be
determined from the referrer, then it is assumed to be localhost.
- Parameters:
exchange
-
- Returns:
- the server scheme, name, and port, such as "http://localhost:9810/"