Commit 3f5ace43 authored by guus's avatar guus

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11200 b35dd754-fafc-0310-a699-88a17e54d16e
parent 44d1f5e0
......@@ -177,6 +177,17 @@ public class DummyExternalizableUtil implements ExternalizableUtilStrategy {
return 0;
}
public void writeSerializableCollection(DataOutput out, Collection<? extends Serializable> value)
throws IOException {
// Do nothing
}
public int readSerializableCollection(DataInput in, Collection<? extends Serializable> value,
ClassLoader loader) throws IOException {
// Do nothing
return 0;
}
public void writeExternalizableMap(DataOutput out, Map<String, ? extends Externalizable> map) throws IOException {
// Do nothing
}
......@@ -187,6 +198,15 @@ public class DummyExternalizableUtil implements ExternalizableUtilStrategy {
return 0;
}
public void writeSerializableMap(DataOutput out, Map<String, ? extends Serializable> map) throws IOException {
// Do nothing
}
public int readSerializableMap(DataInput in, Map<String, ? extends Serializable> map, ClassLoader loader)
throws IOException {
// Do nothing
return 0;
}
public void writeStringsMap(DataOutput out, Map<String, Set<String>> map) throws IOException {
// Do nothing
}
......
......@@ -228,6 +228,18 @@ public class ExternalizableUtil {
strategy.writeExternalizableCollection(out, value);
}
/**
* Writes a collection of Serializable objects. The collection passed as a parameter
* must be a collection and not a <tt>null</null> value.
*
* @param out the output stream.
* @param value the collection of Serializable objects. This value must not be null.
* @throws IOException if an error occurs.
*/
public void writeSerializableCollection(DataOutput out, Collection<? extends Serializable> value) throws IOException {
strategy.writeSerializableCollection(out, value);
}
/**
* Reads a collection of Externalizable objects and adds them to the collection passed as a parameter. The
* collection passed as a parameter must be a collection and not a <tt>null</null> value.
......@@ -255,6 +267,33 @@ public class ExternalizableUtil {
strategy.writeExternalizableMap(out, map);
}
/**
* Reads a collection of Serializable objects and adds them to the collection passed as a parameter. The
* collection passed as a parameter must be a collection and not a <tt>null</null> value.
*
* @param in the input stream.
* @param value the collection of Serializable objects. This value must not be null.
* @param loader class loader to use to build elements inside of the serialized collection.
* @throws IOException if an error occurs.
* @return the number of elements added to the collection.
*/
public int readSerializableCollection(DataInput in, Collection<? extends Serializable> value, ClassLoader loader)
throws IOException {
return strategy.readSerializableCollection(in, value, loader);
}
/**
* Writes a Map of String key and value pairs. This method handles the
* case when the Map is <tt>null</tt>.
*
* @param out the output stream.
* @param map the Map of String key and Externalizable value pairs.
* @throws java.io.IOException if an error occurs.
*/
public void writeSerializableMap(DataOutput out, Map<String, ? extends Serializable> map) throws IOException {
strategy.writeSerializableMap(out, map);
}
/**
* Reads a Map of String key and value pairs. This method will return
* <tt>null</tt> if the Map written to the stream was <tt>null</tt>.
......@@ -269,6 +308,20 @@ public class ExternalizableUtil {
return strategy.readExternalizableMap(in, map, loader);
}
/**
* Reads a Map of String key and value pairs. This method will return
* <tt>null</tt> if the Map written to the stream was <tt>null</tt>.
*
* @param in the input stream.
* @param map a Map of String key and Serializable value pairs.
* @param loader class loader to use to build elements inside of the serialized collection.
* @throws IOException if an error occurs.
* @return the number of elements added to the collection.
*/
public int readSerializableMap(DataInput in, Map<String, ? extends Serializable> map, ClassLoader loader) throws IOException {
return strategy.readSerializableMap(in, map, loader);
}
/**
* Writes a Map of String key and Set of Strings value pairs. This method DOES NOT handle the
* case when the Map is <tt>null</tt>.
......
......@@ -131,10 +131,19 @@ public interface ExternalizableUtilStrategy {
int readExternalizableCollection(DataInput in, Collection<? extends Externalizable> value, ClassLoader loader)
throws IOException;
void writeSerializableCollection(DataOutput out, Collection<? extends Serializable> value) throws IOException;
int readSerializableCollection(DataInput in, Collection<? extends Serializable> value, ClassLoader loader)
throws IOException;
void writeExternalizableMap(DataOutput out, Map<String, ? extends Externalizable> map) throws IOException;
int readExternalizableMap(DataInput in, Map<String, ? extends Externalizable> map, ClassLoader loader) throws IOException;
void writeSerializableMap(DataOutput out, Map<String, ? extends Serializable> map) throws IOException;
int readSerializableMap(DataInput in, Map<String, ? extends Serializable> map, ClassLoader loader) throws IOException;
void writeStringsMap(DataOutput out, Map<String, Set<String>> map) throws IOException;
int readStringsMap(DataInput in, Map<String, Set<String>> map) throws IOException;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment