User Guide

Chapter 18: Building Custom CFAPI Tags 283
Automatic Class Reloading
You can determine how the server treats changed Java CFX class files by using the
RELOAD (?) . The allowable values for the RELOAD attribute are as follows:.
The default value is
RELOAD=Auto. This is appropriate for most applications. Use
RELOAD="Always" during the development process when you want to ensure that you
always have the latest class files, even when only a dependent class has changed. Use
RELOAD="Never" to increase performance by skipping the check for changed classes.
Note The RELOAD attribute applies only to class files located in the classes
directory. Classes located on the Java class path are loaded once per
server lifetime and can only be reloaded by stopping and restarting
ColdFusion Server.
Disabling Automatic Reloading for Deployment
Automatic class reloading is an essential feature for iterative development and testing.
However, because it must continually check to see whether Java CFX class files have
changed, performance may decrease slightly. Therefore, when you move from
development into deployment, Allaire ecommends that you globally disable automatic
class reloading. You can do this by modifying the
coldfusion.cfx.class.reload
setting of the
config/jvm.init file as follows:
coldfusion.cfx.class.reload=no
For additional details on modifying JVM configuration file settings, see “Java
Customization and Configuration” on page 289.
Life cycle of Java CFXs
A new instance of the Java CFX object is created for each invocation of the Java CFX
tag. This means that it is safe to store per-request instance data within the members of
Allowable Values of RELOAD Attribute
Value Description
Auto Automatically reload Java CFX and dependent classes within the
classes directory whenever the CFX class file changes. Does not
reload if a dependent class file changes without the CFX class file
changing as well.
Always Always reload Java CFX and dependent classes within the classes
directory. Ensures a reload even if a dependent class changes, but the
CFX class file itself does not change.
Never Never reload Java CFX classes. Load them once per server lifetime.