Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3a37e62

Browse files
init
1 parent 8ce1f35 commit 3a37e62

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

‎src/main/java/org/rapidpm/vaadin/BasicTestUIRunner.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
package org.rapidpm.vaadin;
1717

1818
import org.apache.meecrowave.Meecrowave;
19-
import org.rapidpm.vaadin.imagecache.map.BlobImageService;
19+
import org.rapidpm.vaadin.imagecache.filesystem.BlobImageServiceFileSystem;
20+
import org.rapidpm.vaadin.imagecache.map.BlobImageServiceMap;
2021
import org.rapidpm.vaadin.imagecache.BlobService;
2122

2223
public class BasicTestUIRunner {
2324
private BasicTestUIRunner() {
2425
}
2526

2627

27-
public static final BlobService BLOB_SERVICE = new BlobImageService();
28-
// public static final BlobService BLOB_SERVICE = new BlobImageServiceCached();
28+
public static final BlobService BLOB_SERVICE = new BlobImageServiceFileSystem();
29+
// public static final BlobService BLOB_SERVICE = new BlobImageServiceMap();
30+
// public static final BlobService BLOB_SERVICE = new BlobImageServiceWeakRef();
2931
// public static final BlobService BLOB_SERVICE = new BlobImageServiceMapDB();
3032

31-
32-
3333
public static void main(String[] args) {
3434

3535
new Meecrowave(new Meecrowave.Builder() {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.rapidpm.vaadin.imagecache.filesystem;
2+
3+
import static org.rapidpm.vaadin.imagecache.BlobImageServiceFileFunctions.loadFile;
4+
5+
import org.rapidpm.frp.model.Result;
6+
import org.rapidpm.vaadin.imagecache.BlobService;
7+
8+
public class BlobImageServiceFileSystem implements BlobService {
9+
10+
@Override
11+
public Result<byte[]> loadBlob(String blobID) {
12+
return loadFile().apply(blobID);
13+
}
14+
}

‎src/main/java/org/rapidpm/vaadin/imagecache/map/BlobImageService.java‎ renamed to ‎src/main/java/org/rapidpm/vaadin/imagecache/map/BlobImageServiceMap.java‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
import org.rapidpm.frp.model.Result;
99
import org.rapidpm.vaadin.imagecache.BlobService;
1010

11-
/**
12-
*
13-
*/
14-
public class BlobImageService implements BlobService {
11+
public class BlobImageServiceMap implements BlobService {
1512

1613
private static final Map<String, Result<byte[]>> CACHE = new ConcurrentHashMap<>(); //TODO fill up the memory
1714

‎src/main/java/org/rapidpm/vaadin/imagecache/mapdb/BlobImageServiceMapDB.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public Result<byte[]> loadBlob(String blobID) {
2727
logger().info("containsKey = " + containsKey);
2828

2929
if (! containsKey) {
30-
// load data into system -> some slow remote system
30+
// load data into system -> some filesystem remote system
3131
loadFile()
3232
.apply(blobID)
3333
.ifPresentOrElse(

‎src/main/java/org/rapidpm/vaadin/imagecache/mapdb/PersistenceFunctions.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface PersistenceFunctions {
2020

2121
class DatabasePair extends Pair<DB, DB> {
2222

23-
publicDatabasePair(DB db , DB db2) {
23+
DatabasePair(DB db , DB db2) {
2424
super(db , db2);
2525
}
2626

‎src/main/java/org/rapidpm/vaadin/imagecache/weakref/BlobImageServiceCached.java‎ renamed to ‎src/main/java/org/rapidpm/vaadin/imagecache/weakref/BlobImageServiceWeakRef.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
*
1515
*/
16-
public class BlobImageServiceCached implements HasLogger, BlobService {
16+
public class BlobImageServiceWeakRef implements HasLogger, BlobService {
1717

1818
//TODO fill up the memory
1919
private static final Map<String, WeakReference<Result<byte[]>>> CACHE = new ConcurrentHashMap<>();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /