|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jivesoftware.util.cache.ExternalizableUtil
public class ExternalizableUtil
Utility methods to assist in working with the Externalizable interfaces. This class is only used when running inside of a Cluser. When using the open source version this class will use a dummy implementation. Anyway, this class is not used when not using the Enterprise edition.
ExternalizableLite is very similar to the standard Externalizable interface, except that it uses DataOutput/DataInput instead of the Object stream equivalents.
| Method Summary | |
|---|---|
static ExternalizableUtil |
getInstance()
|
ExternalizableUtilStrategy |
getStrategy()
Returns the implementation to use for serializing and deserializing objects. |
boolean |
readBoolean(java.io.DataInput in)
|
byte[] |
readByteArray(java.io.DataInput in)
|
int |
readExternalizableCollection(java.io.DataInput in,
java.util.Collection<? extends java.io.Externalizable> value,
java.lang.ClassLoader loader)
Reads a collection of Externalizable objects and adds them to the collection passed as a parameter. |
int |
readExternalizableMap(java.io.DataInput in,
java.util.Map<java.lang.String,? extends java.io.Externalizable> map,
java.lang.ClassLoader loader)
Reads a Map of String key and value pairs. |
int |
readInt(java.io.DataInput in)
|
long |
readLong(java.io.DataInput in)
|
long[] |
readLongArray(java.io.DataInput in)
Reads an array of long values. |
java.util.Map |
readLongIntMap(java.io.DataInput in)
Reads a Map of Long key and Integer value pairs. |
java.lang.String |
readSafeUTF(java.io.DataInput in)
|
java.io.Serializable |
readSerializable(java.io.DataInput in)
|
java.util.List<java.lang.String> |
readStringList(java.io.DataInput in)
Reads a List of Strings. |
java.util.Map<java.lang.String,java.lang.String> |
readStringMap(java.io.DataInput in)
Reads a Map of String key and value pairs. |
int |
readStrings(java.io.DataInput in,
java.util.Collection<java.lang.String> collection)
Reads the string array from the input stream and adds them to the specified collection. |
int |
readStringsMap(java.io.DataInput in,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
Reads a Map of String key and Set of Strings value pairs. |
void |
setStrategy(ExternalizableUtilStrategy strategy)
Sets the implementation to use for serializing and deserializing objects. |
void |
writeBoolean(java.io.DataOutput out,
boolean value)
|
void |
writeByteArray(java.io.DataOutput out,
byte[] value)
|
void |
writeExternalizableCollection(java.io.DataOutput out,
java.util.Collection<? extends java.io.Externalizable> value)
Writes a collection of Externalizable objects. |
void |
writeExternalizableMap(java.io.DataOutput out,
java.util.Map<java.lang.String,? extends java.io.Externalizable> map)
Writes a Map of String key and value pairs. |
void |
writeInt(java.io.DataOutput out,
int value)
|
void |
writeLong(java.io.DataOutput out,
long value)
|
void |
writeLongArray(java.io.DataOutput out,
long[] array)
Writes an array of long values. |
void |
writeLongIntMap(java.io.DataOutput out,
java.util.Map<java.lang.Long,java.lang.Integer> map)
Writes a Map of Long key and Integer value pairs. |
void |
writeSafeUTF(java.io.DataOutput out,
java.lang.String value)
|
void |
writeSerializable(java.io.DataOutput out,
java.io.Serializable value)
|
void |
writeStringList(java.io.DataOutput out,
java.util.List stringList)
Writes a List of Strings. |
void |
writeStringMap(java.io.DataOutput out,
java.util.Map<java.lang.String,java.lang.String> stringMap)
Writes a Map of String key and value pairs. |
void |
writeStrings(java.io.DataOutput out,
java.util.Collection<java.lang.String> collection)
Writes content of collection of strings to the output stream. |
void |
writeStringsMap(java.io.DataOutput out,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
Writes a Map of String key and Set of Strings value pairs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ExternalizableUtil getInstance()
public void setStrategy(ExternalizableUtilStrategy strategy)
strategy - the new strategy to use.public ExternalizableUtilStrategy getStrategy()
public void writeStringMap(java.io.DataOutput out,
java.util.Map<java.lang.String,java.lang.String> stringMap)
throws java.io.IOException
out - the output stream.stringMap - the Map of String key/value pairs.
java.io.IOException - if an error occurs.
public java.util.Map<java.lang.String,java.lang.String> readStringMap(java.io.DataInput in)
throws java.io.IOException
in - the input stream.
java.io.IOException - if an error occurs.
public void writeLongIntMap(java.io.DataOutput out,
java.util.Map<java.lang.Long,java.lang.Integer> map)
throws java.io.IOException
out - the output stream.map - the Map of Long key/Integer value pairs.
java.io.IOException - if an error occurs.
public java.util.Map readLongIntMap(java.io.DataInput in)
throws java.io.IOException
in - the input stream.
java.io.IOException - if an error occurs.
public void writeStringList(java.io.DataOutput out,
java.util.List stringList)
throws java.io.IOException
out - the output stream.stringList - the List of Strings.
java.io.IOException - if an error occurs.
public java.util.List<java.lang.String> readStringList(java.io.DataInput in)
throws java.io.IOException
in - the input stream.
java.io.IOException - if an error occurs.
public void writeLongArray(java.io.DataOutput out,
long[] array)
throws java.io.IOException
out - the output stream.array - the array of long values.
java.io.IOException - if an error occurs.
public long[] readLongArray(java.io.DataInput in)
throws java.io.IOException
in - the input stream.
java.io.IOException - if an error occurs.
public void writeLong(java.io.DataOutput out,
long value)
throws java.io.IOException
java.io.IOException
public long readLong(java.io.DataInput in)
throws java.io.IOException
java.io.IOException
public void writeInt(java.io.DataOutput out,
int value)
throws java.io.IOException
java.io.IOException
public int readInt(java.io.DataInput in)
throws java.io.IOException
java.io.IOException
public void writeBoolean(java.io.DataOutput out,
boolean value)
throws java.io.IOException
java.io.IOException
public boolean readBoolean(java.io.DataInput in)
throws java.io.IOException
java.io.IOException
public void writeByteArray(java.io.DataOutput out,
byte[] value)
throws java.io.IOException
java.io.IOException
public byte[] readByteArray(java.io.DataInput in)
throws java.io.IOException
java.io.IOException
public void writeSerializable(java.io.DataOutput out,
java.io.Serializable value)
throws java.io.IOException
java.io.IOException
public java.io.Serializable readSerializable(java.io.DataInput in)
throws java.io.IOException
java.io.IOException
public void writeSafeUTF(java.io.DataOutput out,
java.lang.String value)
throws java.io.IOException
java.io.IOException
public java.lang.String readSafeUTF(java.io.DataInput in)
throws java.io.IOException
java.io.IOException
public void writeExternalizableCollection(java.io.DataOutput out,
java.util.Collection<? extends java.io.Externalizable> value)
throws java.io.IOException
out - the output stream.value - the collection of Externalizable objects. This value must not be null.
java.io.IOException - if an error occurs.
public int readExternalizableCollection(java.io.DataInput in,
java.util.Collection<? extends java.io.Externalizable> value,
java.lang.ClassLoader loader)
throws java.io.IOException
in - the input stream.value - the collection of Externalizable objects. This value must not be null.loader - class loader to use to build elements inside of the serialized collection.
java.io.IOException - if an error occurs.
public void writeExternalizableMap(java.io.DataOutput out,
java.util.Map<java.lang.String,? extends java.io.Externalizable> map)
throws java.io.IOException
out - the output stream.map - the Map of String key and Externalizable value pairs.
java.io.IOException - if an error occurs.
public int readExternalizableMap(java.io.DataInput in,
java.util.Map<java.lang.String,? extends java.io.Externalizable> map,
java.lang.ClassLoader loader)
throws java.io.IOException
in - the input stream.map - a Map of String key and Externalizable value pairs.loader - class loader to use to build elements inside of the serialized collection.
java.io.IOException - if an error occurs.
public void writeStringsMap(java.io.DataOutput out,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
throws java.io.IOException
out - the output stream.map - the Map of String key and Set of Strings value pairs.
java.io.IOException - if an error occurs.
public int readStringsMap(java.io.DataInput in,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
throws java.io.IOException
in - the input stream.map - a Map of String key and Set of Strings value pairs.
java.io.IOException - if an error occurs.
public void writeStrings(java.io.DataOutput out,
java.util.Collection<java.lang.String> collection)
throws java.io.IOException
out - the output stream.collection - the Collection of Strings.
java.io.IOException - if an error occurs.
public int readStrings(java.io.DataInput in,
java.util.Collection<java.lang.String> collection)
throws java.io.IOException
in - the input stream.collection - the collection to add the read strings from the input stream.
java.io.IOException - if an error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||