@@ -63,7 +63,7 @@ public class MechanicalTsarApplication extends Application<MechanicalTsarConfigu
6363 * The application-wide map that contains stages. Since it is convenient to preserve the database
6464 * row order, it is implemented as a <tt>LinkedHashMap</tt>.
6565 */
66- private final Map <String , Stage > processes = new LinkedHashMap <>();
66+ private final Map <String , Stage > stages = new LinkedHashMap <>();
6767
6868 private DBI jdbi ;
6969 private ServiceLocator locator ;
@@ -82,7 +82,7 @@ public ServiceLocator getLocator() {
8282 }
8383
8484 public Map <String , Stage > getStages () {
85- return processes ;
85+ return stages ;
8686 }
8787
8888 @ Override
@@ -105,24 +105,24 @@ public void initialize(Bootstrap<MechanicalTsarConfiguration> bootstrap) {
105105 }
106106
107107 private void bootstrap (MechanicalTsarConfiguration configuration , Environment environment ) throws ClassNotFoundException {
108- synchronized (processes ) {
108+ synchronized (stages ) {
109109 if (jdbi == null )
110110 jdbi = new DBIFactory ().build (environment , configuration .getDataSourceFactory (), "postgresql" );
111111
112112 if (locator == null )
113- locator = Injections .createLocator (new ApplicationBinder (jdbi , processes ));
113+ locator = Injections .createLocator (new ApplicationBinder (jdbi , stages ));
114114
115115 final StageDAO stageDAO = requireNonNull (locator .getService (StageDAO .class ));
116116 final List <Stage .Definition > definitions = stageDAO .select ();
117- processes .clear ();
117+ stages .clear ();
118118
119119 for (final Stage .Definition definition : definitions ) {
120120 final Class <? extends WorkerRanker > workerRankerClass = Class .forName (definition .getWorkerRanker ()).asSubclass (WorkerRanker .class );
121121 final Class <? extends TaskAllocator > taskAllocatorClass = Class .forName (definition .getTaskAllocator ()).asSubclass (TaskAllocator .class );
122122 final Class <? extends AnswerAggregator > answerAggregatorClass = Class .forName (definition .getAnswerAggregator ()).asSubclass (AnswerAggregator .class );
123123 final ServiceLocator processLocator = Injections .createLocator (locator , new StageBinder (definition , workerRankerClass , taskAllocatorClass , answerAggregatorClass ));
124124 final Stage stage = requireNonNull (processLocator .getService (Stage .class ));
125- processes .put (definition .getId (), stage );
125+ stages .put (definition .getId (), stage );
126126 }
127127 }
128128 }
0 commit comments