Removed type generics from RemoteObjectSerializer
This commit is contained in:
parent
241b3d4ce2
commit
1ed2b65eed
|
@ -49,7 +49,7 @@ import dorkbox.network.connection.KryoExtra;
|
||||||
* @author Nathan Sweet <misc@n4te.com>
|
* @author Nathan Sweet <misc@n4te.com>
|
||||||
*/
|
*/
|
||||||
public
|
public
|
||||||
class RemoteObjectSerializer<T> extends Serializer<T> {
|
class RemoteObjectSerializer extends Serializer<Object> {
|
||||||
|
|
||||||
private final IdentityMap<Class<?>, Class<?>> rmiImplToIface;
|
private final IdentityMap<Class<?>, Class<?>> rmiImplToIface;
|
||||||
|
|
||||||
|
@ -61,22 +61,21 @@ class RemoteObjectSerializer<T> extends Serializer<T> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public
|
public
|
||||||
void write(Kryo kryo, Output output, T object) {
|
void write(Kryo kryo, Output output, Object object) {
|
||||||
KryoExtra kryoExtra = (KryoExtra) kryo;
|
KryoExtra kryoExtra = (KryoExtra) kryo;
|
||||||
int id = kryoExtra.connection.getRegisteredId(object);
|
int id = kryoExtra.connection.getRegisteredId(object);
|
||||||
output.writeInt(id, true);
|
output.writeInt(id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@Override
|
@Override
|
||||||
public
|
public
|
||||||
T read(Kryo kryo, Input input, Class implementationType) {
|
Object read(Kryo kryo, Input input, Class implementationType) {
|
||||||
KryoExtra kryoExtra = (KryoExtra) kryo;
|
KryoExtra kryoExtra = (KryoExtra) kryo;
|
||||||
int objectID = input.readInt(true);
|
int objectID = input.readInt(true);
|
||||||
|
|
||||||
// We have to lookup the iface, since the proxy object requires it
|
// We have to lookup the iface, since the proxy object requires it
|
||||||
Class<?> iface = rmiImplToIface.get(implementationType);
|
Class<?> iface = rmiImplToIface.get(implementationType);
|
||||||
|
|
||||||
return (T) kryoExtra.connection.getProxyObject(objectID, iface);
|
return kryoExtra.connection.getProxyObject(objectID, iface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user