org.infinispan.server.websocket
Class ChannelUtils
java.lang.Object
org.infinispan.server.websocket.ChannelUtils
public class ChannelUtils
- extends Object
Channel Utilities.
- Author:
- tom.fennelly@gmail.com
Method Summary |
static void |
pushCacheValue(String key,
Cache<Object,Object> cache,
org.jboss.netty.channel.ChannelHandlerContext ctx)
Push a cache entry value out onto the websocket channel (to the browser). |
static org.json.JSONObject |
toJSON(String key,
Object value,
String cacheName)
Cache key, value and cache-name to JSON string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChannelUtils
public ChannelUtils()
pushCacheValue
public static void pushCacheValue(String key,
Cache<Object,Object> cache,
org.jboss.netty.channel.ChannelHandlerContext ctx)
throws org.json.JSONException
- Push a cache entry value out onto the websocket channel (to the browser).
- Parameters:
key
- The cache entry key whose value is to be pushed to the browser.cache
- The cache containing the key.ctx
- The channel context associated with the browser websocket channel..
- Throws:
org.json.JSONException
- Error generating JSON string.
toJSON
public static org.json.JSONObject toJSON(String key,
Object value,
String cacheName)
throws org.json.JSONException
- Cache key, value and cache-name to JSON string.
- Parameters:
key
- The cache key.value
- The cache value.cacheName
- The cache name.
- Returns:
- JSON Object representing a cache entry payload for transmission to the browser channel.
- Throws:
org.json.JSONException
- Error generating JSON string.
Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.