Skip to content

Commit 819f2e8

Browse files
committed
Working on #353
1 parent 88fa85c commit 819f2e8

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/LoadableHttpResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2012, 2023, Werner Keil and others by the @author tag.
2+
Copyright (c) 2023, 2024, Werner Keil and others by the @author tag.
33
44
Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
use this file except in compliance with the License. You may obtain a copy of

moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/LoadableHttpResourceBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2012, 2015, Credit Suisse (Anatole Tresch), Werner Keil and others by the @author tag.
2+
Copyright (c) 2023, 2024, Werner Keil and others by the @author tag.
33
44
Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
use this file except in compliance with the License. You may obtain a copy of

moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/HttpConnectionLoaderService.java renamed to moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/OkHttpLoaderService.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
* @author Werner Keil
4141
*/
4242
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
43-
public class HttpConnectionLoaderService implements LoaderService {
43+
public class OkHttpLoaderService implements LoaderService {
4444
/**
4545
* Logger used.
4646
*/
47-
private static final Logger LOG = Logger.getLogger(HttpConnectionLoaderService.class.getName());
47+
private static final Logger LOG = Logger.getLogger(OkHttpLoaderService.class.getName());
4848
/**
4949
* The data resources managed by this instance.
5050
*/
@@ -64,7 +64,7 @@ public class HttpConnectionLoaderService implements LoaderService {
6464
*/
6565
private final ExecutorService executors = Executors.newCachedThreadPool(DaemonThreadFactory.INSTANCE);
6666

67-
private HttpConnectionLoaderServiceFacade defaultLoaderServiceFacade;
67+
private OkHttpLoaderServiceFacade defaultLoaderServiceFacade;
6868

6969
/**
7070
* The timer used for schedules.
@@ -74,7 +74,7 @@ public class HttpConnectionLoaderService implements LoaderService {
7474
/**
7575
* Constructor, initializing from config.
7676
*/
77-
public HttpConnectionLoaderService() {
77+
public OkHttpLoaderService() {
7878
initialize();
7979
}
8080

@@ -90,7 +90,7 @@ void initialize() {
9090
}
9191
// (re)initialize
9292
LoaderConfigurator configurator = LoaderConfigurator.of(this);
93-
defaultLoaderServiceFacade = new HttpConnectionLoaderServiceFacade(timer, listener, resources);
93+
defaultLoaderServiceFacade = new OkHttpLoaderServiceFacade(timer, listener, resources);
9494
configurator.load();
9595
}
9696

@@ -102,10 +102,10 @@ void initialize() {
102102
private static ResourceCache loadResourceCache() {
103103
try {
104104
return Optional.ofNullable(Bootstrap.getService(ResourceCache.class)).orElseGet(
105-
HttpConnectionResourceCache::new);
105+
OkHttpResourceCache::new);
106106
} catch (Exception e) {
107107
LOG.log(Level.SEVERE, "Error loading ResourceCache instance.", e);
108-
return new HttpConnectionResourceCache();
108+
return new OkHttpResourceCache();
109109
}
110110
}
111111

@@ -115,7 +115,7 @@ private static ResourceCache loadResourceCache() {
115115
* @return the resource cache, not null.
116116
*/
117117
static ResourceCache getResourceCache() {
118-
return HttpConnectionLoaderService.CACHE;
118+
return OkHttpLoaderService.CACHE;
119119
}
120120

121121
/**

moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/HttpConnectionLoaderServiceFacade.java renamed to moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/OkHttpLoaderServiceFacade.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
import java.util.Map;
2121
import java.util.Timer;
2222

23-
class HttpConnectionLoaderServiceFacade {
23+
class OkHttpLoaderServiceFacade {
2424

25-
private final ScheduledHttpDataService scheduledDataLoaderService;
25+
private final OkHttpScheduler scheduledDataLoaderService;
2626

2727
private final HttpLoadDataService loadDataLoaderService;
2828

2929
private final HttpLoadLocalDataService loadDataLocalLoaderService;
3030

3131
private final HttpLoadRemoteDataService loadRemoteDataLoaderService;
3232

33-
HttpConnectionLoaderServiceFacade(Timer timer, ConnectionLoaderListener listener, Map<String, LoadableHttpResource> resources){
34-
this.scheduledDataLoaderService = new ScheduledHttpDataService(timer, listener);
33+
OkHttpLoaderServiceFacade(Timer timer, ConnectionLoaderListener listener, Map<String, LoadableHttpResource> resources){
34+
this.scheduledDataLoaderService = new OkHttpScheduler(timer, listener);
3535
this.loadDataLoaderService = new HttpLoadDataService(listener);
3636
this.loadDataLocalLoaderService = new HttpLoadLocalDataService(resources, listener);
3737
this.loadRemoteDataLoaderService = new HttpLoadRemoteDataService(listener);
@@ -54,7 +54,7 @@ public boolean loadDataRemote(String resourceId, Map<String, LoadableHttpResourc
5454
}
5555
@Override
5656
public String toString() {
57-
return HttpConnectionLoaderServiceFacade.class.getName() + '{' +
57+
return OkHttpLoaderServiceFacade.class.getName() + '{' +
5858
" scheduledDataLoaderService: " + scheduledDataLoaderService + ',' +
5959
" asyncLoaderService: " + loadDataLoaderService + ',' +
6060
" loadDataLocalLoaderService: " + loadDataLocalLoaderService + ',';

moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/HttpConnectionResourceCache.java renamed to moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/OkHttpResourceCache.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
*
3333
* @author Anatole Tresch
3434
*/
35-
class HttpConnectionResourceCache implements ResourceCache {
35+
class OkHttpResourceCache implements ResourceCache {
3636
/**
3737
* The logger used.
3838
*/
39-
private static final Logger LOG = Logger.getLogger(HttpConnectionResourceCache.class.getName());
39+
private static final Logger LOG = Logger.getLogger(OkHttpResourceCache.class.getName());
4040
/**
4141
* Suffix for files created.
4242
*/
@@ -53,7 +53,7 @@ class HttpConnectionResourceCache implements ResourceCache {
5353
/**
5454
* Constructor.
5555
*/
56-
public HttpConnectionResourceCache() {
56+
public OkHttpResourceCache() {
5757
if (!localDir.exists()) {
5858
if (!localDir.mkdirs()) {
5959
LOG.severe("Error creating cache dir " + localDir + ", resource cache disabled!");

moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/ScheduledHttpDataService.java renamed to moneta-core/src/main/java/org/javamoney/moneta/spi/loader/okhttp/OkHttpScheduler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
import java.util.logging.Level;
2222
import java.util.logging.Logger;
2323

24-
class ScheduledHttpDataService {
24+
class OkHttpScheduler {
2525

26-
private static final Logger LOG = Logger.getLogger(ScheduledHttpDataService.class.getName());
26+
private static final Logger LOG = Logger.getLogger(OkHttpScheduler.class.getName());
2727

2828
private final Timer timer;
2929
private final ConnectionLoaderListener listener;
3030

31-
public ScheduledHttpDataService(Timer timer, ConnectionLoaderListener listener) {
31+
public OkHttpScheduler(Timer timer, ConnectionLoaderListener listener) {
3232
this.timer = timer;
3333
this.listener = listener;
3434
}
@@ -141,7 +141,7 @@ public void run() {
141141

142142
@Override
143143
public String toString() {
144-
return ScheduledHttpDataService.class.getName() + '{' + " timer: "
144+
return OkHttpScheduler.class.getName() + '{' + " timer: "
145145
+ timer + '}';
146146
}
147147
}

moneta-core/src/main/java/org/javamoney/moneta/spi/loader/urlconnection/URLConnectionLoaderServiceFacade.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class URLConnectionLoaderServiceFacade {
2424

25-
private final ScheduledURLDataService scheduledDataLoaderService;
25+
private final URLConnectionScheduler scheduledDataLoaderService;
2626

2727
private final URLLoadDataService loadDataLoaderService;
2828

@@ -31,7 +31,7 @@ class URLConnectionLoaderServiceFacade {
3131
private final URLLoadRemoteDataService loadRemoteDataLoaderService;
3232

3333
URLConnectionLoaderServiceFacade(Timer timer, ConnectionLoaderListener listener, Map<String, LoadableURLResource> resources){
34-
this.scheduledDataLoaderService = new ScheduledURLDataService(timer, listener);
34+
this.scheduledDataLoaderService = new URLConnectionScheduler(timer, listener);
3535
this.loadDataLoaderService = new URLLoadDataService(listener);
3636
this.loadDataLocalLoaderService = new URLLoadLocalDataService(resources, listener);
3737
this.loadRemoteDataLoaderService = new URLLoadRemoteDataService(listener);

moneta-core/src/main/java/org/javamoney/moneta/spi/loader/urlconnection/ScheduledURLDataService.java renamed to moneta-core/src/main/java/org/javamoney/moneta/spi/loader/urlconnection/URLConnectionScheduler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
import java.util.logging.Level;
2222
import java.util.logging.Logger;
2323

24-
class ScheduledURLDataService {
24+
class URLConnectionScheduler {
2525

26-
private static final Logger LOG = Logger.getLogger(ScheduledURLDataService.class.getName());
26+
private static final Logger LOG = Logger.getLogger(URLConnectionScheduler.class.getName());
2727

2828
private final Timer timer;
2929
private final ConnectionLoaderListener listener;
3030

31-
public ScheduledURLDataService(Timer timer, ConnectionLoaderListener listener) {
31+
public URLConnectionScheduler(Timer timer, ConnectionLoaderListener listener) {
3232
this.timer = timer;
3333
this.listener = listener;
3434
}
@@ -141,7 +141,7 @@ public void run() {
141141

142142
@Override
143143
public String toString() {
144-
return ScheduledURLDataService.class.getName() + '{' + " timer: "
144+
return URLConnectionScheduler.class.getName() + '{' + " timer: "
145145
+ timer + '}';
146146
}
147147
}

0 commit comments

Comments
 (0)