PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/cacheManagement/examples/root/basic/index.cfm

http://coldfusioncachemanager.googlecode.com/
ColdFusion | 85 lines | 47 code | 38 blank | 0 comment | 4 complexity | 983330d1088b48a3fcb3b9f7a3038228 MD5 | raw file
 1<cfimport taglib="/cacheManagement/util/" prefix="cache" />
 2<html>
 3
 4	<head>
 5		
 6		<link type="text/css" href="/cacheManagement/examples/assets/style.css" rel="stylesheet" />
 7		<title>Cache Management Examples</title>
 8		
 9	</head>
10	
11	<body>
12	
13
14	<cfscript>
15	cm = getCacheManager();
16	
17	startTime = getTickCount();
18	
19	if( not cm.exists( 'Computer', 'myComposite' ) ){
20		
21		message = "set a cache";
22	
23		c = getFactory().createComputer();
24		
25		cm.add( 'Computer', 'myComposite', c );
26	
27	}else{
28	
29		for( f=1; f<=5; f++ ){
30		
31			for( i=1; i<=1; i++ ){
32		
33				c = cm.get( 'Computer', 'myComposite' );
34		
35			}
36			
37			sleep( 10 );
38		
39		}
40	
41		message = "get a cache";
42	
43	}
44	
45	endTime = getTickCount();
46	
47	totalExecution = endTime - startTime;
48	</cfscript>
49	
50	<div class="title">Basic examples</div>
51	
52	<p></p>
53	
54	<textarea cols="60" rows="5" class="code">
55	cm = getCacheManager();
56	
57	startTime = getTickCount();
58	
59	if( not cm.exists( 'Computer', 'myComposite' ) ){
60	
61		c = getFactory().createComputer();
62		
63		cm.add( 'Computer', 'myComposite', c );
64	
65	}else{
66	
67		c = cm.get( 'Computer', 'myComposite' );
68	
69	}
70	
71	endTime = getTickCount();
72	
73	totalExecution = endTime - startTime;
74	</textarea><br/>
75	
76	<br/>
77	<p>Command: <cfoutput>#message#</cfoutput>.</p>
78	<p>Total execution time: <cfoutput>#totalExecution#</cfoutput> ms</p>
79	
80	<a href="../../index.cfm">Back to home</a><br />
81	
82	<cache:monitor cacheManager="#cm#" />
83	</body>
84
85</html>