Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Move RefreshConfigTask under tasks"
[nonrtric.git]
/
policy-agent
/
src
/
main
/
java
/
org
/
oransc
/
policyagent
/
repository
/
Rics.java
diff --git
a/policy-agent/src/main/java/org/oransc/policyagent/repository/Rics.java
b/policy-agent/src/main/java/org/oransc/policyagent/repository/Rics.java
index
6b8138f
..
bdf9930
100644
(file)
--- a/
policy-agent/src/main/java/org/oransc/policyagent/repository/Rics.java
+++ b/
policy-agent/src/main/java/org/oransc/policyagent/repository/Rics.java
@@
-20,7
+20,6
@@
package org.oransc.policyagent.repository;
package org.oransc.policyagent.repository;
-import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.HashMap;
import java.util.Map;
@@
-36,11
+35,11
@@
public class Rics {
rics.put(ric.name(), ric);
}
rics.put(ric.name(), ric);
}
- public
Collection
<Ric> getRics() {
+ public
synchronized Iterable
<Ric> getRics() {
return rics.values();
}
return rics.values();
}
- public Ric getRic(String name) throws ServiceException {
+ public
synchronized
Ric getRic(String name) throws ServiceException {
Ric ric = rics.get(name);
if (ric == null) {
throw new ServiceException("Could not find ric: " + name);
Ric ric = rics.get(name);
if (ric == null) {
throw new ServiceException("Could not find ric: " + name);
@@
-48,15
+47,19
@@
public class Rics {
return ric;
}
return ric;
}
- public Ric get(String name) {
+ public
synchronized
Ric get(String name) {
return rics.get(name);
}
return rics.get(name);
}
- public int size() {
+ public synchronized void remove(String name) {
+ rics.remove(name);
+ }
+
+ public synchronized int size() {
return rics.size();
}
return rics.size();
}
- public void clear() {
+ public
synchronized
void clear() {
this.rics.clear();
}
}
this.rics.clear();
}
}