Skip to content

Commit

Permalink
3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
noear committed Oct 23, 2024
1 parent adbd11f commit 7b60f59
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.noear.solon.core.handle.Handler;
import org.noear.solon.net.stomp.*;
import org.noear.solon.net.stomp.broker.impl.StompBrokerMedia;
import org.noear.solon.net.stomp.listener.SimpleStompListener;
import org.noear.solon.net.stomp.listener.StompListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -32,7 +32,7 @@
* @author noear
* @since 3.0
*/
public class ForwardStompListener implements SimpleStompListener {
public class ForwardStompListener implements StompListener {
static final Logger log = LoggerFactory.getLogger(ForwardStompListener.class);

private final StompBrokerMedia brokerMedia;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,35 @@ public interface StompListener {
*
* @param session
*/
void onOpen(StompSession session);
default void onOpen(StompSession session) {

}

/**
* 收到消息帧
*
* @param session
* @param frame 帧
*/
void onFrame(StompSession session, Frame frame) throws Throwable;
default void onFrame(StompSession session, Frame frame) throws Throwable {

}

/**
* 连接关闭时(被动监听;当断开时触发)
*
* @param session
*/
void onClose(StompSession session);
default void onClose(StompSession session) {

}

/**
* 出错时
*
* @param session
*/
void onError(StompSession session, Throwable error);
default void onError(StompSession session, Throwable error) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.noear.solon.net.stomp.Message;
import org.noear.solon.net.stomp.StompSession;
import org.noear.solon.net.stomp.broker.StompBroker;
import org.noear.solon.net.stomp.listener.SimpleStompListener;
import org.noear.solon.net.stomp.listener.StompListener;

/**
* stomp server 必须
Expand All @@ -29,7 +29,7 @@
* @since 2.4
*/
@ServerEndpoint("/chat")
public class ChatStompBroker extends StompBroker implements SimpleStompListener {
public class ChatStompBroker extends StompBroker implements StompListener {
public ChatStompBroker() {
//此为示例,实际按需扩展
this.addListener(this);
Expand Down

0 comments on commit 7b60f59

Please sign in to comment.