2020-01-31 18:47:39 +00:00
|
|
|
const ChannelInboundHandlerAdapter = Java.type('io.netty.channel.ChannelInboundHandlerAdapter')
|
|
|
|
|
2020-03-21 07:47:42 +00:00
|
|
|
export abstract class WebSocketHandlerAdapter {
|
2020-01-31 18:47:39 +00:00
|
|
|
private _Handler;
|
|
|
|
constructor() {
|
2020-03-21 07:47:42 +00:00
|
|
|
let ChannelInboundHandlerAdapterImpl = Java.extend(ChannelInboundHandlerAdapter, {
|
2020-03-31 06:53:23 +00:00
|
|
|
channelRead: this.channelRead.bind(this),
|
|
|
|
exceptionCaught: this.exceptionCaught.bind(this)
|
2020-01-31 18:47:39 +00:00
|
|
|
})
|
2020-03-21 07:47:42 +00:00
|
|
|
this._Handler = new ChannelInboundHandlerAdapterImpl()
|
2020-01-31 18:47:39 +00:00
|
|
|
}
|
2020-03-21 07:47:42 +00:00
|
|
|
abstract channelRead(ctx: any, channel: any);
|
2020-03-31 06:53:23 +00:00
|
|
|
abstract exceptionCaught(ctx: any, cause: Error);
|
2020-01-31 18:47:39 +00:00
|
|
|
getHandler() {
|
|
|
|
return this._Handler;
|
|
|
|
}
|
|
|
|
}
|