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
449ffcb8
Commit
449ffcb8
authored
Jun 01, 2019
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改AbstractDiscoveryEnabledStrategy抽象类,基于Header进行自定义路由更加方便
parent
e18d3b89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
discovery-plugin-strategy/src/main/java/com/nepxion/discovery/plugin/strategy/adapter/AbstractDiscoveryEnabledStrategy.java
+17
-10
No files found.
discovery-plugin-strategy/src/main/java/com/nepxion/discovery/plugin/strategy/adapter/AbstractDiscoveryEnabledStrategy.java
View file @
449ffcb8
...
@@ -9,31 +9,37 @@ package com.nepxion.discovery.plugin.strategy.adapter;
...
@@ -9,31 +9,37 @@ package com.nepxion.discovery.plugin.strategy.adapter;
* @version 1.0
* @version 1.0
*/
*/
import
java.util.Map
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.nepxion.discovery.plugin.framework.adapter.PluginAdapter
;
import
com.nepxion.discovery.plugin.framework.context.PluginContextAware
;
import
com.nepxion.discovery.plugin.framework.context.PluginContextAware
;
import
com.nepxion.discovery.plugin.strategy.context.StrategyContextHolder
;
import
com.nepxion.discovery.plugin.strategy.context.StrategyContextHolder
;
import
com.netflix.loadbalancer.Server
;
public
abstract
class
AbstractDiscoveryEnabledStrategy
implements
DiscoveryEnabledStrategy
{
public
abstract
class
AbstractDiscoveryEnabledStrategy
implements
DiscoveryEnabledStrategy
{
private
StrategyContextHolder
strategyContextHolder
;
@Autowired
protected
PluginContextAware
pluginContextAware
;
@Autowired
@Autowired
private
PluginContextAware
pluginContextAware
;
protected
PluginAdapter
pluginAdapter
;
protected
StrategyContextHolder
strategyContextHolder
;
@PostConstruct
@PostConstruct
p
ublic
void
initialize
()
{
p
rivate
void
initialize
()
{
strategyContextHolder
=
pluginContextAware
.
getBean
(
StrategyContextHolder
.
class
);
strategyContextHolder
=
pluginContextAware
.
getBean
(
StrategyContextHolder
.
class
);
}
}
@Override
public
PluginContextAware
getPluginContextAware
()
{
public
boolean
apply
(
Server
server
,
Map
<
String
,
String
>
metadata
)
{
return
pluginContextAware
;
return
apply
(
server
,
metadata
,
strategyContextHolder
);
}
}
public
abstract
boolean
apply
(
Server
server
,
Map
<
String
,
String
>
metadata
,
StrategyContextHolder
strategyContextHolder
);
public
PluginAdapter
getPluginAdapter
()
{
return
pluginAdapter
;
}
public
StrategyContextHolder
getStrategyContextHolder
()
{
return
strategyContextHolder
;
}
}
}
\ No newline at end of file
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