Package com.iizix.server
Class JettyRunConfiguration
- java.lang.Object
- com.iizix.server.ServerShell
- com.iizix.server.JettyRunConfiguration
- All Implemented Interfaces:
IWebServiceEngine,WebSocketAcceptor,IAdditonalInformation<UserInfoHistoryEntry>,IAppLoader,IServer,IKStringInfoProviderHolder
- Direct Known Subclasses:
RuntimeBuilderServer,StandardServer
public class JettyRunConfiguration extends ServerShell
Server using Jetty to serve a Run Configuration launch of an application from Eclipse. It is assumed that the application is an iizi Module project that may refer to others, including Java projects.The classpath is set-up from Eclipse when the JRE launches the
main(args)static method. This code and other iizi parts are set in the classpath from either Jar files if using a "distribution environment", or the directories hard-coded if using an "iizi development environment".- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface com.iizix.server.IServer
IServer.State
Field Summary
Fields inherited from class com.iizix.server.ServerShell
externalBrowserPages, memoryJarFactory, xjarFactory
Constructor Summary
Constructors Constructor Description JettyRunConfiguration(java.io.File configFile, java.lang.String extServerURL, java.lang.String root, AppDefinition[] apps)Constructor.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigureProxy(java.net.HttpURLConnection urlConnection)Configures a Http(s)URLConnection for proxy information.booleandoCompressNormalHTML()Flag indicating the normal HTML files needs compression along with CSS minify and JS compression.java.net.ProxygetProxy(java.net.URL url)Gets a proxy to use for an URL.java.lang.StringgetRootDirectory()Gets the web server root directory.IWebServerCompressiongetWebServerCompression()Gets the web server compression interface.java.io.FilegetWebServerMapping(java.lang.String mappedFile)Gets the map of web server mappings for files.voidloadApplications()Called to load the application.static voidmain(java.lang.String[] args)Entry point for development server start.protected static voidmain(java.lang.String[] args, boolean isDevelServer, java.lang.Class<? extends JettyRunConfiguration> serverClass)Entry point for server start.protected voidonDispose()Disposes of the server.voidonStartServer()Called to initialize the server.Methods inherited from class com.iizix.server.ServerShell
_getState, _registerApplication, _unregisterApplication, addDisposeListener, addEndPointListener, addFileUploader, addModule, configureSessionMgr, dispose, flushStartupLog, getAccessibleEnvironments, getActiveUserSessions, getAdditionalInformation, getApplication, getApplications, getCurrentDirectory, getDefaultMailSender, getEmailVerificationURL, getEndPointsInstances, getETag, getExecutorService, getExternalWebServerBaseURL, getFileProviderEngine, getHistory, getInfoClass, getInstance, getInstance, getKStringInfoProvider, getMailSender, getPropertyFactory, getPropertyManager, getServerConfigFile, getServerLogger, getServerProperties, getServerSettings, getServerThreadGroup, getSourceResolver, getStartTime, getState, getTXPCoordinator, getWebLogos, getWebThumbs, getWorker, getWSUploaderService, initializeCompressedFiles, initializeURNFactory, isRequestURIAccepted, loadFile, loadFile, loadPlugins, loadPluginsAndConfig, loadServerConfig, onApplicationSessionStarted, onApplicationSessionStopped, onDisposed, onEndPointDisposed, registerApplication, registerApplication, registerEndPointConstructor, registerRegionLocationServiceProviders, registerRequestPrinter, removeDisposeListener, removeEndPointListener, removeFileUploader, removeModule, saveFile, saveServerConfig, setWSFileProviderEngine, shutdownRegionLocationServiceProviders, startServer, unregisterApplication, unregisterEndPointConstructor, unregisterRequestPrinter, updateWebServerRoot
Constructor Detail
JettyRunConfiguration
public JettyRunConfiguration(java.io.File configFile, java.lang.String extServerURL, java.lang.String root, AppDefinition[] apps) throws java.io.IOException, PropExceptionConstructor.- Parameters:
configFile- The configuration file, null for default.extServerURL- The external server URL, null for default.root- The Web Server root, null for default.apps- The apps loaded.- Throws:
java.io.IOException- For load failure.PropException- For property errors.
Method Detail
main
public static void main(java.lang.String[] args)
Entry point for development server start.
main
protected static void main(java.lang.String[] args, boolean isDevelServer, java.lang.Class<? extends JettyRunConfiguration> serverClass)Entry point for server start.
onStartServer
public void onStartServer() throws java.lang.ThrowableCalled to initialize the server.- Specified by:
onStartServerin interfaceIServer- Overrides:
onStartServerin classServerShell- Throws:
java.lang.Throwable- for start-up errors.
getRootDirectory
public java.lang.String getRootDirectory()
Gets the web server root directory.- Returns:
- The directory, or null if web server is not started.
loadApplications
public void loadApplications() throws java.lang.ThrowableCalled to load the application.- Specified by:
loadApplicationsin interfaceIServer- Specified by:
loadApplicationsin classServerShell- Throws:
java.lang.Throwable- for start-up errors.
onDispose
protected void onDispose()
Disposes of the server.- Overrides:
onDisposein classServerShell
getWebServerMapping
public java.io.File getWebServerMapping(java.lang.String mappedFile)
Gets the map of web server mappings for files.- Overrides:
getWebServerMappingin classServerShell- Parameters:
mappedFile- The file to map.- Returns:
- The mapping from String (such as "dojo.root" or "iiziRun.root") to File Returns null if not found.
getWebServerCompression
public IWebServerCompression getWebServerCompression()
Gets the web server compression interface.- Specified by:
getWebServerCompressionin classServerShell- Returns:
- The instance of the interface implemented by the web server.
doCompressNormalHTML
public boolean doCompressNormalHTML()
Flag indicating the normal HTML files needs compression along with CSS minify and JS compression.The files are typically: iiziApp.html and iiziVSViewer.html.
- Specified by:
doCompressNormalHTMLin classServerShell- Returns:
- true by default, override to return false (e.g. for internal development).
getProxy
public java.net.Proxy getProxy(java.net.URL url)
Gets a proxy to use for an URL.- Parameters:
url- The URL.- Returns:
- The Proxy to use.
configureProxy
public void configureProxy(java.net.HttpURLConnection urlConnection)
Configures a Http(s)URLConnection for proxy information.- Parameters:
urlConnection- The HttpURLConnection or HttpsURLConnection.