public class ChannelUtils extends Object
Constructor and Description |
---|
ChannelUtils() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static void pushCacheValue(String key, Cache<Object,Object> cache, org.jboss.netty.channel.ChannelHandlerContext ctx) throws org.json.JSONException
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..org.json.JSONException
- Error generating JSON string.public static org.json.JSONObject toJSON(String key, Object value, String cacheName) throws org.json.JSONException
key
- The cache key.value
- The cache value.cacheName
- The cache name.org.json.JSONException
- Error generating JSON string.Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.