mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-24 22:48:34 +00:00
Fixed ClassNotFound issue in replication of
WindEstimationModelsUpdateOperation
This commit is contained in:
+22
-1
@@ -3,6 +3,7 @@ package com.sap.sailing.windestimation.integration;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectStreamClass;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -105,7 +106,7 @@ public abstract class AbstractReplicableWithObjectInputStream<S, O extends Opera
|
||||
|
||||
@Override
|
||||
public ObjectInputStream createObjectInputStreamResolvingAgainstCache(InputStream is) throws IOException {
|
||||
ObjectInputStream ois = new ObjectInputStream(is);
|
||||
ObjectInputStream ois = new BundleObjectInputStream(is);
|
||||
return ois;
|
||||
}
|
||||
|
||||
@@ -139,4 +140,24 @@ public abstract class AbstractReplicableWithObjectInputStream<S, O extends Opera
|
||||
this.operationsSentToMasterForReplication.add(operation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom {@link ObjectInputStream} which is necessary in OSGI context in order to load the class
|
||||
* {@link WindEstimationModelsUpdateOperation} without {@link ClassNotFoundException}.
|
||||
*
|
||||
* @author Vladislav Chumak (D069712)
|
||||
*
|
||||
*/
|
||||
private class BundleObjectInputStream extends ObjectInputStream {
|
||||
|
||||
public BundleObjectInputStream(InputStream in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
|
||||
return super.resolveClass(desc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user