public class NanoH5 extends NanoHTTPD implements ISystemConnector<de.tsl2.nano.persistence.Persistence>, de.tsl2.nano.core.IEnvChangeListener
TODO: - Bean--> BeanValue-->getColumnDefinition() --> Table(columns) - PageBuilder --> Bean.Presentable - Navigation - Verbindung/Abgrenzung BeanContainer - evtl mini-browser wie lynx einbinden - BeanContainer mit cache fuer tests
NanoHTTPD.AsyncRunner, NanoHTTPD.ClientHandler, NanoHTTPD.ContentType, NanoHTTPD.Cookie, NanoHTTPD.CookieHandler, NanoHTTPD.DefaultAsyncRunner, NanoHTTPD.DefaultServerSocketFactory, NanoHTTPD.DefaultTempFile, NanoHTTPD.DefaultTempFileManager, NanoHTTPD.HTTPSession, NanoHTTPD.IHTTPSession, NanoHTTPD.Method, NanoHTTPD.Response, NanoHTTPD.ResponseException, NanoHTTPD.SecureServerSocketFactory, NanoHTTPD.ServerRunnable, NanoHTTPD.ServerSocketFactory, NanoHTTPD.TempFile, NanoHTTPD.TempFileManager, NanoHTTPD.TempFileManagerFactory| Modifier and Type | Field and Description |
|---|---|
static String |
JAR_COMMON |
static String |
JAR_CURSUS |
static String |
JAR_DIRECTACCESS |
static String |
JAR_INCUBATION |
static String |
JAR_RESOURCES |
static String |
JAR_SAMPLE |
static String |
JAR_SERVICEACCESS |
static String |
JAR_SIMPLEXML |
static String |
ZIP_STANDALONE |
asyncRunner, MIME_DEFAULT_BINARY, MIME_HTML, MIME_PLAINTEXT, MIME_TYPES, MIME_XML, myRootDir, SOCKET_READ_TIMEOUT| Constructor and Description |
|---|
NanoH5() |
NanoH5(String serviceURL,
de.tsl2.nano.bean.def.IPageBuilder<?,String> builder) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(de.tsl2.nano.core.messaging.ChangeEvent t) |
void |
addSessionID(NanoH5Session session,
NanoHTTPD.Response response) |
de.tsl2.nano.bean.def.BeanDefinition<?> |
connect(de.tsl2.nano.persistence.Persistence persistence)
connect to backend through a persistence provider
|
protected de.tsl2.nano.bean.def.BeanDefinition<?> |
createBeanCollectors(List<Class> beanClasses)
after the creation of a new classloader and a beancontainer providing access to the new loaded bean types, this
method creates entries for all bean-types to the navigation stack. overwrite this method to define own
bean-collector handling.
|
protected List<Class> |
createBeanContainer(de.tsl2.nano.persistence.Persistence persistence,
de.tsl2.nano.persistence.PersistenceClassLoader runtimeClassloader)
createBeanContainer
|
de.tsl2.nano.persistence.Persistence |
createConnectionInfo()
getAuthenticationBean
|
protected IBeanNavigator |
createGenericNavigationModel() |
protected IBeanNavigator |
createGenericNavigationModel(boolean workflowDone)
reads all classes of 'beanjar', creates a root beancollector holding a collection of this classes.
|
protected de.tsl2.nano.bean.def.IPageBuilder<?,String> |
createPageBuilder()
adds services for presentation and page-builder
|
protected void |
createPersistenceProvider(de.tsl2.nano.persistence.Persistence persistence,
de.tsl2.nano.persistence.PersistenceClassLoader runtimeClassloader) |
static NanoHTTPD.Response |
createResponse(NanoHTTPD.Response.Status status,
String type,
String msg) |
NanoHTTPD.Response |
createResponse(String msg) |
protected NanoH5Session |
createSession(InetAddress inetAddress)
initialize navigation model and perhaps bean-definitions. overwrite this method if you create your extending
application. this method will be called, before any bean types are loaded!
|
protected String |
createStartPage() |
protected String |
createStartPage(String resultHtmlFile)
createStartPage
|
void |
createYAMLFiles() |
void |
disconnect(de.tsl2.nano.persistence.Persistence connectionEnd)
does some cleaning on dis-connection
|
protected void |
enableSSL(boolean ssl) |
protected void |
extractDefaultResources() |
protected void |
extractJarScripts() |
protected void |
generateDatabaseAndEntities(de.tsl2.nano.persistence.Persistence persistence,
String jarName) |
protected static Boolean |
generateJarFile(String jarFile,
String generator,
String schema) |
de.tsl2.nano.core.messaging.EventController |
getEventController() |
static int |
getPort(String serviceURL) |
static URL |
getServiceURL(String serviceURLString) |
NanoH5Session |
getSession(InetAddress address) |
NanoH5Session |
getSession(String userName) |
protected Map<Object,NanoH5Session> |
getSessions() |
static void |
main(String[] args)
main
|
void |
persist() |
static void |
registereExpressionsAndPools() |
void |
removeSession(NanoH5Session session) |
void |
reset() |
protected ClassLoader |
rootClassloader() |
protected void |
runLocalDatabase(de.tsl2.nano.persistence.Persistence persistence) |
NanoHTTPD.Response |
serve(String uri,
NanoHTTPD.Method m,
Map<String,String> header,
Map<String,String> parms,
Map<String,String> files)
Override this to customize the server.
|
void |
start()
starts application and shows initial html page
|
String |
toString() |
closeAllConnections, createClientHandler, createServerRunnable, decodeParameters, decodeParameters, decodePercent, getHostname, getListeningPort, getMimeTypeForFile, getServerSocketFactory, getTempFileManagerFactory, isAlive, makeSecure, makeSSLSocketFactory, makeSSLSocketFactory, makeSSLSocketFactory, mimeTypes, newChunkedResponse, newFixedLengthResponse, newFixedLengthResponse, newFixedLengthResponse, serve, serve, serveFile, setAsyncRunner, setServerSocketFactory, setTempFileManagerFactory, start, start, stop, useGzipWhenAccepted, wasStartedpublic static final String JAR_COMMON
public static final String JAR_SERVICEACCESS
public static final String JAR_DIRECTACCESS
public static final String JAR_INCUBATION
public static final String JAR_CURSUS
public static final String JAR_SAMPLE
public static final String JAR_RESOURCES
public static final String JAR_SIMPLEXML
public static final String ZIP_STANDALONE
public NanoH5()
throws IOException
IOExceptionpublic NanoH5(String serviceURL, de.tsl2.nano.bean.def.IPageBuilder<?,String> builder) throws IOException
IOExceptionpublic static final void registereExpressionsAndPools()
public static void main(String[] args)
args - public void start()
protected void enableSSL(boolean ssl)
throws IOException
IOExceptionprotected void extractDefaultResources()
protected void extractJarScripts()
public NanoH5Session getSession(InetAddress address)
public NanoH5Session getSession(String userName)
public static int getPort(String serviceURL)
protected String createStartPage()
protected String createStartPage(String resultHtmlFile)
resultHtmlFile - public NanoHTTPD.Response serve(String uri, NanoHTTPD.Method m, Map<String,String> header, Map<String,String> parms, Map<String,String> files)
serve in class NanoHTTPDuri - Percent-decoded URI without parameters, for example "/index.cgi"m - "GET", "POST" etc.header - Header entries, percent decodedparms - Parsed, percent decoded parameters from URI and, in case of POST, data.public void addSessionID(NanoH5Session session, NanoHTTPD.Response response)
protected Map<Object,NanoH5Session> getSessions()
public NanoHTTPD.Response createResponse(String msg)
public static NanoHTTPD.Response createResponse(NanoHTTPD.Response.Status status, String type, String msg)
protected de.tsl2.nano.bean.def.IPageBuilder<?,String> createPageBuilder()
protected NanoH5Session createSession(InetAddress inetAddress)
protected IBeanNavigator createGenericNavigationModel()
protected IBeanNavigator createGenericNavigationModel(boolean workflowDone)
beanjar - jar to resolve the desired entities frompublic de.tsl2.nano.persistence.Persistence createConnectionInfo()
ISystemConnectorcreateConnectionInfo in interface ISystemConnector<de.tsl2.nano.persistence.Persistence>public de.tsl2.nano.bean.def.BeanDefinition<?> connect(de.tsl2.nano.persistence.Persistence persistence)
connect in interface ISystemConnector<de.tsl2.nano.persistence.Persistence>public void disconnect(de.tsl2.nano.persistence.Persistence connectionEnd)
ISystemConnectordisconnect in interface ISystemConnector<de.tsl2.nano.persistence.Persistence>protected ClassLoader rootClassloader()
protected de.tsl2.nano.bean.def.BeanDefinition<?> createBeanCollectors(List<Class> beanClasses)
beanClasses - new loaded bean typesprotected List<Class> createBeanContainer(de.tsl2.nano.persistence.Persistence persistence, de.tsl2.nano.persistence.PersistenceClassLoader runtimeClassloader)
persistence - runtimeClassloader - protected void createPersistenceProvider(de.tsl2.nano.persistence.Persistence persistence,
de.tsl2.nano.persistence.PersistenceClassLoader runtimeClassloader)
protected void generateDatabaseAndEntities(de.tsl2.nano.persistence.Persistence persistence,
String jarName)
throws de.tsl2.nano.core.ManagedException
de.tsl2.nano.core.ManagedExceptionprotected void runLocalDatabase(de.tsl2.nano.persistence.Persistence persistence)
protected static Boolean generateJarFile(String jarFile, String generator, String schema)
public void reset()
reset in class de.tsl2.nano.core.Mainpublic void persist()
persist in class de.tsl2.nano.core.Mainpublic de.tsl2.nano.core.messaging.EventController getEventController()
getEventController in class de.tsl2.nano.core.Mainpublic void removeSession(NanoH5Session session)
public void accept(de.tsl2.nano.core.messaging.ChangeEvent t)
public void createYAMLFiles()
Copyright © 2012–2020. All rights reserved.