您的浏览器已禁用 JavaScript。
跳过导航链接
概览
程序包
类
树
已过时
索引
帮助
上一个
下一个
框架
无框架
所有类
A
B
C
D
E
G
I
J
L
M
N
O
P
R
S
T
W
A
Action
-
top.jfunc.websocket.redis.action
中的接口
要做的事情
ACTION
- 接口 中的静态变量top.jfunc.websocket.redis.action.
Action
ActionConfig
-
top.jfunc.websocket.redis.action
中的类
ActionConfig()
- 类 的构造器top.jfunc.websocket.redis.action.
ActionConfig
B
BaseWebSocketEndpoint
-
top.jfunc.websocket
中的类
写自己的Endpoint类,继承自此类,添加@ServerEndpoint、@Component注解, 然后在方法中添加@OnOpen、@OnMessage、@OnClose、@OnError即可,这些方法中可以调用父类方法
BaseWebSocketEndpoint()
- 类 的构造器top.jfunc.websocket.
BaseWebSocketEndpoint
broadcast(String)
- 类 中的方法top.jfunc.websocket.memory.
MemWebSocketManager
broadcast(String)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketManager
broadcast(String)
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
广播
BroadCastAction
-
top.jfunc.websocket.redis.action
中的类
{ "action":"broadcast", "message":"xxxxxxxxxxxxx" } 广播给所有的websocket发送消息 action
BroadCastAction()
- 类 的构造器top.jfunc.websocket.redis.action.
BroadCastAction
C
CHANNEL
- 类 中的静态变量top.jfunc.websocket.redis.
RedisWebSocketManager
check(WebSocketManager, long, int, TodoAtRemoved)
- 类 中的方法top.jfunc.websocket.config.
WebSocketHeartBeatChecker
定时检测 WebSocket 的心跳时间跟现在的间隔,超过设定的值说明失去了心跳,就去除他,并更新数据库 基于每次 WebSocket 的心跳都更新其心跳时间
cleanApplicationContext()
- 类 中的静态方法top.jfunc.websocket.utils.
SpringContextHolder
清除applicationContext静态变量.
connect(String, Session)
- 类 中的方法top.jfunc.websocket.
BaseWebSocketEndpoint
D
DefaultRedisReceiver
-
top.jfunc.websocket.redis
中的类
redis消息订阅者
DefaultRedisReceiver(CountDownLatch)
- 类 的构造器top.jfunc.websocket.redis.
DefaultRedisReceiver
disconnect(String)
- 类 中的方法top.jfunc.websocket.
BaseWebSocketEndpoint
doMessage(WebSocketManager, JSONObject)
- 接口 中的方法top.jfunc.websocket.redis.action.
Action
根据消息做自己的事情
doMessage(WebSocketManager, JSONObject)
- 类 中的方法top.jfunc.websocket.redis.action.
BroadCastAction
doMessage(WebSocketManager, JSONObject)
- 类 中的方法top.jfunc.websocket.redis.action.
NoActionAction
doMessage(WebSocketManager, JSONObject)
- 类 中的方法top.jfunc.websocket.redis.action.
RemoveAction
doMessage(WebSocketManager, JSONObject)
- 类 中的方法top.jfunc.websocket.redis.action.
SendMessageAction
E
EnableMemWebSocketManager
-
top.jfunc.websocket.memory
中的注释类型
EnableRedisWebSocketManager
-
top.jfunc.websocket.redis
中的注释类型
G
get(String)
- 类 中的方法top.jfunc.websocket.memory.
MemWebSocketManager
get(String)
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
根据标识获取websocket session
getApplicationContext()
- 类 中的静态方法top.jfunc.websocket.utils.
SpringContextHolder
取得存储在静态变量中的ApplicationContext.
getBean(String)
- 类 中的静态方法top.jfunc.websocket.utils.
SpringContextHolder
getBean(String, Class<T>)
- 类 中的静态方法top.jfunc.websocket.utils.
SpringContextHolder
从静态变量ApplicationContext中取得Bean, 自动转型为所赋值对象的类型.
getChannel()
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketManager
GetHttpSessionConfigurator
-
top.jfunc.websocket.config
中的类
在@ServerEndpoint注解里面添加configurator属性[@ServerEndpoint(value="/socketTest",configurator=GetHttpSessionConfigurator.class)] 可以在OnOpen中通过HttpSession.class.getName()获取到http session, 那么我们就可以使用session.getId()来作为标识 @OnOpen public void onOpen(Session session,EndpointConfig config) { HttpSession httpSession= (HttpSession) config.getUserProperties().get(HttpSession.class.getName()); sessionMap.put(session.getId(), session); } {@link https://blog.csdn.net/huangbaokang/article/details/77579151?
GetHttpSessionConfigurator()
- 类 的构造器top.jfunc.websocket.config.
GetHttpSessionConfigurator
getIdentifier()
- 类 中的方法top.jfunc.websocket.
WebSocket
getLastHeart()
- 类 中的方法top.jfunc.websocket.
WebSocket
getSession()
- 类 中的方法top.jfunc.websocket.
WebSocket
getWebSocketManager()
- 类 中的方法top.jfunc.websocket.
BaseWebSocketEndpoint
getWebSocketManager()
- 类 中的方法top.jfunc.websocket.redis.
DefaultRedisReceiver
I
IDENTIFIER
- 类 中的静态变量top.jfunc.websocket.
BaseWebSocketEndpoint
路径标识:目前使用token来代表
IDENTIFIER
- 接口 中的静态变量top.jfunc.websocket.redis.action.
Action
isJsonArray(String)
- 类 中的静态方法top.jfunc.websocket.utils.
JsonUtil
判断是否是JsonArray
isJsonObject(String)
- 类 中的静态方法top.jfunc.websocket.utils.
JsonUtil
判断是否是JsonObject
isPing(String, String)
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
在OnMessage中判断是否是心跳, 从客户端的消息判断是否是ping消息
J
JsonUtil
-
top.jfunc.websocket.utils
中的类
JsonUtil()
- 类 的构造器top.jfunc.websocket.utils.
JsonUtil
L
latch()
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketConfig
listenerAdapter(RedisReceiver)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketConfig
localWebSocketMap()
- 类 中的方法top.jfunc.websocket.memory.
MemWebSocketManager
localWebSocketMap()
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
获取当前机器上的保存的WebSocket
logger
- 类 中的静态变量top.jfunc.websocket.
BaseWebSocketEndpoint
M
MemoryWebSocketConfig
-
top.jfunc.websocket.memory
中的类
MemoryWebSocketConfig()
- 类 的构造器top.jfunc.websocket.memory.
MemoryWebSocketConfig
MemWebSocketManager
-
top.jfunc.websocket.memory
中的类
MemWebSocketManager()
- 类 的构造器top.jfunc.websocket.memory.
MemWebSocketManager
MESSAGE
- 接口 中的静态变量top.jfunc.websocket.redis.action.
Action
modifyHandshake(ServerEndpointConfig, HandshakeRequest, HandshakeResponse)
- 类 中的方法top.jfunc.websocket.config.
GetHttpSessionConfigurator
N
NoActionAction
-
top.jfunc.websocket.redis.action
中的类
do nothing action
NoActionAction()
- 类 的构造器top.jfunc.websocket.redis.action.
NoActionAction
O
onMessage(String, String)
- 类 中的方法top.jfunc.websocket.memory.
MemWebSocketManager
onMessage(String, String)
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
WebSocket接收到消息的函数调用
P
pong(String, String)
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
返回心跳信息
put(String, WebSocket)
- 类 中的方法top.jfunc.websocket.memory.
MemWebSocketManager
put(String, WebSocket)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketManager
put(String, WebSocket)
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
放入一个 websocket session
R
receiveMessage(String, String, Session)
- 类 中的方法top.jfunc.websocket.
BaseWebSocketEndpoint
receiveMessage(String)
- 类 中的方法top.jfunc.websocket.redis.
DefaultRedisReceiver
此方法会被反射调用
receiveMessage(String)
- 接口 中的方法top.jfunc.websocket.redis.
RedisReceiver
回调方法
receiver(CountDownLatch)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketConfig
RECEIVER_METHOD_NAME
- 接口 中的静态变量top.jfunc.websocket.redis.
RedisReceiver
redisMessageListenerContainer(RedisConnectionFactory, MessageListenerAdapter)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketConfig
RedisReceiver
-
top.jfunc.websocket.redis
中的接口
redis 接收器接口,主要目的是固定接口名字
RedisWebSocketConfig
-
top.jfunc.websocket.redis
中的类
RedisWebSocketConfig()
- 类 的构造器top.jfunc.websocket.redis.
RedisWebSocketConfig
RedisWebSocketManager
-
top.jfunc.websocket.redis
中的类
WebSocket的session无法序列化,所以session还是保存在本地内存中,发送消息这种就走订阅发布模式 1.redis或者mq进行发布订阅,广播->有某个节点能找到此人就发送消息,其他的忽略 2.Nginx进行IP hash 可以使用
MemWebSocketManager
3.需要扩展不同的功能,就写相应的Action,放入容器中,然后给订阅的频道发布一条包含该Action的JSON串
RedisWebSocketManager(StringRedisTemplate)
- 类 的构造器top.jfunc.websocket.redis.
RedisWebSocketManager
remove(String)
- 类 中的方法top.jfunc.websocket.memory.
MemWebSocketManager
remove(String)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketManager
remove(String)
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
删除
RemoveAction
-
top.jfunc.websocket.redis.action
中的类
{ "action":"remove", "identifier":"xxx" } 给webSocket发送消息的action
RemoveAction()
- 类 的构造器top.jfunc.websocket.redis.action.
RemoveAction
S
sendBytes(Session, byte[])
- 类 中的静态方法top.jfunc.websocket.utils.
WebSocketUtil
发送字节消息
sendBytesAsync(Session, byte[])
- 类 中的静态方法top.jfunc.websocket.utils.
WebSocketUtil
异步发送字节
sendMessage(String, String)
- 类 中的方法top.jfunc.websocket.memory.
MemWebSocketManager
sendMessage(String, String)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketManager
sendMessage(Session, String)
- 类 中的静态方法top.jfunc.websocket.utils.
WebSocketUtil
发送消息
sendMessage(String, String)
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
给某人发送消息
SendMessageAction
-
top.jfunc.websocket.redis.action
中的类
{ "action":"sendMessage", "identifier":"xxx", "message":"xxxxxxxxxxx" } 给webSocket发送消息的action
SendMessageAction()
- 类 的构造器top.jfunc.websocket.redis.action.
SendMessageAction
sendMessageAsync(Session, String)
- 类 中的静态方法top.jfunc.websocket.utils.
WebSocketUtil
异步发送消息
sendObject(Session, Object)
- 类 中的静态方法top.jfunc.websocket.utils.
WebSocketUtil
发送对象消息
sendObjectAsync(Session, Object)
- 类 中的静态方法top.jfunc.websocket.utils.
WebSocketUtil
异步发送对象
serializeJavaBean(Object)
- 类 中的静态方法top.jfunc.websocket.utils.
JsonUtil
将JavaBean序列化为字符串
serializeList(List<Object>)
- 类 中的静态方法top.jfunc.websocket.utils.
JsonUtil
将Map序列化为字符串
serializeMap(Map<String, Object>)
- 类 中的静态方法top.jfunc.websocket.utils.
JsonUtil
将Map序列化为字符串
setApplicationContext(ApplicationContext)
- 类 中的方法top.jfunc.websocket.utils.
SpringContextHolder
实现ApplicationContextAware接口的context注入函数, 将其存入静态变量.
setIdentifier(String)
- 类 中的方法top.jfunc.websocket.
WebSocket
setLastHeart(Date)
- 类 中的方法top.jfunc.websocket.
WebSocket
setSession(Session)
- 类 中的方法top.jfunc.websocket.
WebSocket
size()
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketManager
size()
- 接口 中的方法top.jfunc.websocket.
WebSocketManager
统计所有在线人数
springContextHolder()
- 类 中的方法top.jfunc.websocket.memory.
MemoryWebSocketConfig
applicationContext全局保存器
springContextHolder()
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketConfig
applicationContext全局保存器
SpringContextHolder
-
top.jfunc.websocket.utils
中的类
容器全局存留
SpringContextHolder()
- 类 的构造器top.jfunc.websocket.utils.
SpringContextHolder
stringRedisTemplate(RedisConnectionFactory)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketConfig
stringRedisTemplate
- 类 中的变量top.jfunc.websocket.redis.
RedisWebSocketManager
T
TodoAtRemove
-
top.jfunc.websocket
中的接口
已过时。
TodoAtRemoved
-
top.jfunc.websocket
中的接口
todoWith(WebSocket)
- 接口 中的方法top.jfunc.websocket.
TodoAtRemove
已过时。
在删除的时候额外要干什么
todoWith(List<WebSocket>)
- 接口 中的方法top.jfunc.websocket.
TodoAtRemoved
在删除的时候额外要干什么
top.jfunc.websocket
- 程序包 top.jfunc.websocket
top.jfunc.websocket.config
- 程序包 top.jfunc.websocket.config
top.jfunc.websocket.memory
- 程序包 top.jfunc.websocket.memory
top.jfunc.websocket.redis
- 程序包 top.jfunc.websocket.redis
top.jfunc.websocket.redis.action
- 程序包 top.jfunc.websocket.redis.action
top.jfunc.websocket.utils
- 程序包 top.jfunc.websocket.utils
W
WebSocket
-
top.jfunc.websocket
中的类
WebSocket()
- 类 的构造器top.jfunc.websocket.
WebSocket
WEBSOCKET_MANAGER_NAME
- 接口 中的静态变量top.jfunc.websocket.
WebSocketManager
在容器中的名字
WebSocketCloseEvent
-
top.jfunc.websocket
中的类
WebSocketCloseEvent(WebSocket)
- 类 的构造器top.jfunc.websocket.
WebSocketCloseEvent
WebSocketConnectEvent
-
top.jfunc.websocket
中的类
WebSocketConnectEvent(WebSocket)
- 类 的构造器top.jfunc.websocket.
WebSocketConnectEvent
WebSocketHeartBeatChecker
-
top.jfunc.websocket.config
中的类
WebSocketHeartBeatChecker()
- 类 的构造器top.jfunc.websocket.config.
WebSocketHeartBeatChecker
webSocketHeartBeatChecker()
- 类 中的方法top.jfunc.websocket.memory.
MemoryWebSocketConfig
webSocketHeartBeatChecker()
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketConfig
webSocketHeartCheckJob()
- 类 中的方法top.jfunc.websocket.config.
WebSocketSchedulingConfig
定时检测 WebSocket 的心跳
webSocketManager()
- 类 中的方法top.jfunc.websocket.memory.
MemoryWebSocketConfig
webSocketManager(StringRedisTemplate)
- 类 中的方法top.jfunc.websocket.redis.
RedisWebSocketConfig
WebSocketManager
-
top.jfunc.websocket
中的接口
管理websocket的session,可以使用Map,可以自己添加接口功能实现,并放到容器中 注意:放在容器中的名字必须是 WebSocketManager.WEBSOCKET_MANAGER_NAME 即:webSocketManager
WebSocketSchedulingConfig
-
top.jfunc.websocket.config
中的类
只需要配置一下三个选项即可开启心跳监测 webSocket.heartCheck.enabled=true webSocket.heartCheck.timeSpan=1000 webSocket.heartCheck.errorToleration=30
WebSocketSchedulingConfig()
- 类 的构造器top.jfunc.websocket.config.
WebSocketSchedulingConfig
WebSocketUtil
-
top.jfunc.websocket.utils
中的类
WebSocketUtil()
- 类 的构造器top.jfunc.websocket.utils.
WebSocketUtil
A
B
C
D
E
G
I
J
L
M
N
O
P
R
S
T
W
跳过导航链接
概览
程序包
类
树
已过时
索引
帮助
上一个
下一个
框架
无框架
所有类