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
1de3455c
Commit
1de3455c
authored
Jun 22, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构XML
parent
b9305d9a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigurationLoader.java
+3
-3
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigurationSimulator.java
+1
-1
No files found.
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigurationLoader.java
View file @
1de3455c
...
@@ -22,16 +22,16 @@ public class DiscoveryConfigurationLoader extends AbstractConfigurationLoader {
...
@@ -22,16 +22,16 @@ public class DiscoveryConfigurationLoader extends AbstractConfigurationLoader {
@Override
@Override
public
InputStream
getRemoteInputStream
()
throws
IOException
{
public
InputStream
getRemoteInputStream
()
throws
IOException
{
// 本地文件模拟代替远程文件
// 本地文件模拟代替远程文件
return
getInputStream
(
"src/main/resources/
discovery
1.xml"
);
return
getInputStream
(
"src/main/resources/
plugin
1.xml"
);
}
}
@Override
@Override
protected
String
getLocalContextPath
()
{
protected
String
getLocalContextPath
()
{
// 配置文件放在resources目录下
// 配置文件放在resources目录下
return
"classpath:
discovery
1.xml"
;
return
"classpath:
plugin
1.xml"
;
// 配置文件放在工程根目录下
// 配置文件放在工程根目录下
// return "file:
discovery
1.xml";
// return "file:
plugin
1.xml";
}
}
private
InputStream
getInputStream
(
String
fileName
)
{
private
InputStream
getInputStream
(
String
fileName
)
{
...
...
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigurationSimulator.java
View file @
1de3455c
...
@@ -38,7 +38,7 @@ public class DiscoveryConfigurationSimulator {
...
@@ -38,7 +38,7 @@ public class DiscoveryConfigurationSimulator {
public
void
run
()
{
public
void
run
()
{
// 本地文件模拟代替远程文件,随机读取
// 本地文件模拟代替远程文件,随机读取
int
index
=
threadLocalRandom
.
nextInt
(
4
)
+
1
;
int
index
=
threadLocalRandom
.
nextInt
(
4
)
+
1
;
InputStream
inputStream
=
getInputStream
(
"src/main/resources/
discovery
"
+
index
+
".xml"
);
InputStream
inputStream
=
getInputStream
(
"src/main/resources/
plugin
"
+
index
+
".xml"
);
configurationPublisher
.
publish
(
inputStream
);
configurationPublisher
.
publish
(
inputStream
);
}
}
},
10000L
,
15000L
);
},
10000L
,
15000L
);
...
...
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