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
0919747e
Commit
0919747e
authored
Jul 11, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
05ceebad
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
4 deletions
+14
-4
NamespaceLockAspect.java
...ramework/apollo/adminservice/aop/NamespaceLockAspect.java
+10
-0
ApolloConfigDemo.java
apollo-demo/src/main/java/ApolloConfigDemo.java
+1
-1
app.properties
apollo-demo/src/main/resources/META-INF/app.properties
+1
-1
ConfigNamespaceController.js
...ic/scripts/controller/config/ConfigNamespaceController.js
+2
-2
No files found.
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/aop/NamespaceLockAspect.java
View file @
0919747e
...
@@ -42,18 +42,28 @@ public class NamespaceLockAspect {
...
@@ -42,18 +42,28 @@ public class NamespaceLockAspect {
private
ApolloSwitcher
apolloSwitcher
;
private
ApolloSwitcher
apolloSwitcher
;
//create item
@Before
(
"@annotation(PreAcquireNamespaceLock) && args(appId, clusterName, namespaceName, item, ..)"
)
@Before
(
"@annotation(PreAcquireNamespaceLock) && args(appId, clusterName, namespaceName, item, ..)"
)
public
void
requireLockAdvice
(
String
appId
,
String
clusterName
,
String
namespaceName
,
public
void
requireLockAdvice
(
String
appId
,
String
clusterName
,
String
namespaceName
,
ItemDTO
item
)
{
ItemDTO
item
)
{
acquireLock
(
appId
,
clusterName
,
namespaceName
,
item
.
getDataChangeLastModifiedBy
());
acquireLock
(
appId
,
clusterName
,
namespaceName
,
item
.
getDataChangeLastModifiedBy
());
}
}
//create item
@Before
(
"@annotation(PreAcquireNamespaceLock) && args(appId, clusterName, namespaceName, itemId, item, ..)"
)
public
void
requireLockAdvice
(
String
appId
,
String
clusterName
,
String
namespaceName
,
long
itemId
,
ItemDTO
item
)
{
acquireLock
(
appId
,
clusterName
,
namespaceName
,
item
.
getDataChangeLastModifiedBy
());
}
//update by change set
@Before
(
"@annotation(PreAcquireNamespaceLock) && args(appId, clusterName, namespaceName, changeSet, ..)"
)
@Before
(
"@annotation(PreAcquireNamespaceLock) && args(appId, clusterName, namespaceName, changeSet, ..)"
)
public
void
requireLockAdvice
(
String
appId
,
String
clusterName
,
String
namespaceName
,
public
void
requireLockAdvice
(
String
appId
,
String
clusterName
,
String
namespaceName
,
ItemChangeSets
changeSet
)
{
ItemChangeSets
changeSet
)
{
acquireLock
(
appId
,
clusterName
,
namespaceName
,
changeSet
.
getDataChangeLastModifiedBy
());
acquireLock
(
appId
,
clusterName
,
namespaceName
,
changeSet
.
getDataChangeLastModifiedBy
());
}
}
//delete item
@Before
(
"@annotation(PreAcquireNamespaceLock) && args(itemId, operator, ..)"
)
@Before
(
"@annotation(PreAcquireNamespaceLock) && args(itemId, operator, ..)"
)
public
void
requireLockAdvice
(
long
itemId
,
String
operator
)
{
public
void
requireLockAdvice
(
long
itemId
,
String
operator
)
{
Item
item
=
itemService
.
findOne
(
itemId
);
Item
item
=
itemService
.
findOne
(
itemId
);
...
...
apollo-demo/src/main/java/ApolloConfigDemo.java
View file @
0919747e
...
@@ -21,7 +21,7 @@ public class ApolloConfigDemo {
...
@@ -21,7 +21,7 @@ public class ApolloConfigDemo {
private
Config
config
;
private
Config
config
;
public
ApolloConfigDemo
()
{
public
ApolloConfigDemo
()
{
config
=
ConfigService
.
get
AppConfig
(
);
config
=
ConfigService
.
get
Config
(
"testYYMMDD"
);
config
.
addChangeListener
(
new
ConfigChangeListener
()
{
config
.
addChangeListener
(
new
ConfigChangeListener
()
{
@Override
@Override
public
void
onChange
(
ConfigChangeEvent
changeEvent
)
{
public
void
onChange
(
ConfigChangeEvent
changeEvent
)
{
...
...
apollo-demo/src/main/resources/META-INF/app.properties
View file @
0919747e
# test
# test
app.id
=
100003173
app.id
=
test0711
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js
View file @
0919747e
...
@@ -276,8 +276,8 @@ application_module.controller("ConfigNamespaceController",
...
@@ -276,8 +276,8 @@ application_module.controller("ConfigNamespaceController",
}
}
function
lockCheck
(
namespace
)
{
function
lockCheck
(
namespace
)
{
if
(
namespace
.
lockOwner
&&
scope
.
currentUser
!=
namespace
.
lockOwner
)
{
if
(
namespace
.
lockOwner
&&
$
scope
.
currentUser
!=
namespace
.
lockOwner
)
{
scope
.
lockOwner
=
namespace
.
lockOwner
;
$
scope
.
lockOwner
=
namespace
.
lockOwner
;
$
(
'#namespaceLockedDialog'
).
modal
(
'show'
);
$
(
'#namespaceLockedDialog'
).
modal
(
'show'
);
return
false
;
return
false
;
}
}
...
...
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