#637 - Change SPI for ServerCache, add ServerCacheType to allow different cache construction for query bean and bean cache

This commit is contained in:
Robin Bygrave
2016-04-06 21:38:54 +12:00
parent 7b4d6f2d17
commit 7c11acaf89
5 changed files with 30 additions and 25 deletions
@@ -1,17 +1,18 @@
package com.avaje.ebeaninternal.server.cache;
import java.io.Serializable;
import java.util.Arrays;
/**
* Data held in the bean cache for cached beans.
*/
public class CachedBeanData {
public class CachedBeanData implements Serializable {
private final long whenCreated;
private final Object sharableBean;
private final boolean[] loaded;
private final Object[] data;
private final boolean naturalKeyUpdate;
private final Object naturalKey;
private final Object oldNaturalKey;
@@ -29,7 +30,7 @@ public class CachedBeanData {
public String toString() {
return Arrays.toString(data);
}
/**
* Return a copy of the property data.
*/
@@ -48,6 +49,20 @@ public class CachedBeanData {
return dest;
}
/**
* Return the loaded status for each property.
*/
public boolean[] getLoaded() {
return loaded;
}
/**
* Return the property values.
*/
public Object[] getData() {
return data;
}
/**
* Return when the cached data was created.
*/
@@ -75,7 +90,7 @@ public class CachedBeanData {
public Object getNaturalKey() {
return naturalKey;
}
/**
* Return the old natural key (its entry should be removed).
*/