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
88d973f3
Commit
88d973f3
authored
May 18, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update client usage
parent
54c084f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
README.md
apollo-client/README.md
+4
-3
No files found.
apollo-client/README.md
View file @
88d973f3
...
...
@@ -12,7 +12,7 @@
Config
config
=
ConfigService
.
getAppConfig
();
String
someKey
=
"someKeyFromDefaultNamespace"
;
String
someDefaultValue
=
"someDefaultValueForTheKey"
;
System
.
out
.
println
(
config
.
getProperty
(
someKey
,
someDefaultValue
));
System
.
out
.
println
(
String
.
format
(
"Value for key %s is %s"
,
someKey
,
config
.
getProperty
(
someKey
,
someDefaultValue
)
));
```
### 2. Register config change listener
...
...
@@ -24,7 +24,7 @@ config.addChangeListener(new ConfigChangeListener() {
System
.
out
.
println
(
"Changes for namespace "
+
changeEvent
.
getNamespace
());
for
(
String
key
:
changeEvent
.
changedKeys
())
{
ConfigChange
change
=
changeEvent
.
getChange
(
key
);
System
.
out
.
println
(
String
.
format
(
"
C
hange - key: %s, oldValue: %s, newValue: %s, changeType: %s"
,
change
.
getPropertyName
(),
change
.
getOldValue
(),
change
.
getNewValue
(),
change
.
getChangeType
()));
System
.
out
.
println
(
String
.
format
(
"
Found c
hange - key: %s, oldValue: %s, newValue: %s, changeType: %s"
,
change
.
getPropertyName
(),
change
.
getOldValue
(),
change
.
getNewValue
(),
change
.
getChangeType
()));
}
}
});
...
...
@@ -36,5 +36,5 @@ String somePublicNamespace = "CAT";
Config
config
=
ConfigService
.
getConfig
(
somePublicNamespace
);
String
someKey
=
"someKeyFromPublicNamespace"
;
String
someDefaultValue
=
"someDefaultValueForTheKey"
;
System
.
out
.
println
(
config
.
getProperty
(
someKey
,
someDefaultValue
));
System
.
out
.
println
(
String
.
format
(
"Value for key %s is %s"
,
someKey
,
config
.
getProperty
(
someKey
,
someDefaultValue
)
));
```
\ 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