Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
668fa3ad
Commit
668fa3ad
authored
Jul 07, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.3.10 异常处理:泛化的抛出异常
parent
f14c8f9c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
7 deletions
+9
-7
DeviceServerHandler.java
.../java/iot/sixiang/license/device/DeviceServerHandler.java
+1
-1
ForwardClientHandler.java
...ava/iot/sixiang/license/forward/ForwardClientHandler.java
+1
-1
ForwardConnectionListener.java
...ot/sixiang/license/forward/ForwardConnectionListener.java
+1
-1
AuthenticationInterceptor.java
...va/iot/sixiang/license/jwt/AuthenticationInterceptor.java
+2
-2
BaseConnectionListener.java
.../java/iot/sixiang/license/net/BaseConnectionListener.java
+4
-2
No files found.
license/src/main/java/iot/sixiang/license/device/DeviceServerHandler.java
View file @
668fa3ad
...
...
@@ -111,7 +111,7 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
}
@Override
public
void
exceptionCaught
(
ChannelHandlerContext
ctx
,
Throwable
cause
)
throws
Exception
{
public
void
exceptionCaught
(
ChannelHandlerContext
ctx
,
Throwable
cause
)
throws
Exception
{
// TODO Auto-generated method stub
super
.
exceptionCaught
(
ctx
,
cause
);
log
.
debug
(
"设备服务器,exceptionCaught:{}"
,
ctx
.
channel
().
id
().
asLongText
());
...
...
license/src/main/java/iot/sixiang/license/forward/ForwardClientHandler.java
View file @
668fa3ad
...
...
@@ -94,7 +94,7 @@ public class ForwardClientHandler extends SimpleChannelInboundHandler<Object> {
}
@Override
public
synchronized
void
userEventTriggered
(
ChannelHandlerContext
ctx
,
Object
obj
)
throws
Exception
{
public
synchronized
void
userEventTriggered
(
ChannelHandlerContext
ctx
,
Object
obj
)
{
log
.
debug
(
"桥接客户端,userEventTriggered:{}"
,
ctx
.
channel
().
id
().
asLongText
());
}
...
...
license/src/main/java/iot/sixiang/license/forward/ForwardConnectionListener.java
View file @
668fa3ad
...
...
@@ -17,7 +17,7 @@ import lombok.extern.slf4j.Slf4j;
public
class
ForwardConnectionListener
extends
BaseConnectionListener
{
@Override
public
void
operationComplete
(
ChannelFuture
channelFuture
)
throws
Exception
{
public
void
operationComplete
(
ChannelFuture
channelFuture
)
{
AlarmService
alarmService
=
SpringUtil
.
getBean
(
AlarmService
.
class
);
if
(!
channelFuture
.
isSuccess
())
{
//TODO 失败进行告警
...
...
license/src/main/java/iot/sixiang/license/jwt/AuthenticationInterceptor.java
View file @
668fa3ad
...
...
@@ -21,14 +21,14 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
{
UserUtils
.
removeUser
();
UserUtils
.
removeUri
();
}
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
{
response
.
setHeader
(
"Set-Cookie"
,
"HttpOnly"
);
return
true
;
}
...
...
license/src/main/java/iot/sixiang/license/net/BaseConnectionListener.java
View file @
668fa3ad
...
...
@@ -3,16 +3,18 @@ package iot.sixiang.license.net;
import
io.netty.channel.ChannelFuture
;
import
io.netty.channel.ChannelFutureListener
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
@Data
@Slf4j
public
class
BaseConnectionListener
implements
ChannelFutureListener
{
public
String
appId
;
public
String
host
;
public
int
port
;
@Override
public
void
operationComplete
(
ChannelFuture
future
)
throws
Exception
{
public
void
operationComplete
(
ChannelFuture
future
)
{
// TODO Auto-generated method stub
System
.
out
.
println
(
"重写了operationComplete方法"
);
log
.
info
(
"重写了operationComplete方法"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment