13.8.5 Files for update detection

Of the files loaded using the class loader, the J2EE server detects the updates and reloads the files when the monitored files are updated. The file updates are detected when the J2EE application starts.

However, the updates are not detected for the files that are not loaded with the class loader. The updates are not detected for the files that are in the application directory but are not loaded and the J2EE application files that do not use the application directory. Furthermore, the updates are not detected for the DD (ejb-jar.xml and web.xml).

Also, with the exploded archive format, if the date of update of an updated JSP file is old, the JSP re-compilation is not executed.

Organization of this subsection
(1) Target files for update detection
(2) Examples of target files for update detection
(3) Operations that are reloaded

(1) Target files for update detection

The following table describes the target files for update detection.

Table 13-13 Target files for update detection

TypeTarget files for update detectionScope of reloading#1
appwebjsp
Files beneath the application directory
  • Library JARs
Y----
EJB application files (EJB-JARs) beneath the EJB-JAR directory
  • Class files
  • Property files loaded by java.util.ResourceBundle
Y----
Web application files (WARs) beneath the WAR directoryServlet
  • Class files
  • JAR files
  • Property files loaded by java.util.ResourceBundle
YY--
JSP
  • JSP files
Y#2Y#2Y#2
  • Tag files
  • Tag library descriptors
Y#3Y#3Y#3
  • JSP compilation results
  • Tag file compilation results
Y#4Y#4Y#4
  • Static contents
Y#5Y#5Y#5
Files other than those beneath the application directory
  • Reference libraries
Y----
Legend:
Y: Updates are detected
N: Updates are not detected

#1: app, web, and jsp in the scope of reloading are the values specified in the ejbserver.deploy.context.reload_scope key of usrconf.properties.

#2: The updates are detected for the JSPs that are not pre-compiled and are already loaded.

#3: The updates are detected if the tag files and tag library descriptors are used with loaded JSP files or tag files when the JSPs are not pre-compiled.

#4: The updates are detected when the JSPs are pre-compiled.

#5: The updates are detected when the JSP files or tag files are dependent files. The dependent files are the files that are included in the include directive of the JSP files or tag files and the files that are included in <include-prelude> or <include-coda> of web.xml.


(2) Examples of target files for update detection

The following table describes the examples of files for which updates are detected from among the files beneath the application directory.

Table 13-14 Examples of target files for update detection

DirectoryFiles beneath the directoryUpdate detection target
Application-directoryExample of library JARs: MyLibrary.jarY

META-INF
  • DD for J2EE applications (application.xml)
  • Cosminexus application property file (cosminexus.xml)
--

EJB-JAR-directory----

META-INFDD for the EJB-JARs (ejb-jar.xml)--

Package-nameEnterprise Bean classes
Example: MyEJB.class
Y

Home interface classes
Example: MyEJBHome.class
Y

Component interface classes
Example: MyEJBRemote.class
Y

Business interface classes
Example: MyBusiness.class
Y

Classes used from the EJB
Example: MyClass.class
Y

Property files loaded by java.util.ResourceBundle
Example: MyResource.properties
Y

WAR-directoryJSP files
Example: MyJsp.jsp
Y

Static contents
Example: MyStatic.jspf
Y

HTML files
Example: MyIndex.html
--

META-INF----

WEB-INFDD for the Web applications (web.xml)--

Tag file descriptor file
Example: MyTaglib.tld
Y

Web application property file (hitachi_web.properties)--

classes----

Package-nameProperty files loaded by java.util.ResourceBundle
Example: MyResource.properties
Y

Servlet classes
Example: MyServlet.class
Y

libJAR files
Example: MyLibrary.jar
Y

tagsTag files
Example: MyTag.tag
Y

JSP-working-directoryJSP compilation results
Example: MyJsp$jsp.class
Y

WEB-INFtagsTag file compilation results
Example: MyTag$tag.class
Y
Directory-other-than-the-application-directoryReference libraries
Example: MyRef.jar
Y
Legend:
Y: Updates are detected
N: Updates are not detected

(3) Operations that are reloaded

When the files to be monitored are changed, whether updates are detected and reload is executed differs depending upon the file operations. The following table describes the operations that are reloaded.

Table 13-15 Operations that are reloaded

Target files for update detectionFile operationsNotes
AddDeleteUpdate
Files beneath the application directoryLibrary JARNNY
  • Annotations are also read.#1
  • You cannot change the names of the library JARs.
  • You can change the library JAR configuration.
Cosminexus application property fileNNN
  • If the contents of cosminexus.xml are changed or deleted when the reload process is executed and, the definition information is not read again.
EJB application files (EJB-JARs) beneath the EJB-JAR directoryClass files configuring the EJBNNY
  • Annotations are also read.#1
  • You cannot change the class name.
  • If the class that was not referenced so far is updated so that the class is now referenced, the reference destination class file is also reloaded.
Other class filesNNY
  • Annotations are also read.#1
  • If the class that was not referenced so far is updated so that the class is now referenced, the reference destination class file is also reloaded.
Web application files (WARs) beneath the WAR directoryClass filesRYY--
JAR filesYYY--
Property filesRYY--
JSP filesRY#2Y#2--
Tag filesRY#2Y#2
  • Excludes the tag files in the JAR files.
Files on which the JSP files or tag files dependRY#2Y#2--
Static contentsRNN
  • When reloading functionality is used, the cache is disabled.
JSP compilation results (class files generated by compiling the JSPs and tag files)RYY
  • The JSP pre-compile functionality must be enabled.
Files other than those beneath the application directoryReference librariesNNY
  • You cannot change the name of the reference library.
  • You can update the configuration of the JAR files and the files in the class path that is specified by the reference library.
  • If the stub and container-generated classes must be re-generated, the classes are regenerated.
Legend:
Y: Reloading process is executed
R: Operations can be performed, but the reloading process is not executed
N: Reloading process is not executed
--: Not applicable

#1: Some annotations can be updated and some cannot be updated. For details on annotations, see 12.6.1 Updating the annotations.

#2: When the JSP pre-compile functionality is enabled, R.