Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/MapAccess.java @ 5779:ebec12def170
Datacage: Add a pool of builders to make it multi threadable.
XML DOM is not thread safe. Therefore the old implementation only allowed one thread
to use the builder at a time. As the complexity of the configuration
has increased over time this has become a bottleneck of the whole application
because it took quiet some time to build a result. Furthermore the builder code path
is visited very frequent. So many concurrent requests were piled up
resulting in long waits for the users.
To mitigate this problem a round robin pool of builders is used now.
Each of the pooled builders has an independent copy of the XML template
and can be run in parallel.
The number of builders is determined by the system property
'flys.datacage.pool.size'. It defaults to 4.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 21 Apr 2013 12:48:09 +0200 |
parents | 6131b352e5e4 |
children |
rev | line source |
---|---|
5307
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.access; |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 import java.util.Arrays; |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 import java.util.List; |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 import de.intevation.artifacts.CallContext; |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.flys.artifacts.FLYSArtifact; |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 public class MapAccess |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 extends RangeAccess |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 { |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 public MapAccess(FLYSArtifact artifact, CallContext context) { |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 super(artifact, context); |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 } |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 public List<String> getHWS() { |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 String param = getString("uesk.hws"); |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 if (param != null) { |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 String[] split = param.split(";"); |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 return new ArrayList<String>(Arrays.asList(split)); |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 } |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 return new ArrayList<String>(); |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 } |
6131b352e5e4
Data structure and factory for hws.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 } |