Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!--
  ~ JBoss, Home of Professional Open Source
  ~ Copyright 2010 Red Hat Inc. and/or its affiliates and other
  ~ contributors as indicated by the @author tags. All rights reserved.
  ~ See the copyright.txt in the distribution for a full listing of
  ~ individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->
<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