0% found this document useful (0 votes)
106 views4 pages

Contextinit Java

http://windsolarhybridaustralia.x10.mx/httpoutputtools-tomcat-java.html If you want a reliable view of what and how to use and compile download the zip at your own risk with no warranty and no guarantee.. http://www.windsolarhybridaustralia.x10.mx/Tomcat10M9-project-2DA-httpoutputtools-B(experiment-Not-Released).zip Nov 2020 14th [ note 11th Nov 20 - whole mod. operates fine in either X86 or X64 http://www.windsolarhybridaustralia.x10.mx/TOMCAT(10)-28-httptool-TimeZone-Arrays-PREVIEW-not-released.zip ] This application context listener class is placed in "WEB-INF/classes" folder of a Java .war J2EE application. It listens to change of phases as events of the Application LifeCycle phases. Method to load files into the classes of the RAMfileArray and the RAMstringB64Array on web application startup. While in a context of the application i test with it is effectively how, and also is Tomcat application server code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views4 pages

Contextinit Java

http://windsolarhybridaustralia.x10.mx/httpoutputtools-tomcat-java.html If you want a reliable view of what and how to use and compile download the zip at your own risk with no warranty and no guarantee.. http://www.windsolarhybridaustralia.x10.mx/Tomcat10M9-project-2DA-httpoutputtools-B(experiment-Not-Released).zip Nov 2020 14th [ note 11th Nov 20 - whole mod. operates fine in either X86 or X64 http://www.windsolarhybridaustralia.x10.mx/TOMCAT(10)-28-httptool-TimeZone-Arrays-PREVIEW-not-released.zip ] This application context listener class is placed in "WEB-INF/classes" folder of a Java .war J2EE application. It listens to change of phases as events of the Application LifeCycle phases. Method to load files into the classes of the RAMfileArray and the RAMstringB64Array on web application startup. While in a context of the application i test with it is effectively how, and also is Tomcat application server code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Samuel A Marchant Sydney NSW Australia 14th November 2020-11-
14T08:40:15.709Z
*/
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.Ramfile;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletContext;
import jakarta.servlet.RamStringB64;
import jakarta.servlet.RamHttpTools;
public class Contextinit implements ServletContextListener{

java.util.Locale defloc = (java.util.Locale.getDefault());


String loadname = "C:\\Program Files\\Apache Software Foundation\\Tomcat
10.0\\webapps\\RAMFileLoader\\WEB-INF\\filefile.txt";
String load64name = "C:\\Program Files\\Apache Software Foundation\\Tomcat
10.0\\webapps\\RAMFileLoader\\WEB-INF\\file64file.txt";
String tmplate = "EEE, dd MMM yyyy HH:mm:ss:nnnnnnnnn";
String nowtime = "";
String utt=" UTC";

public Contextinit(){}

public void contextInitialized(ServletContextEvent sce) {


// start the thread

RamHttpTools rhttpt = sce.getServletContext().getRamHttpToolsInstance();


java.time.Clock now; // clean up at end of sequence now=null;
now = rhttpt.getNowUTCclockInstance();
//
nowtime = "Completed context listener call for interface instance RamHttpTools
Application /RAMFileLoader - "+
(rhttpt.getzonedDateFormatted(rhttpt.getzonedClockinstant(now),tmplate,defloc));
System.out.println(nowtime);
System.out.println((rhttpt.getzonedDateRFC1123format(((java.time.OffsetDateTime.now
()).toZonedDateTime()),defloc))+utt);

Ramfile ramm = sce.getServletContext().getRamFileInstance();


nowtime = "Completed context listener call for interface instance Ramfile
Application /RAMFileLoader - "+
(rhttpt.getzonedDateFormatted(rhttpt.getzonedClockinstant(now),tmplate,defloc));
System.out.println(nowtime);
System.out.println((rhttpt.getzonedDateRFC1123format(((java.time.OffsetDateTime.now
()).toZonedDateTime()),defloc))+utt);

RamStringB64 r64 = sce.getServletContext().getRamStringB64Instance();


nowtime = "Completed context listener call for interface instance RamStringB64
Application /RAMFileLoader - "+
(rhttpt.getzonedDateFormatted(rhttpt.getzonedClockinstant(now),tmplate,defloc));
System.out.println(nowtime);
System.out.println((rhttpt.getzonedDateRFC1123format(((java.time.OffsetDateTime.now
()).toZonedDateTime()),defloc))+utt);

try {
java.io.File effar = new java.io.File(loadname);
ramm.loadPreLoadingList(effar);
nowtime = "Completed context listener file loading call for
org.apache.catalina.core.RAMfileArray in Application /RAMFileLoader - "+
(rhttpt.getzonedDateFormatted(rhttpt.getzonedClockinstant(now),tmplate,defloc));
System.out.println(nowtime);
System.out.println((rhttpt.getzonedDateRFC1123format(((java.time.OffsetDateTime.now
()).toZonedDateTime()),defloc))+utt);
//
effar = new java.io.File(load64name);
r64.loadPreLoadingListB64(effar,false);
nowtime = "Completed context listener file loading call for
org.apache.catalina.core.RAMStringB64Array in Application /RAMFileLoader - "+
(rhttpt.getzonedDateFormatted(rhttpt.getzonedClockinstant(now),tmplate,defloc));
System.out.println(nowtime);
System.out.println((rhttpt.getzonedDateRFC1123format(((java.time.OffsetDateTime.now
()).toZonedDateTime()),defloc))+utt);
//
// https://docs.oracle.com/javaee/6/api/?
javax/servlet/ServletContextListener.html
nowtime = "Completed ALL (exiting) context listener calls - "+
(rhttpt.getzonedDateFormatted(rhttpt.getzonedClockinstant(now),tmplate,defloc));
System.out.println(nowtime);
System.out.println((rhttpt.getzonedDateRFC1123format(((java.time.OffsetDateTime.now
()).toZonedDateTime()),defloc))+utt);
}catch(Exception ecces){
ecces.printStackTrace();
}
now=null;
}//end context init method

public void contextDestroyed(ServletContextEvent sce) {


// stop the thread
}

} // https://mkyong.com/servlet/what-is-listener-servletcontextlistener-example/

/*
EXAMPLE OUTPUT to "/logs" tomcat10-stdout.2020-11-14.log

2020-11-14 16:38:40 Apache Commons Daemon procrun stdout initialized.


INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfileArray - 2020-
11-14T08:38:40.807Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMStringB64Array -
2020-11-14T08:38:40.810Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfilingHTTPtools -
2020-11-14T08:38:40.892Z Zone-Name: +08:00
Completed context listener call for interface instance RamHttpTools Application
/RAMFileLoader - Sat, 14 Nov 2020 08:38:41:057000000
Sat, 14 Nov 2020 16:38:41 +0800 UTC
Completed context listener call for interface instance Ramfile Application
/RAMFileLoader - Sat, 14 Nov 2020 08:38:41:060000000
Sat, 14 Nov 2020 16:38:41 +0800 UTC
Completed context listener call for interface instance RamStringB64 Application
/RAMFileLoader - Sat, 14 Nov 2020 08:38:41:061000000
Sat, 14 Nov 2020 16:38:41 +0800 UTC
Completed context listener file loading call for
org.apache.catalina.core.RAMfileArray in Application /RAMFileLoader - Sat, 14 Nov
2020 08:38:41:062000000
Sat, 14 Nov 2020 16:38:41 +0800 UTC
Completed context listener file loading call for
org.apache.catalina.core.RAMStringB64Array in Application /RAMFileLoader - Sat, 14
Nov 2020 08:38:41:063000000
Sat, 14 Nov 2020 16:38:41 +0800 UTC
Completed ALL (exiting) context listener calls - Sat, 14 Nov 2020
08:38:41:063000000
Sat, 14 Nov 2020 16:38:41 +0800 UTC
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfileArray - 2020-
11-14T08:38:41.163Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMStringB64Array -
2020-11-14T08:38:41.163Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfilingHTTPtools -
2020-11-14T08:38:41.203Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfileArray - 2020-
11-14T08:38:41.245Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMStringB64Array -
2020-11-14T08:38:41.245Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfilingHTTPtools -
2020-11-14T08:38:41.249Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfileArray - 2020-
11-14T08:38:41.262Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMStringB64Array -
2020-11-14T08:38:41.262Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfilingHTTPtools -
2020-11-14T08:38:41.268Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfileArray - 2020-
11-14T08:38:41.429Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMStringB64Array -
2020-11-14T08:38:41.429Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfilingHTTPtools -
2020-11-14T08:38:41.432Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfileArray - 2020-
11-14T08:38:41.447Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMStringB64Array -
2020-11-14T08:38:41.447Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfilingHTTPtools -
2020-11-14T08:38:41.450Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfileArray - 2020-
11-14T08:38:41.462Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMStringB64Array -
2020-11-14T08:38:41.462Z Zone-Name: +08:00
INITIALIZED - CONSTRUCTOR END - class org.apache.catalina.core.RAMfilingHTTPtools -
2020-11-14T08:38:41.465Z Zone-Name: +08:00

*/

/*

file64file.txt

C:/Program Files (x86)/Apache Software Foundation/Tomcat


10.0/webapps/RAMFileLoader/0.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/1.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/2.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/3.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/4.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/5.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/6.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/7.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/8.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/WebApplication3/671097_61de9d7_900x2999.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/WebApplication3/739897.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/WebApplication3/0.jpeg

filefile.txt

C:/Program Files (x86)/Apache Software Foundation/Tomcat


10.0/webapps/RAMFileLoader/0.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/1.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/2.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/3.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/4.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/5.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/6.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/7.jpg
C:/Program Files (x86)/Apache Software Foundation/Tomcat
10.0/webapps/RAMFileLoader/8.jpg

*/

You might also like