Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
344595aa
Commit
344595aa
authored
Jul 25, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version upgrade to 0.0.6 and refactor apollo-demo
parent
4c29c113
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
46 additions
and
66 deletions
+46
-66
pom.xml
apollo-adminservice/pom.xml
+1
-1
pom.xml
apollo-assembly/pom.xml
+1
-1
pom.xml
apollo-biz/pom.xml
+1
-1
pom.xml
apollo-buildtools/pom.xml
+1
-1
README.md
apollo-client/README.md
+1
-1
pom.xml
apollo-client/pom.xml
+1
-1
pom.xml
apollo-common/pom.xml
+1
-1
pom.xml
apollo-configservice/pom.xml
+1
-1
pom.xml
apollo-core/pom.xml
+1
-1
pom.xml
apollo-demo/pom.xml
+1
-1
ApolloConfigDemo.java
apollo-demo/src/main/java/ApolloConfigDemo.java
+34
-0
ApolloConfigFileDemo.java
apollo-demo/src/main/java/ApolloConfigFileDemo.java
+0
-54
pom.xml
apollo-portal/pom.xml
+1
-1
pom.xml
pom.xml
+1
-1
No files found.
apollo-adminservice/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-assembly/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-biz/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-biz
</artifactId>
<artifactId>
apollo-biz
</artifactId>
...
...
apollo-buildtools/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-client/README.md
View file @
344595aa
...
@@ -88,7 +88,7 @@ If you need this functionality, you could specify the cluster as follows:
...
@@ -88,7 +88,7 @@ If you need this functionality, you could specify the cluster as follows:
<dependency>
<dependency>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo-client
</artifactId>
<artifactId>
apollo-client
</artifactId>
<version>
0.0.
5
</version>
<version>
0.0.
6
</version>
</dependency>
</dependency>
## III. Client Usage
## III. Client Usage
...
...
apollo-client/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-common/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-configservice/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-core/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-demo/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-demo
</artifactId>
<artifactId>
apollo-demo
</artifactId>
...
...
apollo-demo/src/main/java/ApolloConfigDemo.java
View file @
344595aa
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigChangeListener
;
import
com.ctrip.framework.apollo.ConfigChangeListener
;
import
com.ctrip.framework.apollo.ConfigFile
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.core.enums.ConfigFileFormat
;
import
com.ctrip.framework.apollo.model.ConfigChange
;
import
com.ctrip.framework.apollo.model.ConfigChange
;
import
com.ctrip.framework.apollo.model.ConfigChangeEvent
;
import
com.ctrip.framework.apollo.model.ConfigChangeEvent
;
...
@@ -19,6 +21,8 @@ public class ApolloConfigDemo {
...
@@ -19,6 +21,8 @@ public class ApolloConfigDemo {
private
String
DEFAULT_VALUE
=
"undefined"
;
private
String
DEFAULT_VALUE
=
"undefined"
;
private
Config
config
;
private
Config
config
;
private
Config
publicConfig
;
private
Config
publicConfig
;
private
ConfigFile
applicationConfigFile
;
private
ConfigFile
xmlConfigFile
;
public
ApolloConfigDemo
()
{
public
ApolloConfigDemo
()
{
ConfigChangeListener
changeListener
=
new
ConfigChangeListener
()
{
ConfigChangeListener
changeListener
=
new
ConfigChangeListener
()
{
...
@@ -37,6 +41,8 @@ public class ApolloConfigDemo {
...
@@ -37,6 +41,8 @@ public class ApolloConfigDemo {
config
.
addChangeListener
(
changeListener
);
config
.
addChangeListener
(
changeListener
);
publicConfig
=
ConfigService
.
getConfig
(
"FX.apollo"
);
publicConfig
=
ConfigService
.
getConfig
(
"FX.apollo"
);
publicConfig
.
addChangeListener
(
changeListener
);
publicConfig
.
addChangeListener
(
changeListener
);
applicationConfigFile
=
ConfigService
.
getConfigFile
(
"application"
,
ConfigFileFormat
.
Properties
);
xmlConfigFile
=
ConfigService
.
getConfigFile
(
"datasources"
,
ConfigFileFormat
.
XML
);
}
}
private
String
getConfig
(
String
key
)
{
private
String
getConfig
(
String
key
)
{
...
@@ -48,6 +54,26 @@ public class ApolloConfigDemo {
...
@@ -48,6 +54,26 @@ public class ApolloConfigDemo {
return
result
;
return
result
;
}
}
private
void
print
(
String
namespace
)
{
switch
(
namespace
)
{
case
"application"
:
print
(
applicationConfigFile
);
return
;
case
"xml"
:
print
(
xmlConfigFile
);
return
;
}
}
private
void
print
(
ConfigFile
configFile
)
{
if
(!
configFile
.
hasContent
())
{
System
.
out
.
println
(
"No config file content found for "
+
configFile
.
getNamespace
());
return
;
}
System
.
out
.
println
(
"=== Config File Content for "
+
configFile
.
getNamespace
()
+
" is as follows: "
);
System
.
out
.
println
(
configFile
.
getContent
());
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
ApolloConfigDemo
apolloConfigDemo
=
new
ApolloConfigDemo
();
ApolloConfigDemo
apolloConfigDemo
=
new
ApolloConfigDemo
();
System
.
out
.
println
(
System
.
out
.
println
(
...
@@ -59,6 +85,14 @@ public class ApolloConfigDemo {
...
@@ -59,6 +85,14 @@ public class ApolloConfigDemo {
continue
;
continue
;
}
}
input
=
input
.
trim
();
input
=
input
.
trim
();
if
(
input
.
equalsIgnoreCase
(
"application"
))
{
apolloConfigDemo
.
print
(
"application"
);
continue
;
}
if
(
input
.
equalsIgnoreCase
(
"xml"
))
{
apolloConfigDemo
.
print
(
"xml"
);
continue
;
}
if
(
input
.
equalsIgnoreCase
(
"quit"
))
{
if
(
input
.
equalsIgnoreCase
(
"quit"
))
{
System
.
exit
(
0
);
System
.
exit
(
0
);
}
}
...
...
apollo-demo/src/main/java/ApolloConfigFileDemo.java
deleted
100644 → 0
View file @
4c29c113
import
com.ctrip.framework.apollo.ConfigFile
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.core.enums.ConfigFileFormat
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.StringReader
;
import
java.util.Properties
;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public
class
ApolloConfigFileDemo
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApolloConfigDemo
.
class
);
private
ConfigFile
configFile
;
private
String
namespace
=
"application"
;
public
ApolloConfigFileDemo
()
{
configFile
=
ConfigService
.
getConfigFile
(
namespace
,
ConfigFileFormat
.
Properties
);
}
private
void
print
()
{
if
(!
configFile
.
hasContent
())
{
System
.
out
.
println
(
"No config file content found for "
+
namespace
);
return
;
}
System
.
out
.
println
(
"=== Config File Content for "
+
namespace
+
" is as follows: "
);
System
.
out
.
println
(
configFile
.
getContent
());
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
ApolloConfigFileDemo
apolloConfigFileDemo
=
new
ApolloConfigFileDemo
();
System
.
out
.
println
(
"Apollo Config File Demo. Please input print to get the config file content."
);
while
(
true
)
{
System
.
out
.
print
(
"> "
);
String
input
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
)).
readLine
();
if
(
input
==
null
||
input
.
length
()
==
0
)
{
continue
;
}
input
=
input
.
trim
();
if
(
input
.
equalsIgnoreCase
(
"print"
))
{
apolloConfigFileDemo
.
print
();
}
if
(
input
.
equalsIgnoreCase
(
"quit"
))
{
System
.
exit
(
0
);
}
}
}
}
apollo-portal/pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
pom.xml
View file @
344595aa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.6
-SNAPSHOT
</version>
<version>
0.0.6
</version>
<name>
Apollo
</name>
<name>
Apollo
</name>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<description>
Ctrip Configuration Center
</description>
<description>
Ctrip Configuration Center
</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