Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a480516f
authored
Apr 17, 2015
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change mapqueue to concurrentHashmap
1 parent
71dd6834
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/QueueBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/QueueBean.java
View file @
a480516
...
...
@@ -47,11 +47,10 @@ public class QueueBean implements QueueBeanLocal {
* Default constructor.
*/
public
QueueBean
()
{
mapqueues
=
new
HashMap
<>();
logger
.
info
(
"Initialized2 QueueBean, {}"
,
mapqueues
);
}
private
final
Map
<
Integer
,
MapQueue
>
mapqueues
;
private
final
ConcurrentHashMap
<
Integer
,
MapQueue
>
mapqueues
=
new
ConcurrentHashMap
<
Integer
,
QueueBean
.
MapQueue
>()
;
private
int
defaultTimeoutMin
=
10
;
private
int
minimumSlotsInQueue
=
1
;
private
int
reservingSize
=
5
;
...
...
@@ -297,11 +296,7 @@ public class QueueBean implements QueueBeanLocal {
MapQueue
ret
=
mapqueues
.
get
(
map
.
getId
());
if
(
ret
==
null
)
{
logger
.
info
(
"getMapqueue, {}"
,
mapqueues
);
synchronized
(
mapqueues
)
{
ret
=
new
MapQueue
();
mapqueues
.
put
(
map
.
getId
(),
ret
);
}
ret
=
mapqueues
.
putIfAbsent
(
map
.
getId
(),
new
MapQueue
());
}
logger
.
info
(
"returning queue {} for map {}"
,
ret
,
map
);
return
ret
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment