@@ -54,11 +54,11 @@ public class URLConnectionLoaderService implements LoaderService {
5454 /**
5555 * The data resources managed by this instance.
5656 */
57- private final Map <String , LoadableResource > resources = new ConcurrentHashMap <>();
57+ private final Map <String , LoadableURLResource > resources = new ConcurrentHashMap <>();
5858 /**
5959 * The registered {@link LoaderListener} instances.
6060 */
61- private final DefaultLoaderListener listener = new DefaultLoaderListener ();
61+ private final URLConnectionLoaderListener listener = new URLConnectionLoaderListener ();
6262
6363 /**
6464 * The local resource cache, to allow keeping current data on the local
@@ -70,7 +70,7 @@ public class URLConnectionLoaderService implements LoaderService {
7070 */
7171 private final ExecutorService executors = Executors .newCachedThreadPool (DaemonThreadFactory .INSTANCE );
7272
73- private DefaultLoaderServiceFacade defaultLoaderServiceFacade ;
73+ private URLConnectionLoaderServiceFacade defaultLoaderServiceFacade ;
7474
7575 /**
7676 * The timer used for schedules.
@@ -96,7 +96,7 @@ void initialize() {
9696 }
9797 // (re)initialize
9898 LoaderConfigurator configurator = LoaderConfigurator .of (this );
99- defaultLoaderServiceFacade = new DefaultLoaderServiceFacade (timer , listener , resources );
99+ defaultLoaderServiceFacade = new URLConnectionLoaderServiceFacade (timer , listener , resources );
100100 configurator .load ();
101101 }
102102
@@ -108,10 +108,10 @@ void initialize() {
108108 private static ResourceCache loadResourceCache () {
109109 try {
110110 return Optional .ofNullable (Bootstrap .getService (ResourceCache .class )).orElseGet (
111- DefaultResourceCache ::new );
111+ URLConnectionResourceCache ::new );
112112 } catch (Exception e ) {
113113 LOG .log (Level .SEVERE , "Error loading ResourceCache instance." , e );
114- return new DefaultResourceCache ();
114+ return new URLConnectionResourceCache ();
115115 }
116116 }
117117
@@ -130,7 +130,7 @@ static ResourceCache getResourceCache() {
130130 * @param resourceId the resource id.
131131 */
132132 public void unload (String resourceId ) {
133- LoadableResource res = this .resources .get (resourceId );
133+ LoadableURLResource res = this .resources .get (resourceId );
134134 if (Objects .nonNull (res )) {
135135 res .unload ();
136136 }
@@ -151,7 +151,7 @@ public void registerData(LoadDataInformation loadDataInformation) {
151151 throw new IllegalArgumentException ("Resource : " + loadDataInformation .getResourceId () + " already registered." );
152152 }
153153
154- LoadableResource resource = new LoadableResourceBuilder ()
154+ LoadableURLResource resource = new LoadableResourceBuilder ()
155155 .withCache (CACHE ).withLoadDataInformation (loadDataInformation )
156156 .build ();
157157 this .resources .put (loadDataInformation .getResourceId (), resource );
@@ -211,7 +211,7 @@ public void registerData(String resourceId, UpdatePolicy updatePolicy, Map<Strin
211211 .withResourceLocations (resourceLocations )
212212 .build ();
213213
214- LoadableResource resource = new LoadableResourceBuilder ()
214+ LoadableURLResource resource = new LoadableResourceBuilder ()
215215 .withCache (CACHE ).withLoadDataInformation (loadInfo )
216216 .build ();
217217 this .resources .put (loadInfo .getResourceId (), resource );
@@ -232,7 +232,7 @@ public void registerData(String resourceId, UpdatePolicy updatePolicy, Map<Strin
232232
233233 @ Override
234234 public Map <String , String > getUpdateConfiguration (String resourceId ) {
235- LoadableResource load = this .resources .get (resourceId );
235+ LoadableURLResource load = this .resources .get (resourceId );
236236 if (Objects .nonNull (load )) {
237237 return load .getProperties ();
238238 }
@@ -251,7 +251,7 @@ public Set<String> getResourceIds() {
251251
252252 @ Override
253253 public InputStream getData (String resourceId ) throws IOException {
254- LoadableResource load = this .resources .get (resourceId );
254+ LoadableURLResource load = this .resources .get (resourceId );
255255 if (Objects .nonNull (load )) {
256256 return load .getDataStream ();
257257 }
@@ -276,7 +276,7 @@ public boolean loadDataLocal(String resourceId) {
276276
277277 @ Override
278278 public void resetData (String resourceId ) throws IOException {
279- LoadableResource load = Optional .ofNullable (this .resources .get (resourceId ))
279+ LoadableURLResource load = Optional .ofNullable (this .resources .get (resourceId ))
280280 .orElseThrow (() -> new IllegalArgumentException ("No such resource: " + resourceId ));
281281 if (load .resetToFallback ()) {
282282 listener .trigger (resourceId , load );
@@ -319,7 +319,7 @@ public void removeLoaderListener(LoaderListener loadListener, String... resource
319319
320320 @ Override
321321 public UpdatePolicy getUpdatePolicy (String resourceId ) {
322- LoadableResource load = Optional .of (this .resources .get (resourceId ))
322+ LoadableURLResource load = Optional .of (this .resources .get (resourceId ))
323323 .orElseThrow (() -> new IllegalArgumentException ("No such resource: " + resourceId ));
324324 return load .getUpdatePolicy ();
325325 }
0 commit comments