Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<html>
	<head>
		<title>Infinispan Cache Query</title>
	</head>
	<body>
		<script type="text/javascript" src="http://localhost:61999/infinispan-ws.js" />
		<script type="text/javascript">
			<!--
            var customerCache = new Cache("customerCache");
	        customerCache.registerCallback(customerCacheCallback); 
	        customerCache.notify("*");
	        
	        var orderCache = new Cache("orderCache");
		    orderCache.registerCallback(orderCacheCallback); 
		    orderCache.notify("*");

			function customerCacheCallback(key, value) {
				alert("customer cache");
			}
			function orderCacheCallback(key, value) {
				var node = document.getElementById(key);				
				node.value = value;
			}
			-->
		</script>
		<form onsubmit="return false;">
		     <input type="text" id="ord" />
			 <input type="button" value="Put" onclick="orderCache.put('ord', this.form.ord.value)" />
			 <input type="button" value="Get" onclick="orderCache.get('ord')" />
			 <input type="button" value="Remove" onclick="orderCache.remove('ord')" />
			 <br/>
		     <input type="text" id="cust" />
			 <input type="button" value="Put" onclick="orderCache.put('cust', this.form.cust.value)" />
			 <input type="button" value="Get" onclick="orderCache.get('cust')" />
			 <input type="button" value="Remove" onclick="orderCache.remove('cust')" />
		</form>
	</body>
</html>
New to GrepCode? Check out our FAQ X