Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢捷峰
discovery
Commits
ce17ec18
Commit
ce17ec18
authored
Jul 15, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化事件机制
parent
fafa773c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/event/PluginEventWapper.java
+5
-0
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/listener/BasicListener.java
+3
-2
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/listener/register/CountFilterRegisterListener.java
+1
-1
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/listener/register/HostFilterRegisterListener.java
+1
-1
No files found.
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/event/PluginEventWapper.java
View file @
ce17ec18
...
...
@@ -41,4 +41,8 @@ public class PluginEventWapper {
pluginSubscriber
.
onVersionCleared
(
versionClearedEvent
);
}
}
public
void
fireRegisterFailure
(
RegisterFailureEvent
registerFailureEvent
)
{
pluginPublisher
.
asyncPublish
(
registerFailureEvent
);
}
}
\ No newline at end of file
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/listener/BasicListener.java
View file @
ce17ec18
...
...
@@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
com.nepxion.discovery.plugin.framework.adapter.PluginAdapter
;
import
com.nepxion.discovery.plugin.framework.cache.RuleCache
;
import
com.nepxion.discovery.plugin.framework.context.PluginContextAware
;
import
com.nepxion.discovery.plugin.framework.event.Plugin
Publish
er
;
import
com.nepxion.discovery.plugin.framework.event.Plugin
EventWapp
er
;
public
class
BasicListener
implements
Listener
{
@Autowired
...
...
@@ -27,5 +27,5 @@ public class BasicListener implements Listener {
protected
PluginAdapter
pluginAdapter
;
@Autowired
protected
Plugin
Publisher
pluginPublish
er
;
protected
Plugin
EventWapper
pluginEventWapp
er
;
}
\ No newline at end of file
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/listener/register/CountFilterRegisterListener.java
View file @
ce17ec18
...
...
@@ -78,7 +78,7 @@ public class CountFilterRegisterListener extends AbstractRegisterListener {
Boolean
registerFailureEventEnabled
=
pluginContextAware
.
getEnvironment
().
getProperty
(
PluginConstant
.
SPRING_APPLICATION_REGISTER_FAILURE_EVENT_ENABLED
,
Boolean
.
class
,
Boolean
.
FALSE
);
if
(
registerFailureEventEnabled
)
{
plugin
Publisher
.
asyncPublish
(
new
RegisterFailureEvent
(
PluginConstant
.
REACH_MAX_LIMITED_COUNT
,
description
,
serviceId
,
host
,
port
));
plugin
EventWapper
.
fireRegisterFailure
(
new
RegisterFailureEvent
(
PluginConstant
.
REACH_MAX_LIMITED_COUNT
,
description
,
serviceId
,
host
,
port
));
}
throw
new
PluginException
(
description
);
...
...
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/listener/register/HostFilterRegisterListener.java
View file @
ce17ec18
...
...
@@ -102,7 +102,7 @@ public class HostFilterRegisterListener extends AbstractRegisterListener {
Boolean
registerFailureEventEnabled
=
pluginContextAware
.
getEnvironment
().
getProperty
(
PluginConstant
.
SPRING_APPLICATION_REGISTER_FAILURE_EVENT_ENABLED
,
Boolean
.
class
,
Boolean
.
FALSE
);
if
(
registerFailureEventEnabled
)
{
plugin
Publisher
.
asyncPublish
(
new
RegisterFailureEvent
(
filterType
.
toString
(),
description
,
serviceId
,
host
,
port
));
plugin
EventWapper
.
fireRegisterFailure
(
new
RegisterFailureEvent
(
filterType
.
toString
(),
description
,
serviceId
,
host
,
port
));
}
throw
new
PluginException
(
description
);
...
...
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