cn.xishan.oftenporter.bridge.http.websocket.ClientWebSocket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Porter-Bridge-Http Show documentation
Show all versions of Porter-Bridge-Http Show documentation
转接远程的http接口,服务器响应正确的数据格式必须是JResponse定义的格式。
客户端websocket使用"org.java-websocket:Java-WebSocket:1.5.2",项目地址https://github.com/TooTallNate/Java-WebSocket;
对Java-WebSocket做了适当修改。
The newest version!
package cn.xishan.oftenporter.bridge.http.websocket;
import cn.xishan.oftenporter.porter.core.annotation.AspectOperationOfPortIn;
import java.lang.annotation.*;
/**
* @author Created by https://github.com/CLovinr on 2017/11/20.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
@Documented
@AspectOperationOfPortIn(handle = WSClientHandle.class)
public @interface ClientWebSocket
{
/**
* 支持返回消息的有:{@linkplain #ON_OPEN},{@linkplain #ON_MESSAGE},{@linkplain #ON_PONG},
* {@linkplain #ON_BINARY_BYTE_BUFFER}
*/
public enum Type
{
/**
* 需要返回{@linkplain WSClientConfig}配置。
*/
ON_CONFIG,
ON_OPEN, ON_MESSAGE,
ON_PONG,
ON_ERROR, ON_CLOSE,
ON_BINARY_BYTE_BUFFER
}
boolean autoStart() default true;
/**
* 自动开始的次数
*
* @return
*/
int startCount() default 1;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy