diff options
| author | slewis | 2005-03-17 06:50:52 +0000 |
|---|---|---|
| committer | slewis | 2005-03-17 06:50:52 +0000 |
| commit | 843d1a7040807bd79486a6a85429131cd40625c4 (patch) | |
| tree | be920dc7d036e51505dd5e883db4d12d8b983430 | |
| parent | dd20a57e6942292b88a1dcdfe4399be48790500c (diff) | |
| download | org.eclipse.ecf-843d1a7040807bd79486a6a85429131cd40625c4.tar.gz org.eclipse.ecf-843d1a7040807bd79486a6a85429131cd40625c4.tar.xz org.eclipse.ecf-843d1a7040807bd79486a6a85429131cd40625c4.zip | |
Generalized IdentifiableObjectOutputStream to use a String rather than ID
3 files changed, 6 insertions, 7 deletions
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java index 491311695..43f4c877e 100644 --- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java +++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java @@ -1098,7 +1098,7 @@ public abstract class SOContainer implements ISharedObjectContainer { protected byte [] serializeSharedObjectMessage(ID sharedObjectID, Object message) throws IOException { if (!(message instanceof Serializable)) throw new NotSerializableException("sharedobjectmessage "+message+" not serializable"); ByteArrayOutputStream bouts = new ByteArrayOutputStream(); - IdentifiableObjectOutputStream ioos = new IdentifiableObjectOutputStream(sharedObjectID,bouts); + IdentifiableObjectOutputStream ioos = new IdentifiableObjectOutputStream(sharedObjectID.getName(),bouts); ioos.writeObject(message); return bouts.toByteArray(); } diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IdentifiableObjectInputStream.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IdentifiableObjectInputStream.java index 41e11e5ee..6ed997927 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IdentifiableObjectInputStream.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IdentifiableObjectInputStream.java @@ -45,7 +45,8 @@ public class IdentifiableObjectInputStream extends ObjectInputStream { } else { ClassLoader cl = mapper.mapNameToClassLoader(name); if (cl == null) return super.resolveClass(desc); - else return cl.loadClass(desc.getName()); + Class ret = cl.loadClass(desc.getName()); + return ret; } } diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IdentifiableObjectOutputStream.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IdentifiableObjectOutputStream.java index 8b0ec92e2..0b2b70f54 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IdentifiableObjectOutputStream.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IdentifiableObjectOutputStream.java @@ -13,7 +13,6 @@ package org.eclipse.ecf.core.util; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.OutputStream; -import org.eclipse.ecf.core.identity.ID; /** * Stores Java objects in the underlying stream in an manner that allows corresponding @@ -24,11 +23,11 @@ import org.eclipse.ecf.core.identity.ID; */ public class IdentifiableObjectOutputStream extends ObjectOutputStream { - ID objectID = null; + String name = null; - public IdentifiableObjectOutputStream(ID id, OutputStream outs) throws IOException { + public IdentifiableObjectOutputStream(String name, OutputStream outs) throws IOException { super(outs); - this.objectID = id; + this.name = name; } /* @@ -37,7 +36,6 @@ public class IdentifiableObjectOutputStream extends ObjectOutputStream { * @see java.io.ObjectOutputStream#annotateClass(java.lang.Class) */ protected void annotateClass(Class cl) throws IOException { - String name = objectID.getName(); writeUTF(name); } |
