@@ -129,7 +129,9 @@ public SplitFactoryImpl(String apiToken, SplitClientConfig config) throws URISyn
129
129
_splitFetcher = buildSplitFetcher ();
130
130
131
131
// SplitSynchronizationTask
132
- _splitSynchronizationTask = new SplitSynchronizationTask (_splitFetcher , _splitCache , findPollingPeriod (RANDOM , config .featuresRefreshRate ()));
132
+ _splitSynchronizationTask = new SplitSynchronizationTask (_splitFetcher ,
133
+ _splitCache ,
134
+ findPollingPeriod (RANDOM , config .featuresRefreshRate ()));
133
135
134
136
// Impressions
135
137
_impressionsManager = buildImpressionsManager (config );
@@ -138,27 +140,52 @@ public SplitFactoryImpl(String apiToken, SplitClientConfig config) throws URISyn
138
140
_cachedFireAndForgetMetrics = buildCachedFireAndForgetMetrics (config );
139
141
140
142
// EventClient
141
- _eventClient = EventClientImpl .create (_httpclient , _eventsRootTarget , config .eventsQueueSize (), config .eventFlushIntervalInMillis (), config .waitBeforeShutdown ());
143
+ _eventClient = EventClientImpl .create (_httpclient ,
144
+ _eventsRootTarget ,
145
+ config .eventsQueueSize (),
146
+ config .eventFlushIntervalInMillis (),
147
+ config .waitBeforeShutdown ());
142
148
143
149
// SyncManager
144
- _syncManager = SyncManagerImp .build (config .streamingEnabled (), _splitSynchronizationTask , _splitFetcher , _segmentSynchronizationTaskImp , _splitCache , config .authServiceURL (), _httpclient , config .streamingServiceURL (), config .authRetryBackoffBase (), buildSSEdHttpClient (config ), _segmentCache , config .streamingRetryDelay ());
150
+ _syncManager = SyncManagerImp .build (config .streamingEnabled (),
151
+ _splitSynchronizationTask ,
152
+ _splitFetcher ,
153
+ _segmentSynchronizationTaskImp ,
154
+ _splitCache ,
155
+ config .authServiceURL (),
156
+ _httpclient ,
157
+ config .streamingServiceURL (),
158
+ config .authRetryBackoffBase (),
159
+ buildSSEdHttpClient (config ),
160
+ _segmentCache ,
161
+ config .streamingRetryDelay (),
162
+ config .cdnDebugLogging ());
145
163
_syncManager .start ();
146
164
147
165
// Evaluator
148
166
_evaluator = new EvaluatorImp (_splitCache );
149
167
150
168
// SplitClient
151
- _client = new SplitClientImpl (this , _splitCache , _impressionsManager , _cachedFireAndForgetMetrics , _eventClient , config , _gates , _evaluator );
169
+ _client = new SplitClientImpl (this ,
170
+ _splitCache ,
171
+ _impressionsManager ,
172
+ _cachedFireAndForgetMetrics ,
173
+ _eventClient ,
174
+ config ,
175
+ _gates ,
176
+ _evaluator );
152
177
153
178
// SplitManager
154
179
_manager = new SplitManagerImpl (_splitCache , config , _gates );
155
180
156
181
// DestroyOnShutDown
157
182
if (config .destroyOnShutDown ()) {
158
- Runtime . getRuntime (). addShutdownHook ( new Thread (() -> {
183
+ Thread shutdown = new Thread (() -> {
159
184
// Using the full path to avoid conflicting with Thread.destroy()
160
185
SplitFactoryImpl .this .destroy ();
161
- }));
186
+ });
187
+ shutdown .setName ("split-destroy-worker" );
188
+ Runtime .getRuntime ().addShutdownHook (shutdown );
162
189
}
163
190
}
164
191
@@ -207,7 +234,6 @@ public boolean isDestroyed() {
207
234
}
208
235
209
236
private static CloseableHttpClient buildHttpClient (String apiToken , SplitClientConfig config ) {
210
-
211
237
SSLConnectionSocketFactory sslSocketFactory = SSLConnectionSocketFactoryBuilder .create ()
212
238
.setSslContext (SSLContexts .createSystemDefault ())
213
239
.setTlsVersions (TLS .V_1_1 , TLS .V_1_2 )
0 commit comments