mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#646 - REFACTOR: L2 cache towards remote data grid caches (like Ignite etc)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
package com.avaje.ebeaninternal.server.cache;
|
||||
|
||||
import java.io.Externalizable;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -9,14 +14,37 @@ import java.util.List;
|
||||
* This is effectively just the Id values for each of the beans in the collection.
|
||||
* </p>
|
||||
*/
|
||||
public class CachedManyIds implements Serializable {
|
||||
public class CachedManyIds implements Externalizable {
|
||||
|
||||
private final List<Object> idList;
|
||||
private List<Object> idList;
|
||||
|
||||
public CachedManyIds(List<Object> idList) {
|
||||
this.idList = idList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct for serialization.
|
||||
*/
|
||||
public CachedManyIds() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(ObjectOutput out) throws IOException {
|
||||
out.writeInt(idList.size());
|
||||
for (Object id : idList) {
|
||||
out.writeObject(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
|
||||
int size = in.readInt();
|
||||
idList = new ArrayList<Object>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
idList.add(in.readObject());
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return idList.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user