File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1313 * @author baltzell
1414 */
1515public class RCDBProvider {
16+
17+ public static class RCDBManager {
18+ HashMap <Integer ,RCDBConstants > cache = new HashMap <>();
19+ RCDBProvider provider = new RCDBProvider ();
20+ public synchronized RCDBConstants getConstants (int run ) {
21+ if (!cache .containsKey (run )) {
22+ cache .put (run , provider .getConstants (run ));
23+ }
24+ return cache .get (run );
25+ }
26+ public Double getTorusScale (int run ) {
27+ return getConstants (run ).getDouble ("torus_scale" );
28+ }
29+ public Double getSolenoidScale (int run ) {
30+ return getConstants (run ).getDouble ("solenoid_scale" );
31+ }
32+ }
33+
1634 public static Logger LOGGER = Logger .getLogger (RCDBProvider .class .getName ());
1735
1836 public static final String DEFAULTADDRESS =
"mysql://[email protected] /rcdb" ;
You can’t perform that action at this time.
0 commit comments