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
efa84db2
Commit
efa84db2
authored
Mar 31, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add non-spring-client support and added a demo for it
parent
46d6e00e
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
432 additions
and
31 deletions
+432
-31
pom.xml
apollo-client/pom.xml
+0
-4
ApolloConfigManager.java
...ain/java/com/ctrip/apollo/client/ApolloConfigManager.java
+5
-2
ApolloEnvironment.java
.../main/java/com/ctrip/apollo/client/ApolloEnvironment.java
+72
-0
ApolloEnvironmentManager.java
...ava/com/ctrip/apollo/client/ApolloEnvironmentManager.java
+75
-0
AllTests.java
...lient/src/test/java/com/ctrip/apollo/client/AllTests.java
+1
-1
ApolloEnvironmentManagerTest.java
...com/ctrip/apollo/client/ApolloEnvironmentManagerTest.java
+81
-0
ApolloEnvironmentTest.java
...t/java/com/ctrip/apollo/client/ApolloEnvironmentTest.java
+75
-0
pom.xml
apollo-demo/pom.xml
+7
-24
ApolloConfigDemo.java
apollo-demo/src/main/java/ApolloConfigDemo.java
+37
-0
pom.xml
apollo-spring-demo/pom.xml
+56
-0
AppConfig.java
...g-demo/src/main/java/com/ctrip/apollo/demo/AppConfig.java
+0
-0
WebConfig.java
...g-demo/src/main/java/com/ctrip/apollo/demo/WebConfig.java
+0
-0
DemoController.java
...java/com/ctrip/apollo/demo/controller/DemoController.java
+0
-0
RestExceptionHandler.java
...com/ctrip/apollo/demo/exception/RestExceptionHandler.java
+0
-0
Config.java
...emo/src/main/java/com/ctrip/apollo/demo/model/Config.java
+0
-0
ErrorResult.java
...rc/main/java/com/ctrip/apollo/demo/model/ErrorResult.java
+0
-0
DemoService.java
.../main/java/com/ctrip/apollo/demo/service/DemoService.java
+0
-0
apollo.properties
apollo-spring-demo/src/main/resources/apollo.properties
+3
-0
application.properties
apollo-spring-demo/src/main/resources/application.properties
+0
-0
log4j2.xml
apollo-spring-demo/src/main/resources/log4j2.xml
+19
-0
urlrewrite.xml
apollo-spring-demo/src/main/webapp/WEB-INF/urlrewrite.xml
+0
-0
welcome.jsp
apollo-spring-demo/src/main/webapp/WEB-INF/views/welcome.jsp
+0
-0
web.xml
apollo-spring-demo/src/main/webapp/WEB-INF/web.xml
+0
-0
angular-toastr-1.4.1.tpls.min.js
...rc/main/webapp/s/scripts/angular-toastr-1.4.1.tpls.min.js
+0
-0
app.js
apollo-spring-demo/src/main/webapp/s/scripts/app.js
+0
-0
http.js
apollo-spring-demo/src/main/webapp/s/scripts/http.js
+0
-0
loading-bar.min.js
...-spring-demo/src/main/webapp/s/scripts/loading-bar.min.js
+0
-0
ui-bootstrap-0.13.0.min.js
...demo/src/main/webapp/s/scripts/ui-bootstrap-0.13.0.min.js
+0
-0
ui-bootstrap-tpls-0.13.0.min.js
...src/main/webapp/s/scripts/ui-bootstrap-tpls-0.13.0.min.js
+0
-0
angular-toastr-1.4.1.min.css
...emo/src/main/webapp/s/styles/angular-toastr-1.4.1.min.css
+0
-0
app.css
apollo-spring-demo/src/main/webapp/s/styles/app.css
+0
-0
loading-bar.min.css
...-spring-demo/src/main/webapp/s/styles/loading-bar.min.css
+0
-0
list.html
apollo-spring-demo/src/main/webapp/s/templates/list.html
+0
-0
pom.xml
pom.xml
+1
-0
No files found.
apollo-client/pom.xml
View file @
efa84db2
...
...
@@ -23,10 +23,6 @@
<!-- spring -->
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
</dependency>
<dependency>
...
...
apollo-client/src/main/java/com/ctrip/apollo/client/ApolloConfigManager.java
View file @
efa84db2
...
...
@@ -31,7 +31,8 @@ import java.util.concurrent.ScheduledExecutorService;
import
java.util.concurrent.atomic.AtomicReference
;
/**
* Client side config manager
* Apollo Config for Spring Application
* Requires Spring 3.1+
*
* @author Jason Song(song_s@ctrip.com)
*/
...
...
@@ -57,7 +58,7 @@ public class ApolloConfigManager
this
.
configLoaderManager
=
ConfigLoaderFactory
.
getInstance
().
getConfigLoaderManager
();
this
.
configUtil
=
ConfigUtil
.
getInstance
();
executorService
=
Executors
.
newScheduledThreadPool
(
1
,
ApolloThreadFactory
.
create
(
"ConfigManager"
,
true
));
Executors
.
newScheduledThreadPool
(
1
,
ApolloThreadFactory
.
create
(
"
Apollo
ConfigManager"
,
true
));
}
@Override
...
...
@@ -135,6 +136,8 @@ public class ApolloConfigManager
}
void
schedulePeriodicRefresh
()
{
logger
.
info
(
"Schedule periodic refresh with interval: {} {}"
,
configUtil
.
getRefreshInterval
(),
configUtil
.
getRefreshTimeUnit
());
executorService
.
scheduleAtFixedRate
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
apollo-client/src/main/java/com/ctrip/apollo/client/ApolloEnvironment.java
0 → 100644
View file @
efa84db2
package
com
.
ctrip
.
apollo
.
client
;
import
com.ctrip.apollo.client.model.PropertyChange
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.core.env.CompositePropertySource
;
import
java.util.List
;
/**
* Apollo config for non-Spring application
*
* @author Jason Song(song_s@ctrip.com)
*/
public
class
ApolloEnvironment
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApolloEnvironment
.
class
);
private
static
ApolloEnvironment
instance
=
new
ApolloEnvironment
();
private
volatile
CompositePropertySource
propertySource
;
private
ApolloEnvironmentManager
apolloEnvironmentManager
;
private
ApolloEnvironment
()
{
apolloEnvironmentManager
=
new
ApolloEnvironmentManager
(
this
);
}
public
void
init
()
{
this
.
apolloEnvironmentManager
.
init
();
}
public
static
ApolloEnvironment
getInstance
()
{
return
instance
;
}
/**
* Return the property value with the given key, or {@code null}
* if the key doesn't exist.
*
* @param key the property name
* @return the property value
*/
public
String
getProperty
(
String
key
)
{
if
(
this
.
propertySource
==
null
)
{
throw
new
IllegalStateException
(
"ApolloEnvironment not initialized, please call ApolloEnvironment.init() first"
);
}
Object
value
=
this
.
propertySource
.
getProperty
(
key
);
if
(
value
==
null
)
{
return
null
;
}
return
(
String
)
value
;
}
/**
* Return the property value with the given key, or
* {@code defaultValue} if the key doesn't exist.
*/
public
String
getProperty
(
String
key
,
String
defaultValue
)
{
String
value
=
getProperty
(
key
);
return
value
==
null
?
defaultValue
:
value
;
}
void
updatePropertySource
(
CompositePropertySource
propertySource
)
{
this
.
propertySource
=
propertySource
;
}
void
updatePropertySource
(
CompositePropertySource
propertySource
,
List
<
PropertyChange
>
changes
)
{
this
.
updatePropertySource
(
propertySource
);
//TODO broadcast changes
}
}
apollo-client/src/main/java/com/ctrip/apollo/client/ApolloEnvironmentManager.java
0 → 100644
View file @
efa84db2
package
com
.
ctrip
.
apollo
.
client
;
import
com.ctrip.apollo.client.loader.ConfigLoaderFactory
;
import
com.ctrip.apollo.client.loader.ConfigLoaderManager
;
import
com.ctrip.apollo.client.model.PropertySourceReloadResult
;
import
com.ctrip.apollo.client.util.ConfigUtil
;
import
com.ctrip.apollo.core.utils.ApolloThreadFactory
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.atomic.AtomicBoolean
;
/**
* @author Jason Song(song_s@ctrip.com)
*/
class
ApolloEnvironmentManager
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApolloEnvironmentManager
.
class
);
private
ConfigLoaderManager
configLoaderManager
;
private
ConfigUtil
configUtil
;
private
ScheduledExecutorService
executorService
;
private
ApolloEnvironment
apolloEnvironment
;
private
AtomicBoolean
initDone
;
ApolloEnvironmentManager
(
ApolloEnvironment
apolloEnvironment
)
{
this
.
apolloEnvironment
=
apolloEnvironment
;
this
.
configLoaderManager
=
ConfigLoaderFactory
.
getInstance
().
getConfigLoaderManager
();
this
.
configUtil
=
ConfigUtil
.
getInstance
();
this
.
executorService
=
Executors
.
newScheduledThreadPool
(
1
,
ApolloThreadFactory
.
create
(
"ApolloEnvironmentManager"
,
true
));
this
.
initDone
=
new
AtomicBoolean
();
}
synchronized
void
init
()
{
if
(
initDone
.
get
())
{
logger
.
warn
(
"ApolloEnvironmentManager init already done"
);
return
;
}
this
.
apolloEnvironment
.
updatePropertySource
(
this
.
configLoaderManager
.
loadPropertySource
());
this
.
schedulePeriodicRefresh
();
initDone
.
set
(
true
);
}
void
schedulePeriodicRefresh
()
{
logger
.
info
(
"Schedule periodic refresh with interval: {} {}"
,
configUtil
.
getRefreshInterval
(),
configUtil
.
getRefreshTimeUnit
());
this
.
executorService
.
scheduleAtFixedRate
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
updatePropertySource
();
}
catch
(
Throwable
ex
)
{
logger
.
error
(
"Refreshing config failed"
,
ex
);
}
}
},
configUtil
.
getRefreshInterval
(),
configUtil
.
getRefreshInterval
(),
configUtil
.
getRefreshTimeUnit
());
}
void
updatePropertySource
()
{
PropertySourceReloadResult
result
=
this
.
configLoaderManager
.
reloadPropertySource
();
if
(
result
.
hasChanges
())
{
logger
.
info
(
"Found changes, refresh environment."
);
this
.
apolloEnvironment
.
updatePropertySource
(
result
.
getPropertySource
(),
result
.
getChanges
());
}
}
}
apollo-client/src/test/java/com/ctrip/apollo/client/AllTests.java
View file @
efa84db2
...
...
@@ -11,7 +11,7 @@ import org.junit.runners.Suite.SuiteClasses;
@RunWith
(
Suite
.
class
)
@SuiteClasses
({
ApolloConfigManagerTest
.
class
,
ConfigLoaderManagerTest
.
class
,
RemoteConfigLoaderTest
.
class
,
ConfigUtilTest
.
class
ConfigUtilTest
.
class
,
ApolloEnvironmentTest
.
class
,
ApolloEnvironmentManagerTest
.
class
})
public
class
AllTests
{
...
...
apollo-client/src/test/java/com/ctrip/apollo/client/ApolloEnvironmentManagerTest.java
0 → 100644
View file @
efa84db2
package
com
.
ctrip
.
apollo
.
client
;
import
com.google.common.collect.Lists
;
import
com.ctrip.apollo.client.loader.ConfigLoaderManager
;
import
com.ctrip.apollo.client.model.PropertyChange
;
import
com.ctrip.apollo.client.model.PropertySourceReloadResult
;
import
com.ctrip.apollo.client.util.ConfigUtil
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Mock
;
import
org.mockito.runners.MockitoJUnitRunner
;
import
org.springframework.core.env.CompositePropertySource
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
spy
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@RunWith
(
MockitoJUnitRunner
.
class
)
public
class
ApolloEnvironmentManagerTest
{
private
ApolloEnvironmentManager
apolloEnvironmentManager
;
@Mock
private
ConfigLoaderManager
configLoaderManager
;
@Mock
private
ConfigUtil
configUtil
;
@Mock
private
ApolloEnvironment
apolloEnvironment
;
@Before
public
void
setUp
()
throws
Exception
{
apolloEnvironmentManager
=
spy
(
new
ApolloEnvironmentManager
(
apolloEnvironment
));
ReflectionTestUtils
.
setField
(
apolloEnvironmentManager
,
"configLoaderManager"
,
configLoaderManager
);
ReflectionTestUtils
.
setField
(
apolloEnvironmentManager
,
"configUtil"
,
configUtil
);
int
someInterval
=
1
;
TimeUnit
someUnit
=
TimeUnit
.
MINUTES
;
when
(
configUtil
.
getRefreshInterval
()).
thenReturn
(
someInterval
);
when
(
configUtil
.
getRefreshTimeUnit
()).
thenReturn
(
someUnit
);
}
@Test
public
void
testInit
()
throws
Exception
{
CompositePropertySource
somePropertySource
=
mock
(
CompositePropertySource
.
class
);
when
(
configLoaderManager
.
loadPropertySource
()).
thenReturn
(
somePropertySource
);
apolloEnvironmentManager
.
init
();
verify
(
configLoaderManager
,
times
(
1
)).
loadPropertySource
();
verify
(
apolloEnvironment
,
times
(
1
)).
updatePropertySource
(
somePropertySource
);
}
@Test
public
void
testUpdatePropertySource
()
throws
Exception
{
PropertySourceReloadResult
someResult
=
mock
(
PropertySourceReloadResult
.
class
);
CompositePropertySource
somePropertySource
=
mock
(
CompositePropertySource
.
class
);
List
<
PropertyChange
>
someChanges
=
Lists
.
newArrayList
();
when
(
someResult
.
hasChanges
()).
thenReturn
(
true
);
when
(
someResult
.
getPropertySource
()).
thenReturn
(
somePropertySource
);
when
(
someResult
.
getChanges
()).
thenReturn
(
someChanges
);
when
(
configLoaderManager
.
reloadPropertySource
()).
thenReturn
(
someResult
);
apolloEnvironmentManager
.
updatePropertySource
();
verify
(
configLoaderManager
,
times
(
1
)).
reloadPropertySource
();
verify
(
apolloEnvironment
,
times
(
1
)).
updatePropertySource
(
somePropertySource
,
someChanges
);
}
}
apollo-client/src/test/java/com/ctrip/apollo/client/ApolloEnvironmentTest.java
0 → 100644
View file @
efa84db2
package
com
.
ctrip
.
apollo
.
client
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Mock
;
import
org.mockito.runners.MockitoJUnitRunner
;
import
org.springframework.core.env.CompositePropertySource
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
spy
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@RunWith
(
MockitoJUnitRunner
.
class
)
public
class
ApolloEnvironmentTest
{
private
ApolloEnvironment
apolloEnvironment
;
@Mock
private
ApolloEnvironmentManager
apolloEnvironmentManager
;
@Before
public
void
setUp
()
throws
Exception
{
apolloEnvironment
=
spy
(
ApolloEnvironment
.
getInstance
());
ReflectionTestUtils
.
setField
(
apolloEnvironment
,
"apolloEnvironmentManager"
,
apolloEnvironmentManager
);
}
@Test
public
void
testInit
()
throws
Exception
{
apolloEnvironment
.
init
();
verify
(
apolloEnvironmentManager
,
times
(
1
)).
init
();
}
@Test
public
void
testGetProperty
()
throws
Exception
{
CompositePropertySource
somePropertySource
=
mock
(
CompositePropertySource
.
class
);
String
someKey
=
"someKey"
;
String
someValue
=
"someValue"
;
apolloEnvironment
.
updatePropertySource
(
somePropertySource
);
when
(
somePropertySource
.
getProperty
(
someKey
)).
thenReturn
(
someValue
);
String
result
=
apolloEnvironment
.
getProperty
(
someKey
);
assertEquals
(
someValue
,
result
);
}
@Test
public
void
testGetPropertyWithDefaultValue
()
throws
Exception
{
CompositePropertySource
somePropertySource
=
mock
(
CompositePropertySource
.
class
);
String
someKey
=
"someKey"
;
String
someDefaultValue
=
"someDefault"
;
apolloEnvironment
.
updatePropertySource
(
somePropertySource
);
when
(
somePropertySource
.
getProperty
(
someKey
)).
thenReturn
(
null
);
String
result
=
apolloEnvironment
.
getProperty
(
someKey
,
someDefaultValue
);
assertEquals
(
someDefaultValue
,
result
);
}
@Test
(
expected
=
IllegalStateException
.
class
)
public
void
testGetPropertyWithNoPropertySource
()
throws
Exception
{
String
someKey
=
"someKey"
;
apolloEnvironment
.
getProperty
(
someKey
);
}
}
apollo-demo/pom.xml
View file @
efa84db2
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.apollo
</groupId>
...
...
@@ -7,9 +9,8 @@
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-demo
</artifactId>
<packaging>
war
</packaging>
<name>
Apollo Demo
</name>
<
url>
http://maven.apache.org
</url
>
<
packaging>
jar
</packaging
>
<dependencies>
<dependency>
<groupId>
com.ctrip.apollo
</groupId>
...
...
@@ -17,23 +18,6 @@
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<dependency>
<groupId>
org.tuckey
</groupId>
<artifactId>
urlrewritefilter
</artifactId>
<version>
4.0.4
</version>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
jstl
</artifactId>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
</dependency>
...
...
@@ -50,7 +34,6 @@
<artifactId>
commons-logging
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
apollo-demo
</finalName>
</build>
</project>
apollo-demo/src/main/java/ApolloConfigDemo.java
0 → 100644
View file @
efa84db2
import
com.ctrip.apollo.client.ApolloEnvironment
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public
class
ApolloConfigDemo
{
private
ApolloEnvironment
env
;
public
ApolloConfigDemo
()
{
env
=
ApolloEnvironment
.
getInstance
();
env
.
init
();
}
private
String
getConfig
(
String
key
)
{
String
result
=
env
.
getProperty
(
key
,
"undefined"
);
System
.
out
.
println
(
String
.
format
(
"Loading key: %s with value: %s"
,
key
,
result
));
return
result
;
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
ApolloConfigDemo
apolloConfigDemo
=
new
ApolloConfigDemo
();
System
.
out
.
println
(
"Apollo Config Demo. Please input key to get the value."
);
while
(
true
)
{
System
.
out
.
print
(
"> "
);
String
input
=
(
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
)).
readLine
()).
trim
();
if
(
input
.
equalsIgnoreCase
(
"quit"
))
{
System
.
exit
(
0
);
}
apolloConfigDemo
.
getConfig
(
input
);
}
}
}
apollo-spring-demo/pom.xml
0 → 100644
View file @
efa84db2
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.apollo
</groupId>
<version>
0.0.1-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-spring-demo
</artifactId>
<packaging>
war
</packaging>
<name>
Apollo Spring Demo
</name>
<url>
http://maven.apache.org
</url>
<dependencies>
<dependency>
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo-client
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<dependency>
<groupId>
org.tuckey
</groupId>
<artifactId>
urlrewritefilter
</artifactId>
<version>
4.0.4
</version>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
jstl
</artifactId>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-slf4j-impl
</artifactId>
</dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
apollo-spring-demo
</finalName>
</build>
</project>
apollo-demo/src/main/java/com/ctrip/apollo/demo/AppConfig.java
→
apollo-
spring-
demo/src/main/java/com/ctrip/apollo/demo/AppConfig.java
View file @
efa84db2
File moved
apollo-demo/src/main/java/com/ctrip/apollo/demo/WebConfig.java
→
apollo-
spring-
demo/src/main/java/com/ctrip/apollo/demo/WebConfig.java
View file @
efa84db2
File moved
apollo-demo/src/main/java/com/ctrip/apollo/demo/controller/DemoController.java
→
apollo-
spring-
demo/src/main/java/com/ctrip/apollo/demo/controller/DemoController.java
View file @
efa84db2
File moved
apollo-demo/src/main/java/com/ctrip/apollo/demo/exception/RestExceptionHandler.java
→
apollo-
spring-
demo/src/main/java/com/ctrip/apollo/demo/exception/RestExceptionHandler.java
View file @
efa84db2
File moved
apollo-demo/src/main/java/com/ctrip/apollo/demo/model/Config.java
→
apollo-
spring-
demo/src/main/java/com/ctrip/apollo/demo/model/Config.java
View file @
efa84db2
File moved
apollo-demo/src/main/java/com/ctrip/apollo/demo/model/ErrorResult.java
→
apollo-
spring-
demo/src/main/java/com/ctrip/apollo/demo/model/ErrorResult.java
View file @
efa84db2
File moved
apollo-demo/src/main/java/com/ctrip/apollo/demo/service/DemoService.java
→
apollo-
spring-
demo/src/main/java/com/ctrip/apollo/demo/service/DemoService.java
View file @
efa84db2
File moved
apollo-spring-demo/src/main/resources/apollo.properties
0 → 100644
View file @
efa84db2
app.id
=
102
version
=
1.0
env
=
dev
apollo-demo/src/main/resources/application.properties
→
apollo-
spring-
demo/src/main/resources/application.properties
View file @
efa84db2
File moved
apollo-spring-demo/src/main/resources/log4j2.xml
0 → 100644
View file @
efa84db2
<?xml version="1.0" encoding="UTF-8"?>
<configuration
monitorInterval=
"60"
>
<appenders>
<Console
name=
"Console"
target=
"SYSTEM_OUT"
>
<PatternLayout
pattern=
"[apollo-demo][%t]%d %-5p [%c] %m%n"
/>
</Console>
<Async
name=
"Async"
includeLocation=
"true"
>
<AppenderRef
ref=
"Console"
/>
</Async>
</appenders>
<loggers>
<logger
name=
"com.ctrip.apollo"
additivity=
"false"
level=
"trace"
>
<AppenderRef
ref=
"Async"
level=
"DEBUG"
/>
</logger>
<root
level=
"INFO"
>
<AppenderRef
ref=
"Async"
/>
</root>
</loggers>
</configuration>
apollo-demo/src/main/webapp/WEB-INF/urlrewrite.xml
→
apollo-
spring-
demo/src/main/webapp/WEB-INF/urlrewrite.xml
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/WEB-INF/views/welcome.jsp
→
apollo-
spring-
demo/src/main/webapp/WEB-INF/views/welcome.jsp
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/WEB-INF/web.xml
→
apollo-
spring-
demo/src/main/webapp/WEB-INF/web.xml
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/scripts/angular-toastr-1.4.1.tpls.min.js
→
apollo-
spring-
demo/src/main/webapp/s/scripts/angular-toastr-1.4.1.tpls.min.js
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/scripts/app.js
→
apollo-
spring-
demo/src/main/webapp/s/scripts/app.js
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/scripts/http.js
→
apollo-
spring-
demo/src/main/webapp/s/scripts/http.js
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/scripts/loading-bar.min.js
→
apollo-
spring-
demo/src/main/webapp/s/scripts/loading-bar.min.js
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/scripts/ui-bootstrap-0.13.0.min.js
→
apollo-
spring-
demo/src/main/webapp/s/scripts/ui-bootstrap-0.13.0.min.js
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/scripts/ui-bootstrap-tpls-0.13.0.min.js
→
apollo-
spring-
demo/src/main/webapp/s/scripts/ui-bootstrap-tpls-0.13.0.min.js
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/styles/angular-toastr-1.4.1.min.css
→
apollo-
spring-
demo/src/main/webapp/s/styles/angular-toastr-1.4.1.min.css
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/styles/app.css
→
apollo-
spring-
demo/src/main/webapp/s/styles/app.css
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/styles/loading-bar.min.css
→
apollo-
spring-
demo/src/main/webapp/s/styles/loading-bar.min.css
View file @
efa84db2
File moved
apollo-demo/src/main/webapp/s/templates/list.html
→
apollo-
spring-
demo/src/main/webapp/s/templates/list.html
View file @
efa84db2
File moved
pom.xml
View file @
efa84db2
...
...
@@ -93,6 +93,7 @@
<module>
apollo-configservice
</module>
<module>
apollo-adminservice
</module>
<module>
apollo-portal
</module>
<module>
apollo-spring-demo
</module>
<module>
apollo-demo
</module>
</modules>
...
...
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