Start script (included in every coldfusion page)

// note the call to create loads the class in coldfusion. an object isnít created until the first method is
// invoked (a default constructor is first called), or an init(Ö) method is called (init invokes the corresponding
// constructor).  note below the monitorFactory.start() is a static method that returns a Monitor object which
// ColdFusion can also handle.  we simply put JAMon.jar in the classpath of the ColdFusion machine.
<!--- Start Code--->
<cfobject action="CREATE" type="JAVA" name="CMmonitor1" class="com.jamonapi.Monitor">
<cfobject action="CREATE" type="JAVA" name="CMmonitor2" class="com.jamonapi.Monitor">
<cfobject action="CREATE" type="JAVA" name="CMmonitor3" class="com.jamonapi.Monitor">
<cfobject action="CREATE" type="JAVA" name="CMmonitor4" class="com.jamonapi.Monitor">
<cfobject action="CREATE" type="JAVA" name="cmmonitorFactory" class="com.jamonapi.MonitorFactory">


<cfset myUser=replace(REMOTE_ADDR,'.','-','All')>
     <cfoutput>
          <cfscript>
               CMmonitor1=cmmonitorFactory.start("manual.allpages");
               CMmonitor2=cmmonitorFactory.start("manual.#cgi.script_name#");
               CMmonitor3=cmmonitorFactory.start("manual.#myUser#");
               CMmonitor4=cmmonitorFactory.start("manual.allpages.#dateformat(now(),'mm/dd/yyyy')#");
          </cfscript>
     </cfoutput>
<!--- YOUR COLD FUSION TEMPLATE--->


<--- To stop --->
 <cfscript>
     CMmonitor1.stop();
     CMmonitor2.stop();
     CMmonitor3.stop();
     CMmonitor4.stop();
</cfscript>