libjboss-serialization-java-1.0.3.GA.orig/0000755000175000017500000000000010504501476020301 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/dependencies/0000755000175000017500000000000010504501476022727 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/Release-1.0.3.GA.html0000644000175000017500000000135110504462372023473 0ustar twernertwerner Release Notes - JBoss Serialization - Version 1.0.3 GA

Bug

Feature Request

libjboss-serialization-java-1.0.3.GA.orig/previous-releases/0000755000175000017500000000000010504501476023756 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/previous-releases/Release-1.0.0.GA.html0000644000175000017500000001773410426114052027151 0ustar twernertwerner

Release Notes for JBoss Serialization 1.0.0.GA

Includes versions: 1.0.0 Beta1 1.0.0 Beta 3 1.0.0 RC 1 1.0.0 RC 2 1.0.0 CR 4 1.0.0 CR 5 1.0.0 CR6 1.0.0 GA


Bug

Feature Request

libjboss-serialization-java-1.0.3.GA.orig/previous-releases/Release-1.0.1.GA.html0000644000175000017500000000062510434550604027147 0ustar twernertwerner

Release Notes for JBoss Serialization

Includes versions: 1.0.1 GA


Bug

libjboss-serialization-java-1.0.3.GA.orig/previous-releases/Release-1.0.2.GA.html0000644000175000017500000000173610462457100027152 0ustar twernertwerner Release Notes - JBoss Serialization - Version 1.0.2 GA

Bug

libjboss-serialization-java-1.0.3.GA.orig/src/0000755000175000017500000000000010504501476021070 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/src/org/0000755000175000017500000000000010477615512021665 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/0000755000175000017500000000000010477615512023005 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/0000755000175000017500000000000010477615514024266 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/classmetamodel/0000755000175000017500000000000010477615512027261 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/classmetamodel/ClassMetaData.java0000644000175000017500000002702410441761120032563 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.classmetamodel; import java.io.Externalizable; import java.io.IOException; import java.io.Serializable; import java.lang.ref.WeakReference; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Collections; import org.apache.log4j.Logger; import org.jboss.serial.exception.SerializationException; import org.jboss.serial.references.MethodPersistentReference; import org.jboss.serial.references.PersistentReference; import org.jboss.serial.util.ClassMetaConsts; import org.jboss.serial.util.HashStringUtil; /** * @author clebert suconic */ public class ClassMetaData implements ClassMetaConsts { private static final Logger log = Logger.getLogger(ClassMetaData.class); private static final boolean isDebug = log.isDebugEnabled(); static ConstructorManager[] constructorManagers = {new SunConstructorManager(), new DefaultConstructorManager()}; /** Used to reconstruct the Ghost Constructor used by Serialization's specification */ static class GhostConstructorPersistentReference extends PersistentReference { GhostConstructorPersistentReference (Class clazz, Constructor constructor) { super(clazz,constructor,REFERENCE_TYPE_IN_USE); } public synchronized Object rebuildReference() throws Exception { Object returnValue=null; if ((returnValue=internalGet())!=null) return returnValue;; if (isDebug) { log.debug("Constructor being rebuilt for " + getMappedClass()); } Constructor constructorUsed = findConstructor(getMappedClass()); buildReference(constructorUsed); return constructorUsed; } public Constructor getConstructor() { return (Constructor)get(); } } private Method lookupMethodOnHierarchy(Class clazz, String methodName, Class reflectionArguments[]) { if (isDebug) { if (clazz.isPrimitive()) { log.debug("lookupMethodOnHierarchy::Loookup made on a primitive class"); } log.debug("lookupMethodOnHierarchy::class=" + clazz.getName() + " looking for " + methodName); } Class currentClass = clazz; while (currentClass!=Object.class && currentClass!=null) { if (isDebug) { log.debug("lookupMethodOnHierarchy::currentClass=" + currentClass); } try { Method method = currentClass.getDeclaredMethod(methodName,reflectionArguments); if (method.getReturnType() == Object.class) { return method; } } catch (Exception ignored) { } currentClass=currentClass.getSuperclass(); } return null; } public ClassMetaData(Class clazz) { setClassName(clazz.getName()); setClazz(clazz); setShaHash(HashStringUtil.hashName(clazz.getName())); setProxy(Proxy.isProxyClass(clazz)); lookupInternalMethods(clazz); try { setConstructor(findConstructor(clazz)); } catch (NoSuchMethodException e) { setConstructor(null); } setExternalizable(Externalizable.class.isAssignableFrom(clazz)); setSerializable(Serializable.class.isAssignableFrom(clazz)); exploreSlots(clazz); } /** * @todo - Is there a way in javassist to create a constructor? */ PersistentReference constructor = emptyReference; WeakReference clazz; WeakReference arrayRep; String className; boolean isArray; int arrayDepth; boolean isProxy; boolean isExternalizable; boolean isSerializable; long shaHash; PersistentReference readResolveMethod = emptyReference; PersistentReference writeReplaceMethod = emptyReference; ClassMetaDataSlot[] slots; public ClassMetaDataSlot[] getSlots() { return slots; } /** * @return Returns the className. */ public String getClassName() { return className; } /** * @param className * The className to set. */ public void setClassName(String className) { this.className = className; } private void calculateDepthAndName(Class clazz) { arrayDepth = 0; while (clazz.isArray()) { arrayDepth++; clazz = clazz.getComponentType(); } this.clazz=new WeakReference(clazz); } /** * @return Returns the clazz. */ public Class getClazz() { if (clazz==null) return null; else return (Class)clazz.get(); } public Class getArrayRepresentation() { if (arrayRep==null) return null; else return (Class)arrayRep.get(); } private void constructArrayRepresentationClass(Class clazz) { arrayRep = new WeakReference(clazz); } /** * @param clazz * The clazz to set. */ public void setClazz(Class clazz) { if (clazz==null) { this.clazz=null; } else { this.clazz = new WeakReference(clazz); if (clazz.isArray()) { this.setArray(true); calculateDepthAndName(clazz); constructArrayRepresentationClass(clazz); } } } /** * @return Returns the constructor. */ public Constructor getConstructor() { return (Constructor)constructor.get(); } /** * @param constructor * The constructor to set. */ public void setConstructor(Constructor constructor) { if (constructor != null) { constructor.setAccessible(true); } this.constructor = new GhostConstructorPersistentReference(this.getClazz(), constructor); } /** * @return Returns the isExternalizable. */ public boolean isExternalizable() { return isExternalizable; } /** * @param isExternalizable The isExternalizable to set. */ public void setExternalizable(boolean isExternalizable) { this.isExternalizable = isExternalizable; } public boolean isSerializable() { return isSerializable; } public void setSerializable(boolean isSerializable) { this.isSerializable = isSerializable; } public int hashCode() { return className.hashCode(); } public boolean equals(Object obj) { return className.equals(((ClassMetaData)obj).className); } /** * @return Returns the isArray. */ public boolean isArray() { return isArray; } /** * @param isArray The isArray to set. */ public void setArray(boolean isArray) { this.isArray = isArray; } /** * @return Returns the arrayDepth. */ public int getArrayDepth() { return arrayDepth; } /** * @return */ public Object newInstance() throws IOException { Constructor localConstructor = getConstructor(); try { if (localConstructor==null) { return this.getClazz().newInstance(); } else { return localConstructor.newInstance(EMPTY_OBJECT_ARRAY); } } catch (InstantiationException e) { throw new SerializationException("Could not create instance of " + this.className + " - " + e.getMessage(),e); } catch (IllegalAccessException e) { throw new SerializationException("Could not create instance of " + this.className + " - " + e.getMessage(),e); } catch (InvocationTargetException e) { throw new SerializationException("Could not create instance of " + this.className + " - " + e.getMessage(),e); } } public Method getReadResolveMethod() { return (Method)readResolveMethod.get(); } public void setReadResolveMethod(Method readResolveMethod) { this.readResolveMethod = new MethodPersistentReference(readResolveMethod,REFERENCE_TYPE_IN_USE); } public boolean isProxy() { return isProxy; } public void setProxy(boolean proxy) { isProxy = proxy; } public Method getWriteReplaceMethod() { return (Method)writeReplaceMethod.get(); } public void setWriteReplaceMethod(Method writeReplaceMethod) { this.writeReplaceMethod = new MethodPersistentReference(writeReplaceMethod,REFERENCE_TYPE_IN_USE); } public long getShaHash() { return shaHash; } public void setShaHash(long shaHash) { this.shaHash = shaHash; } private static Constructor findConstructor(Class clazz) throws NoSuchMethodException { if (clazz.isInterface()) { return null; } for (int i=0;iClebert Suconic */ public abstract class FieldsManager { private static final Logger log = Logger.getLogger(FieldsManager.class); private static final boolean isDebug = log.isDebugEnabled(); /** We need to test if Reflection could be used to change final fields or not. * In case negative we will use UnsafeFieldsManager and this class will be used to execute this test */ private static class InternalFinalFieldTestClass { final int x=0; } private static FieldsManager fieldsManager; static { if (UnsafeFieldsManager.isSupported()) { fieldsManager = new UnsafeFieldsManager(); } else { try { Field fieldX = InternalFinalFieldTestClass.class.getDeclaredField("x"); fieldX.setAccessible(true); InternalFinalFieldTestClass fieldTest = new InternalFinalFieldTestClass(); fieldX.setInt(fieldTest,33); fieldsManager = new ReflectionFieldsManager(); } catch (Throwable e) { } } if (fieldsManager==null) { log.error("Couldn't set FieldsManager, JBoss Serialization can't work properly on this VM"); } log.debug("FieldsManager in use = " + fieldsManager.getClass().getName()); } public static FieldsManager getFieldsManager() { return fieldsManager; } public abstract void fillMetadata(ClassMetadataField field); public abstract void setInt(Object obj, ClassMetadataField field, int value); public abstract int getInt (Object obj, ClassMetadataField field); public abstract void setByte(Object obj, ClassMetadataField field, byte value); public abstract byte getByte(Object obj, ClassMetadataField field); public abstract void setLong(Object obj, ClassMetadataField field, long value); public abstract long getLong(Object obj, ClassMetadataField field); public abstract void setFloat(Object obj, ClassMetadataField field, float value); public abstract float getFloat(Object obj, ClassMetadataField field); public abstract void setDouble(Object obj, ClassMetadataField field, double value); public abstract double getDouble(Object obj, ClassMetadataField field); public abstract void setShort(Object obj, ClassMetadataField field, short value); public abstract short getShort(Object obj, ClassMetadataField field); public abstract void setCharacter(Object obj, ClassMetadataField field, char value); public abstract char getCharacter(Object obj, ClassMetadataField field); public abstract void setBoolean(Object obj, ClassMetadataField field, boolean value); public abstract boolean getBoolean(Object obj, ClassMetadataField field); public abstract void setObject(Object obj, ClassMetadataField field, Object value); public abstract Object getObject(Object obj, ClassMetadataField field); } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/classmetamodel/ReflectionFieldsManager.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/classmetamodel/ReflectionFieldsManage0000644000175000017500000001352610421141240033522 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.classmetamodel; /** * $Id: ReflectionFieldsManager.java,v 1.3 2006/04/18 18:42:40 csuconic Exp $ * * @author Clebert Suconic */ public class ReflectionFieldsManager extends FieldsManager { public void fillMetadata(ClassMetadataField field) { if (field.getField()!=null) { field.getField().setAccessible(true); } } public void setInt(Object obj, ClassMetadataField field, int value) { try { field.getField().setInt(obj,value); } catch (Exception e) { throw new RuntimeException (e); } } public int getInt(Object obj, ClassMetadataField field) { try { return field.getField().getInt(obj); } catch (Exception e) { throw new RuntimeException(e); } } public void setByte(Object obj, ClassMetadataField field, byte value) { try { field.getField().setByte(obj,value); } catch (Exception e) { throw new RuntimeException(e); } } public byte getByte(Object obj, ClassMetadataField field) { try { return field.getField().getByte(obj); } catch (Exception e) { throw new RuntimeException(e); } } public void setLong(Object obj, ClassMetadataField field, long value) { try { field.getField().setLong(obj,value); } catch (Exception e) { throw new RuntimeException(e); } } public long getLong(Object obj, ClassMetadataField field) { try { return field.getField().getLong(obj); } catch (Exception e) { throw new RuntimeException(e); } } public void setFloat(Object obj, ClassMetadataField field, float value) { try { field.getField().setFloat(obj,value); } catch (Exception e) { throw new RuntimeException(e); } } public float getFloat(Object obj, ClassMetadataField field) { try { return field.getField().getFloat(obj); } catch (Exception e) { throw new RuntimeException(e); } } public void setDouble(Object obj, ClassMetadataField field, double value) { try { field.getField().setDouble(obj,value); } catch (Exception e) { throw new RuntimeException(e); } } public double getDouble(Object obj, ClassMetadataField field) { try { return field.getField().getDouble(obj); } catch (Exception e) { throw new RuntimeException(e); } } public void setShort(Object obj, ClassMetadataField field, short value) { try { field.getField().setShort(obj,value); } catch (Exception e) { throw new RuntimeException(e); } } public short getShort(Object obj, ClassMetadataField field) { try { return field.getField().getShort(obj); } catch (Exception e) { throw new RuntimeException(e); } } public void setCharacter(Object obj, ClassMetadataField field, char value) { try { field.getField().setChar(obj,value); } catch (Exception e) { throw new RuntimeException(e); } } public char getCharacter(Object obj, ClassMetadataField field) { try { return field.getField().getChar(obj); } catch (Exception e) { throw new RuntimeException(e); } } public void setBoolean(Object obj, ClassMetadataField field, boolean value) { try { field.getField().setBoolean(obj,value); } catch (Exception e) { throw new RuntimeException(e); } } public boolean getBoolean(Object obj, ClassMetadataField field) { try { return field.getField().getBoolean(obj); } catch (Exception e) { throw new RuntimeException(e); } } public void setObject(Object obj, ClassMetadataField field, Object value) { try { field.getField().set(obj,value); } catch (Exception e) { throw new RuntimeException(e); } } public Object getObject(Object obj, ClassMetadataField field) { try { return field.getField().get(obj); } catch (Exception e) { throw new RuntimeException(e); } } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/classmetamodel/StreamingClass.java0000644000175000017500000001044410426070440033033 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.classmetamodel; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; /** * A Streaming Class is created every time an object is created on the treaming. * It contains the current version and fields dependencies * @author Clebert Suconic * */ public class StreamingClass { public StreamingClass(Class clazz) throws IOException { metadata = ClassMetamodelFactory.getClassMetaData(clazz,false); } public StreamingClass(ClassMetaData clazz) throws IOException { metadata = clazz; } ClassMetaData metadata; /** Position the fields used by this StreamingClass on Read. * When a StreamingClass is read from a Streaming, an older version could have a different order on fields. This array is used to manage that */ private short[][] keyFields; public static void saveStream(ClassMetaData metadata, ObjectOutput out) throws IOException { out.writeUTF(metadata.getClassName()); ClassMetaDataSlot slots[] = metadata.getSlots(); out.writeShort(slots.length); for (int slotNR=0;slotNRfields.length) { throw new IOException("Current classpath has lesser fields on " + className + " than its original version"); } for (short fieldIndex=0;fieldIndexClebert Suconic */ public class UnsafeFieldsManager extends FieldsManager { UnsafeFieldsManager() { } static Unsafe unsafe; public static boolean isSupported() { return unsafe!=null; } static { try { Class[] classes = ObjectStreamClass.class.getDeclaredClasses(); for (int i=0;iClebert Suconic */ public class SerializationException extends IOException { public SerializationException(String message, Exception source) { this(message); this.initCause(source); } public SerializationException(String message) { super(message); } public SerializationException(Exception ex) { this(ex.getMessage(),ex); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/0000755000175000017500000000000010477615512027443 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/BooleanContainer.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/BooleanContainer.java0000644000175000017500000000477610421141242033525 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import java.io.DataOutput; import java.io.IOException; import java.io.DataInput; import java.lang.reflect.Field; /** * $Id: BooleanContainer.java,v 1.4 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic * @author Bob Morris - Added singletons TRUE and FALSE */ public class BooleanContainer extends FinalContainer { static private BooleanContainer TRUE = new BooleanContainer( true ); static private BooleanContainer FALSE = new BooleanContainer( false ); boolean value; static public BooleanContainer valueOf( boolean value ) { return value ? TRUE : FALSE; } private BooleanContainer( boolean value ) { this.value = value; } public boolean getValue() { return value; } public boolean equals( Object o ) { if ( this == o ) return true; if ( o == null || getClass() != o.getClass() ) return false; final BooleanContainer that = (BooleanContainer) o; if ( value != that.value ) return false; return true; } public int hashCode() { return ( value ? 1 : 0 ); } public void writeMyself( DataOutput output ) throws IOException { output.writeBoolean( value ); } public void readMyself( DataInput input ) throws IOException { value = input.readBoolean(); } public void setPrimitive( Object obj, Field field ) throws IllegalAccessException { field.setBoolean( obj, value ); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/ByteContainer.java0000644000175000017500000000426110421141242033036 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import java.io.DataOutput; import java.io.IOException; import java.io.DataInput; import java.lang.reflect.Field; /** * $Id: ByteContainer.java,v 1.3 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic */ public class ByteContainer extends FinalContainer { byte value; public ByteContainer(byte value) { this.value = value; } public ByteContainer() { } public byte getValue() { return value; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final ByteContainer that = (ByteContainer) o; if (value != that.value) return false; return true; } public int hashCode() { return (int) value; } public void writeMyself(DataOutput output) throws IOException { output.write(value); } public void readMyself(DataInput input) throws IOException { value = input.readByte(); } public void setPrimitive(Object obj, Field field) throws IllegalAccessException { field.setByte(obj,value); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/CharacterContainer.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/CharacterContainer.ja0000644000175000017500000000432210421141242033476 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import java.io.DataOutput; import java.io.IOException; import java.io.DataInput; import java.lang.reflect.Field; /** * $Id: CharacterContainer.java,v 1.3 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic */ public class CharacterContainer extends FinalContainer { char value; public CharacterContainer(char value) { this.value = value; } public CharacterContainer() { } public char getValue() { return value; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final CharacterContainer that = (CharacterContainer) o; if (value != that.value) return false; return true; } public int hashCode() { return (int) value; } public void writeMyself(DataOutput output) throws IOException { output.writeChar(value); } public void readMyself(DataInput input) throws IOException { value = input.readChar(); } public void setPrimitive(Object obj, Field field) throws IllegalAccessException { field.setChar(obj,value); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/DoubleContainer.java0000644000175000017500000000450110421141242033342 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import java.io.DataOutput; import java.io.IOException; import java.io.DataInput; import java.lang.reflect.Field; /** * $Id: DoubleContainer.java,v 1.3 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic */ public class DoubleContainer extends FinalContainer { double value; public DoubleContainer(double value) { this.value = value; } public DoubleContainer() { } public double getValue() { return value; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final DoubleContainer that = (DoubleContainer) o; if (Double.compare(that.value, value) != 0) return false; return true; } public int hashCode() { final long temp = value != +0.0d ? Double.doubleToLongBits(value) : 0L; return (int) (temp ^ (temp >>> 32)); } public void writeMyself(DataOutput output) throws IOException { output.writeDouble(value); } public void readMyself(DataInput input) throws IOException { value = input.readDouble(); } public void setPrimitive(Object obj, Field field) throws IllegalAccessException { field.setDouble(obj,value); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/FinalContainer.java0000644000175000017500000000263010421141242033162 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import org.jboss.serial.objectmetamodel.DataExport; import java.lang.reflect.Field; /** * $Id: FinalContainer.java,v 1.3 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic */ public abstract class FinalContainer extends DataExport { public abstract void setPrimitive(Object obj, Field field) throws IllegalAccessException; } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/FloatContainer.java0000644000175000017500000000437110421141242033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import java.io.DataOutput; import java.io.IOException; import java.io.DataInput; import java.lang.reflect.Field; /** * $Id: FloatContainer.java,v 1.3 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic */ public class FloatContainer extends FinalContainer { float value; public FloatContainer(float value) { this.value = value; } public FloatContainer() { } public float getValue() { return value; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final FloatContainer that = (FloatContainer) o; if (Float.compare(that.value, value) != 0) return false; return true; } public int hashCode() { return value != +0.0f ? Float.floatToIntBits(value) : 0; } public void writeMyself(DataOutput output) throws IOException { output.writeFloat(value); } public void readMyself(DataInput input) throws IOException { value = input.readFloat(); } public void setPrimitive(Object obj, Field field) throws IllegalAccessException { field.setFloat(obj,value); } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/IntegerContainer.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/IntegerContainer.java0000644000175000017500000000427410421141242033534 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import java.io.DataOutput; import java.io.IOException; import java.io.DataInput; import java.lang.reflect.Field; /** * $Id: IntegerContainer.java,v 1.3 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic */ public class IntegerContainer extends FinalContainer { int value; public IntegerContainer(int value) { this.value = value; } public IntegerContainer() { } public int getValue() { return value; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final IntegerContainer that = (IntegerContainer) o; if (value != that.value) return false; return true; } public int hashCode() { return value; } public void writeMyself(DataOutput output) throws IOException { output.writeInt(value); } public void readMyself(DataInput input) throws IOException { value = input.readInt(); } public void setPrimitive(Object obj, Field field) throws IllegalAccessException { field.setInt(obj,value); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/LongContainer.java0000644000175000017500000000431010421141242033025 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import java.io.DataOutput; import java.io.IOException; import java.io.DataInput; import java.lang.reflect.Field; /** * $Id: LongContainer.java,v 1.3 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic */ public class LongContainer extends FinalContainer { long value; public LongContainer(long value) { this.value = value; } public LongContainer() { } public long getValue() { return value; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final LongContainer that = (LongContainer) o; if (value != that.value) return false; return true; } public int hashCode() { return (int) (value ^ (value >>> 32)); } public void writeMyself(DataOutput output) throws IOException { output.writeLong(value); } public void readMyself(DataInput input) throws IOException { value = input.readLong(); } public void setPrimitive(Object obj, Field field) throws IllegalAccessException { field.setLong(obj,value); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/finalcontainers/ShortContainer.java0000644000175000017500000000430010421141242033224 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.finalcontainers; import java.io.DataOutput; import java.io.IOException; import java.io.DataInput; import java.lang.reflect.Field; /** * $Id: ShortContainer.java,v 1.3 2006/04/18 18:42:41 csuconic Exp $ * * @author Clebert Suconic */ public class ShortContainer extends FinalContainer { short value; public ShortContainer(short value) { this.value = value; } public ShortContainer() { } public short getValue() { return value; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final ShortContainer that = (ShortContainer) o; if (value != that.value) return false; return true; } public int hashCode() { return (int) value; } public void writeMyself(DataOutput output) throws IOException { output.writeShort(value); } public void readMyself(DataInput input) throws IOException { value = input.readShort(); } public void setPrimitive(Object obj, Field field) throws IllegalAccessException { field.setShort(obj,value); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/0000755000175000017500000000000010477615512024673 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/JBossObjectInputStream.java0000644000175000017500000002074110454410556032101 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.io; import org.jboss.serial.classmetamodel.ClassResolver; import org.jboss.serial.objectmetamodel.DataContainer; import org.jboss.serial.objectmetamodel.DataContainerConstants; import org.jboss.serial.util.ClassMetaConsts; import org.jboss.serial.util.StringUtilBuffer; import org.jboss.serial.util.StringUtil; import java.io.*; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.util.Arrays; /** * @author Clebert Suconic */ public class JBossObjectInputStream extends ObjectInputStream implements DataContainerConstants { InputStream is; DataInputStream dis; DataContainer container; ClassLoader classLoader; StringUtilBuffer buffer; private static Constructor constructorObjectStreamClass; private static Field setNameField; static { try { constructorObjectStreamClass = ObjectStreamClass.class.getDeclaredConstructor(ClassMetaConsts.EMPTY_CLASS_ARRY); constructorObjectStreamClass.setAccessible(true); setNameField = ObjectStreamClass.class.getDeclaredField("name"); setNameField.setAccessible(true); } catch (Exception e) { constructorObjectStreamClass = null; setNameField=null; e.printStackTrace(); } } public JBossObjectInputStream(InputStream is) throws IOException { this(is,Thread.currentThread().getContextClassLoader()); } public JBossObjectInputStream(InputStream is,StringUtilBuffer buffer) throws IOException { this(is,Thread.currentThread().getContextClassLoader(),buffer); } public JBossObjectInputStream(InputStream is, ClassLoader loader) throws IOException { this(is,loader,null); } /** In case of InputStream is null, the only method that can be used on this class is smartClone */ public JBossObjectInputStream(InputStream is, ClassLoader loader,StringUtilBuffer buffer) throws IOException { super(); this.buffer=buffer; if (is!=null) { checkSignature(is); this.is=is; if (is instanceof DataInputStream) { dis = (DataInputStream)is; } else { dis = new DataInputStream(is); } } this.classLoader =loader; } private void checkSignature(InputStream is) throws IOException { byte signature[] = new byte[openSign.length]; is.read(signature); if (!Arrays.equals(signature,openSign)) { throw new IOException("Mismatch version of JBossSerialization signature"); } } ClassResolver resolver = new ClassResolver() { public Class resolveClass(String name) throws ClassNotFoundException { if (constructorObjectStreamClass!=null) { try { ObjectStreamClass streamClass = (ObjectStreamClass)constructorObjectStreamClass.newInstance(ClassMetaConsts.EMPTY_OBJECT_ARRAY); setNameField.set(streamClass,name); return JBossObjectInputStream.this.resolveClass(streamClass); } catch (Exception e) { e.printStackTrace(); return null; } } return null; } }; protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { return Class.forName(desc.getName(),false,getClassLoader()); } /** This is the old method of reading objects, always loading everything to a datacontainer*/ public Object readObjectUsingDataContainer() throws IOException, ClassNotFoundException { DataContainer container = new DataContainer(classLoader,false,buffer); container.setClassResolver(resolver); container.loadData(dis); ObjectInput input = container.getInput(); return input.readObject(); } public Object readObjectOverride() throws IOException, ClassNotFoundException { DataContainer container = new DataContainer(classLoader,false,buffer); container.setClassResolver(resolver); //container.loadData(dis); //ObjectInput input = container.getInput(); ObjectInput input = container.getDirectInput(dis); return input.readObject(); } public Object readUnshared() throws IOException, ClassNotFoundException { return readObjectOverride(); } public void defaultReadObject() throws IOException, ClassNotFoundException { } public void registerValidation(ObjectInputValidation obj, int prio) throws NotActiveException, InvalidObjectException { } protected void readStreamHeader() throws IOException, StreamCorruptedException { } protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { return null; } public int read() throws IOException { return dis.read(); } public int read(byte[] buf, int off, int len) throws IOException { return dis.read(buf, off, len); } /** * Returns the number of bytes that can be read without blocking. * * @return the number of available bytes. * @throws IOException * if there are I/O errors while reading from the underlying * InputStream */ public int available() throws IOException { return 1; } public void close() throws IOException { } public boolean readBoolean() throws IOException { return dis.readBoolean(); } public byte readByte() throws IOException { return dis.readByte(); } public int readUnsignedByte() throws IOException { return dis.readUnsignedByte(); } public char readChar() throws IOException { return dis.readChar(); } public short readShort() throws IOException { return dis.readShort(); } public int readUnsignedShort() throws IOException { return dis.readUnsignedShort(); } public int readInt() throws IOException { return dis.readInt(); } public long readLong() throws IOException { return dis.readLong(); } public float readFloat() throws IOException { return dis.readFloat(); } public double readDouble() throws IOException { return dis.readDouble(); } public void readFully(byte[] buf) throws IOException { dis.readFully(buf); } public void readFully(byte[] buf, int off, int len) throws IOException { dis.readFully(buf, off, len); } public int skipBytes(int len) throws IOException { return dis.skipBytes(len); } public String readLine() throws IOException { return dis.readLine(); } public String readUTF() throws IOException { return StringUtil.readString(dis,buffer); } /* * (non-Javadoc) * * @see java.io.ObjectInput#read(byte[]) */ public int read(byte[] b) throws IOException { return dis.read(b); } /* * (non-Javadoc) * * @see java.io.ObjectInput#skip(long) */ public long skip(long n) throws IOException { return dis.skip(n); } public ClassLoader getClassLoader() { if (classLoader==null){ return Thread.currentThread().getContextClassLoader(); } else { return classLoader; } } public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/JBossObjectInputStreamSharedTree.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/JBossObjectInputStreamSharedTree.j0000644000175000017500000000465610433403266033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.io; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInput; import org.jboss.serial.objectmetamodel.DataContainer; import org.jboss.serial.util.StringUtilBuffer; /** This implementation will respect reset commands. */ public class JBossObjectInputStreamSharedTree extends JBossObjectInputStream { ObjectInput input = null; DataContainer container = null; public JBossObjectInputStreamSharedTree(InputStream is, ClassLoader loader, StringUtilBuffer buffer) throws IOException { super(is, loader, buffer); } public JBossObjectInputStreamSharedTree(InputStream is, ClassLoader loader) throws IOException { super(is, loader); } public JBossObjectInputStreamSharedTree(InputStream is, StringUtilBuffer buffer) throws IOException { super(is, buffer); } public JBossObjectInputStreamSharedTree(InputStream is) throws IOException { super(is); } public Object readObjectOverride() throws IOException, ClassNotFoundException { if (input==null) { container = new DataContainer(classLoader,false,buffer); container.setClassResolver(resolver); input = container.getDirectInput(dis); } return input.readObject(); } public ClassLoader getClassLoader() { return super.getClassLoader(); } public void setClassLoader(ClassLoader classLoader) { if (container!=null) { container.getCache().setLoader(classLoader); } super.setClassLoader(classLoader); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/JBossObjectOutputStream.java0000644000175000017500000002411310470273274032301 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.io; import org.jboss.serial.objectmetamodel.DataContainer; import org.jboss.serial.objectmetamodel.DataContainerConstants; import org.jboss.serial.objectmetamodel.ObjectSubstitutionInterface; import org.jboss.serial.objectmetamodel.safecloning.SafeCloningRepository; import org.jboss.serial.exception.SerializationException; import org.jboss.serial.util.StringUtilBuffer; import org.jboss.serial.util.StringUtil; import java.io.*; import java.lang.reflect.Field; /** * @author Clebert Suconic */ public class JBossObjectOutputStream extends ObjectOutputStream implements DataContainerConstants { OutputStream output; DataOutputStream dataOutput; boolean checkSerializableClass=false; static Field fieldEnableReplace; /** one of the optimizations we do is to reuse byte arrays on writeUTF operations, look at {@link org.jboss.serial.util.StringUtil}. * StringUtil has also the capability of creating Buffers on ThreadLocal over demand, but having these buffers pre-created * is more efficient */ StringUtilBuffer buffer; static { try { fieldEnableReplace = ObjectOutputStream.class.getDeclaredField("enableReplace"); fieldEnableReplace.setAccessible(true); } catch (NoSuchFieldException e) { e.printStackTrace(); } } protected ObjectSubstitutionInterface getSubstitutionInterface() throws IOException { try { if (fieldEnableReplace.getBoolean(this)) { return new ObjectSubstitutionInterface() { public Object replaceObject(Object obj) throws IOException { return JBossObjectOutputStream.this.replaceObject(obj); } }; } else { return null; } } catch (IllegalAccessException ex) { throw new SerializationException(ex.getMessage(),ex); } } protected boolean enableReplaceObject(boolean enable) { try { if (enable == fieldEnableReplace.getBoolean(this)) { return enable; } fieldEnableReplace.setBoolean(this,enable); return !fieldEnableReplace.getBoolean(this); } catch (Exception e) { e.printStackTrace(); // trying the super method return super.enableReplaceObject(enable); } } /**Creates an OutputStream, that by default doesn't require */ public JBossObjectOutputStream(OutputStream output) throws IOException { this(output,false); } /**Creates an OutputStream, that by default doesn't require */ public JBossObjectOutputStream(OutputStream output,StringUtilBuffer buffer) throws IOException { this(output,false,buffer); } public JBossObjectOutputStream(OutputStream output, boolean checkSerializableClass) throws IOException { this(output,checkSerializableClass,null); } public JBossObjectOutputStream(OutputStream output, boolean checkSerializableClass,StringUtilBuffer buffer) throws IOException { super(); if (output!=null) { output.write(openSign); } this.buffer=buffer; this.output=output; this.checkSerializableClass=checkSerializableClass; if (output instanceof DataOutputStream) { dataOutput = (DataOutputStream) output; } else { dataOutput = new DataOutputStream(output); } } public void writeObjectUsingDataContainer(Object obj) throws IOException { DataContainer dataContainer = new DataContainer(null,this.getSubstitutionInterface(),checkSerializableClass,buffer); if (output instanceof DataOutputStream) { dataOutput = (DataOutputStream) output; } else { dataOutput = new DataOutputStream(output); } ObjectOutput objectOutput = dataContainer.getOutput(); objectOutput.writeObject(obj); //objectOutput.flush(); dataContainer.saveData(dataOutput); //this.flush(); } protected void writeObjectOverride(Object obj) throws IOException { DataContainer dataContainer = new DataContainer(null,this.getSubstitutionInterface(),checkSerializableClass,buffer); if (output instanceof DataOutputStream) { dataOutput = (DataOutputStream) output; } else { dataOutput = new DataOutputStream(output); } dataContainer.setStringBuffer(buffer); ObjectOutput objectOutput = dataContainer.getDirectOutput(this.dataOutput); objectOutput.writeObject(obj); //objectOutput.flush(); //dataContainer.saveData(dataOutput); //this.flush(); } public void writeUnshared(Object obj) throws IOException { writeObjectOverride(obj); } public void defaultWriteObject() throws IOException { } public void writeFields() throws IOException { } public void reset() throws IOException { } protected void writeStreamHeader() throws IOException { } protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { } /** * Writes a byte. This method will block until the byte is actually * written. * * @param val the byte to be written to the stream * @throws IOException If an I/O error has occurred. */ public void write(int val) throws IOException { dataOutput.write(val); } /** * Writes an array of bytes. This method will block until the bytes are * actually written. * * @param buf the data to be written * @throws IOException If an I/O error has occurred. */ public void write(byte[] buf) throws IOException { dataOutput.write(buf); } public void write(byte[] buf, int off, int len) throws IOException { if (buf == null) { throw new SerializationException("buf parameter can't be null"); } dataOutput.write(buf, off, len); } /** * Flushes the stream. This will write any buffered output bytes and flush * through to the underlying stream. * * @throws IOException If an I/O error has occurred. */ public void flush() throws IOException { if (dataOutput!=null) { dataOutput.flush(); } else { output.flush(); } } protected void drain() throws IOException { //bout.drain(); } public void close() throws IOException { flush(); dataOutput.close(); } public void writeBoolean(boolean val) throws IOException { dataOutput.writeBoolean(val); } public void writeByte(int val) throws IOException { dataOutput.writeByte(val); } public void writeShort(int val) throws IOException { dataOutput.writeShort(val); } public void writeChar(int val) throws IOException { dataOutput.writeChar(val); } public void writeInt(int val) throws IOException { dataOutput.writeInt(val); } public void writeLong(long val) throws IOException { dataOutput.writeLong(val); } public void writeFloat(float val) throws IOException { dataOutput.writeFloat(val); } public void writeDouble(double val) throws IOException { dataOutput.writeDouble(val); } public void writeBytes(String str) throws IOException { dataOutput.writeBytes(str); } public void writeChars(String str) throws IOException { dataOutput.writeChars(str); } public void writeUTF(String str) throws IOException { StringUtil.saveString(dataOutput,str,buffer); } /** Reuses every primitive value to recreate another object. */ public Object smartClone(Object obj) throws IOException { return smartClone(obj,null,Thread.currentThread().getContextClassLoader()); } /** Reuses every primitive value to recreate another object. */ public Object smartClone(Object obj, SafeCloningRepository safeToReuse) throws IOException { return smartClone(obj,safeToReuse,Thread.currentThread().getContextClassLoader()); } /** Reuses every primitive value to recreate another object. * and if safeToReuse!=null, it can reuse the entire object */ public Object smartClone(Object obj, SafeCloningRepository safeToReuse, ClassLoader loader) throws IOException { DataContainer container = new DataContainer(loader,this.getSubstitutionInterface(),safeToReuse,checkSerializableClass,buffer); ObjectOutput output = container.getOutput(); output.writeObject(obj); output.flush(); ObjectInput input = container.getInput(); try { return input.readObject(); } catch (ClassNotFoundException e) { throw new SerializationException (e.getMessage(),e); } } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/JBossObjectOutputStreamSharedTree.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/JBossObjectOutputStreamSharedTree.0000644000175000017500000000556510433403266033413 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.io; import java.io.DataOutputStream; import java.io.IOException; import java.io.ObjectOutput; import java.io.OutputStream; import org.jboss.serial.objectmetamodel.DataContainer; import org.jboss.serial.objectmetamodel.DataContainerConstants; import org.jboss.serial.util.ClassMetaConsts; import org.jboss.serial.util.StringUtilBuffer; /** This implementation will respect reset commands. */ public class JBossObjectOutputStreamSharedTree extends JBossObjectOutputStream { ObjectOutput objectOutput; DataContainer dataContainer; public JBossObjectOutputStreamSharedTree(OutputStream output, boolean checkSerializableClass, StringUtilBuffer buffer) throws IOException { super(output, checkSerializableClass, buffer); } public JBossObjectOutputStreamSharedTree(OutputStream output, boolean checkSerializableClass) throws IOException { super(output, checkSerializableClass); } public JBossObjectOutputStreamSharedTree(OutputStream output, StringUtilBuffer buffer) throws IOException { super(output, buffer); } public JBossObjectOutputStreamSharedTree(OutputStream output) throws IOException { super(output); } protected void writeObjectOverride(Object obj) throws IOException { checkOutput(); objectOutput.writeObject(obj); } public void reset() throws IOException { checkOutput(); objectOutput.writeByte(DataContainerConstants.RESET); dataContainer.getCache().reset(); } private void checkOutput() throws IOException { if (objectOutput==null) { dataContainer = new DataContainer(null,this.getSubstitutionInterface(),checkSerializableClass,buffer); if (output instanceof DataOutputStream) { dataOutput = (DataOutputStream) output; } else { dataOutput = new DataOutputStream(output); } objectOutput = dataContainer.getDirectOutput(this.dataOutput); } } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/MarshalledObject.java0000644000175000017500000000524310334433312030731 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.io; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.Serializable; import java.util.Arrays; /** * Turns content into a byte array that is delayed in unmarshalling. JBoss Serialization * equivalent to java.rmi.MarshalledObject * * @author Bill Burke * @version $Revision: 1.1 $ */ public class MarshalledObject implements Serializable { private byte[] bytes; private int hash; static final long serialVersionUID = -1433248532959364465L; public MarshalledObject() {} public MarshalledObject(Object obj) throws java.io.IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); JBossObjectOutputStream mvos = new JBossObjectOutputStream(baos); mvos.writeObject(obj); mvos.flush(); bytes = baos.toByteArray(); mvos.close(); hash = 0; for (int i = 0; i < bytes.length; i++) { hash += bytes[i]; } } public Object get() throws IOException, ClassNotFoundException { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); JBossObjectInputStream ois = new JBossObjectInputStream(bais); try { return ois.readObject(); } finally { ois.close(); bais.close(); } } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final MarshalledObject that = (MarshalledObject) o; if (!Arrays.equals(bytes, that.bytes)) return false; return true; } public int hashCode() { return hash; } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/MarshalledObjectForLocalCalls.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/io/MarshalledObjectForLocalCalls.java0000644000175000017500000000460110433403266033334 0ustar twernertwernerpackage org.jboss.serial.io; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import org.apache.log4j.Logger; import org.jboss.serial.classmetamodel.ClassMetaData; import org.jboss.serial.objectmetamodel.DataContainer; import org.jboss.serial.objectmetamodel.safecloning.SafeCloningRepository; import org.jboss.serial.util.StringUtil; /** * This is the equivalent for MarshalledObject on RMI, but this is optimized for local calls. * Instead of converting every single field into Bytes, this will use a DataContainer. * @author Clebert Suconic */ public class MarshalledObjectForLocalCalls implements Externalizable { private static final long serialVersionUID = 785809358605094514L; private static final Logger log = Logger.getLogger(ClassMetaData.class); private static final boolean isDebug = log.isDebugEnabled(); DataContainer container; public MarshalledObjectForLocalCalls() { } public MarshalledObjectForLocalCalls(Object obj) throws IOException { container = new DataContainer(false); ObjectOutput output = container.getOutput(); output.writeObject(obj); output.flush(); container.flush(); } public MarshalledObjectForLocalCalls(Object obj, SafeCloningRepository safeToReuse) throws IOException { container = new DataContainer(null, null, safeToReuse, false,null); ObjectOutput output = container.getOutput(); output.writeObject(obj); output.flush(); container.flush(); } /** * The object has to be unserialized only when the first get is executed. */ public Object get() throws IOException, ClassNotFoundException { try { container.getCache().setLoader(Thread.currentThread().getContextClassLoader()); return container.getInput().readObject(); } catch(RuntimeException e) { log.error(e, e); throw e; } } public void writeExternal(ObjectOutput out) throws IOException { if (isDebug) { log.debug("writeExternal"); } container.saveData(out); } public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { if (isDebug) { log.debug("readExternal"); } container = new DataContainer(false); container.loadData(in); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/0000755000175000017500000000000010477615512027422 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/safecloning/0000755000175000017500000000000010477615512031712 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/safecloning/SafeClone.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/safecloning/SafeClone0000644000175000017500000000226310377605426033501 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.objectmetamodel.safecloning; /** * @author Tom Elrod */ public interface SafeClone { public boolean isSafeToReuse(Object obj); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/safecloning/SafeCloningRepository.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/safecloning/SafeCloni0000644000175000017500000000561610425471520033500 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.objectmetamodel.safecloning; import gnu.trove.TObjectIntHashMap; import java.util.ArrayList; import org.apache.log4j.Logger; import org.jboss.serial.util.ClassMetaConsts; /** * $Id: SafeCloningRepository.java,v 1.6 2006/05/02 04:45:03 csuconic Exp $ * * Some objects may be completely reused during cloning operations. (For instance InvocationContext) * * @author Clebert Suconic */ public class SafeCloningRepository implements ClassMetaConsts { private static final Logger log = Logger.getLogger(SafeCloningRepository.class); private static final boolean isDebug = log.isDebugEnabled(); public SafeCloningRepository(SafeClone safeClone) { this.safeClone = safeClone; } private SafeClone safeClone; TObjectIntHashMap safeToReuse = new TObjectIntHashMap(identityHashStrategy); ArrayList reuse = new ArrayList(); public void clear() { reuse.clear(); safeToReuse.clear(); } public int storeSafe(Object obj) { if (safeClone.isSafeToReuse(obj)) { int description=safeToReuse.get(obj); if (description==0) { safeToReuse.put(obj,safeToReuse.size()+1); description = safeToReuse.size(); if (isDebug) { log.debug("storeSafe::Created a new storeSafe Reference=" + description + " obj=" + obj.getClass().getName()); } reuse.add(obj); } return description; } else { return 0; } } public Object findReference(int reference) { Object retobject = reuse.get(reference-1); if (isDebug) { if (retobject!=null) { log.debug("findReference::found reference " + reference + " on an object=" + retobject.getClass().getName()); } } return retobject; } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/DataContainer.java0000644000175000017500000013121010474543366033003 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.objectmetamodel; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInput; import java.io.DataInputStream; import java.io.DataOutput; import java.io.DataOutputStream; import java.io.EOFException; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.ArrayList; import java.util.Iterator; import org.jboss.serial.classmetamodel.ClassMetamodelFactory; import org.jboss.serial.classmetamodel.ClassResolver; import org.jboss.serial.exception.SerializationException; import org.jboss.serial.finalcontainers.BooleanContainer; import org.jboss.serial.finalcontainers.ByteContainer; import org.jboss.serial.finalcontainers.CharacterContainer; import org.jboss.serial.finalcontainers.DoubleContainer; import org.jboss.serial.finalcontainers.FloatContainer; import org.jboss.serial.finalcontainers.IntegerContainer; import org.jboss.serial.finalcontainers.LongContainer; import org.jboss.serial.finalcontainers.ShortContainer; import org.jboss.serial.objectmetamodel.safecloning.SafeCloningRepository; import org.jboss.serial.util.StringUtil; import org.jboss.serial.util.StringUtilBuffer; /** * DataContainer is a Container of Immutables and Object References. * It emmulates the repository as it would be a DataOutputStream and DataInputStream * * $Id: DataContainer.java,v 1.44 2006/08/28 18:35:34 csuconic Exp $ * * @author clebert suconic */ public class DataContainer extends DataExport implements DataContainerConstants, Externalizable { /** These are the bytes used during streaming of Datacontainer. They are used to control and they are mixed within content. * So, they should be read in the same order they were written */ byte[] controlStreaming; DataContainerOutput currentOutput = null; ArrayList content = new ArrayList(); /** I used the transient tag as a documentation feature. * this contains the root objectCache being used. * It would be possible to use ThreadLocals for this. * But I didn't want to take the risk of having problems when the application was running * in ThreadPools generating leaks.*/ transient ObjectsCache cache; public DataContainer cloneContainer() { DataContainer newContainer = new DataContainer(); newContainer.content = this.content; newContainer.controlStreaming = this.controlStreaming; newContainer.cache = this.cache.cloneCache(); return newContainer; } private DataContainer() { } public DataContainer(boolean checkSerializable) { this ((ClassLoader)null, checkSerializable,null); } public DataContainer(boolean checkSerializable, StringUtilBuffer buffer) { this ((ClassLoader)null, checkSerializable,buffer); } public DataContainer(ClassLoader loader, boolean checkSerializable, StringUtilBuffer buffer) { this(loader,null,checkSerializable,buffer); } public DataContainer(ClassLoader loader, boolean checkSerializable, StringUtilBuffer buffer,ClassResolver resolver) { this(loader,null,checkSerializable,buffer); } public DataContainer(ClassLoader loader, ObjectSubstitutionInterface substitution, boolean checkSerializable) { this(loader,substitution,null,checkSerializable,null); } public DataContainer(ClassLoader loader, ObjectSubstitutionInterface substitution, boolean checkSerializable, StringUtilBuffer buffer) { this(loader,substitution,null,checkSerializable,buffer); } public DataContainer(ClassLoader loader, ObjectSubstitutionInterface substitution, SafeCloningRepository safeToReuse, boolean checkSerializable) { this(); this.cache=new ObjectsCache(substitution,loader,safeToReuse,checkSerializable,null); } public DataContainer(ClassLoader loader, ObjectSubstitutionInterface substitution, SafeCloningRepository safeToReuse, boolean checkSerializable, StringUtilBuffer buffer) { this(); this.cache=new ObjectsCache(substitution,loader,safeToReuse,checkSerializable,buffer); } public DataContainer(ObjectsCache cache) { this.cache=cache; } public int getSize() { return content.size(); } public ObjectInput getInput() { return new DataContainerInput(); } public ObjectOutput getOutput() { if (currentOutput==null) { currentOutput = new DataContainerOutput(); } return currentOutput; } public ObjectOutput getDirectOutput(DataOutputStream dataOut) { return new DataContainerDirectOutput(dataOut); } public ObjectInput getDirectInput(DataInputStream dataInput) { return new DataContainerDirectInput(dataInput); } public void flush() throws IOException { if (currentOutput!=null) { currentOutput.flushByteArray(); } } class DataContainerDirectOutput implements ObjectsCache.JBossSeralizationOutputInterface { DataOutputStream dataOut; public void addObjectReference(int reference) throws IOException { this.writeInt(reference); } public void openObjectDefinition() throws IOException { } public void closeObjectDefinition() throws IOException { } public void writeByteDirectly(byte parameter) throws IOException { this.write(parameter); } public boolean isCheckSerializableClass() { return DataContainer.this.getCache().isCheckSerializableClass(); } public void writeObject(Object obj) throws IOException { DataContainer.this.cache.setOutput(this); if (cache.getSubstitution()!=null) { obj = cache.getSubstitution().replaceObject(obj); } ObjectDescriptorFactory.describeObject(DataContainer.this.cache,obj); } public void write(byte b[]) throws IOException { dataOut.write(b); } public void close() throws IOException { dataOut.close(); } public DataContainerDirectOutput(DataOutputStream dataOut) { this.dataOut = dataOut; } public void write(int b) throws IOException { dataOut.write(b); } public void write(byte[] b, int off, int len) throws IOException { dataOut.write(b, off, len); } public void flush() throws IOException { dataOut.flush(); } public void writeBoolean(boolean v) throws IOException { dataOut.writeBoolean(v); } public void writeByte(int v) throws IOException { dataOut.writeByte(v); } public void writeShort(int v) throws IOException { dataOut.writeShort(v); } public void writeChar(int v) throws IOException { dataOut.writeChar(v); } public void writeInt(int v) throws IOException { dataOut.writeInt(v); } public void writeLong(long v) throws IOException { dataOut.writeLong(v); } public void writeFloat(float v) throws IOException { dataOut.writeFloat(v); } public void writeDouble(double v) throws IOException { dataOut.writeDouble(v); } public void writeBytes(String s) throws IOException { dataOut.writeBytes(s); } public void writeChars(String s) throws IOException { dataOut.writeChars(s); } public void writeUTF(String str) throws IOException { StringUtil.saveString(dataOut,str,cache.getStringBuffer()); } public int size() { return dataOut.size(); } public void saveImmutable(ObjectsCache cache, Object obj) throws IOException { int id=cache.findIdInCacheWrite(obj); if (id!=0) { this.writeByte(DataContainerConstants.IMMUTABLE_OBJREF); this.addObjectReference(id); return; } id=cache.putObjectInCacheWrite(obj); if (obj instanceof String) { this.writeByte(DataContainerConstants.STRING); this.addObjectReference(id); StringUtil.saveString(this,(String)obj,cache.getStringBuffer()); } else if (obj instanceof Byte) { this.writeByte(DataContainerConstants.BYTE); this.addObjectReference(id); this.writeByte(((Byte)obj).byteValue()); } else if (obj instanceof Character) { this.writeByte(DataContainerConstants.CHARACTER); this.addObjectReference(id); this.writeChar(((Character)obj).charValue()); } else if (obj instanceof Short) { this.writeByte(DataContainerConstants.SHORT); this.addObjectReference(id); this.writeShort(((Short)obj).shortValue()); } else if (obj instanceof Integer) { this.writeByte(DataContainerConstants.INTEGER); this.addObjectReference(id); this.writeInt(((Integer)obj).intValue()); } else if (obj instanceof Long) { this.writeByte(DataContainerConstants.LONG); this.addObjectReference(id); this.writeLong(((Long)obj).longValue()); } else if (obj instanceof Double) { this.writeByte(DataContainerConstants.DOUBLE); this.addObjectReference(id); this.writeDouble(((Double)obj).doubleValue()); } else if (obj instanceof Float) { this.writeByte(DataContainerConstants.FLOAT); this.addObjectReference(id); this.writeFloat(((Float)obj).floatValue()); } else if (obj instanceof BooleanContainer || obj instanceof Boolean) { this.writeByte(DataContainerConstants.BOOLEAN); this.addObjectReference(id); this.writeBoolean(((Boolean)obj).booleanValue()); } else { throw new SerializationException("I don't know how to write type " + obj.getClass().getName() + " yet"); } } } class DataContainerOutput implements ObjectsCache.JBossSeralizationOutputInterface { /** outByte is used to hold writeByte operations until we start doing a different operation */ ByteArrayOutputStream outByte=new ByteArrayOutputStream(); //DataOutputStream dataOutput = null; private void flushByteArray() { if (outByte!=null) { byte controlStreaming[] = outByte.toByteArray(); DataContainer.this.setControlStreaming(controlStreaming); } } /* (non-Javadoc) * @see java.io.ObjectOutput#writeObject(java.lang.Object) */ public void writeObject(Object obj) throws IOException { if (obj==null) { this.writeByte(DataContainerConstants.NULLREF); } else { if (ClassMetamodelFactory.isImmutable(obj.getClass())) { if (cache.getSubstitution()!=null) { obj = cache.getSubstitution().replaceObject(obj); } } DataContainer.this.cache.setOutput(this); ObjectDescriptorFactory.describeObject(DataContainer.this.cache,obj); } } public void addObjectReference(int reference) throws IOException { this.writeInt(reference); } public void saveImmutable(ObjectsCache cache, Object obj) throws IOException { if (obj instanceof String) { this.writeByte(DataContainerConstants.STRING); DataContainer.this.content.add(obj); } else if (obj instanceof Byte) { this.writeByte(DataContainerConstants.BYTE); DataContainer.this.content.add(obj); } else if (obj instanceof Character) { this.writeByte(DataContainerConstants.CHARACTER); DataContainer.this.content.add(obj); } else if (obj instanceof Short) { this.writeByte(DataContainerConstants.SHORT); DataContainer.this.content.add(obj); } else if (obj instanceof Integer) { this.writeByte(DataContainerConstants.INTEGER); DataContainer.this.content.add(obj); } else if (obj instanceof Long) { this.writeByte(DataContainerConstants.LONG); DataContainer.this.content.add(obj); } else if (obj instanceof Double) { this.writeByte(DataContainerConstants.DOUBLE); DataContainer.this.content.add(obj); } else if (obj instanceof Float) { this.writeByte(DataContainerConstants.FLOAT); DataContainer.this.content.add(obj); } else if (obj instanceof BooleanContainer || obj instanceof Boolean) { this.writeByte(DataContainerConstants.BOOLEAN); DataContainer.this.content.add(obj); } else { throw new SerializationException("I don't know how to write type " + obj.getClass().getName() + " yet"); } } public void writeByteDirectly(byte parameter) throws IOException { writeByte(parameter); } public void openObjectDefinition() throws IOException { //TODO: -TME Implement } public void closeObjectDefinition() throws IOException { //TODO: -TME Implement } /* (non-Javadoc) * @see java.io.ObjectOutput#write(int) */ public void write(int b) throws IOException { outByte.write(b); } /* (non-Javadoc) * @see java.io.ObjectOutput#write(byte[]) */ public void write(byte[] b) throws IOException { outByte.write(b); } /* (non-Javadoc) * @see java.io.ObjectOutput#write(byte[], int, int) */ public void write(byte[] b, int off, int len) throws IOException { outByte.write(b,off,len); } /* (non-Javadoc) * @see java.io.ObjectOutput#flush() */ public void flush() throws IOException { flushByteArray(); } /* (non-Javadoc) * @see java.io.ObjectOutput#close() */ public void close() throws IOException { flush(); } /* (non-Javadoc) * @see java.io.DataOutput#writeBoolean(boolean) */ public void writeBoolean(boolean v) throws IOException { content.add(BooleanContainer.valueOf(v)); } /* (non-Javadoc) * @see java.io.DataOutput#writeByte(int) */ public void writeByte(int v) throws IOException { //createByteArray(); outByte.write(v); } /* (non-Javadoc) * @see java.io.DataOutput#writeShort(int) */ public void writeShort(int v) throws IOException { //DataContainer.this.content.add(Short.valueOf((short)v)); DataContainer.this.content.add(new ShortContainer((short)v)); } /* (non-Javadoc) * @see java.io.DataOutput#writeChar(int) */ public void writeChar(int v) throws IOException { //flush(); DataContainer.this.content.add(new CharacterContainer((char)v)); } /* (non-Javadoc) * @see java.io.DataOutput#writeInt(int) */ public void writeInt(int v) throws IOException { //flush(); //DataContainer.this.content.add(Integer.valueOf(v)); DataContainer.this.content.add(new IntegerContainer(v)); } /* (non-Javadoc) * @see java.io.DataOutput#writeLong(long) */ public void writeLong(long v) throws IOException { //flush(); //DataContainer.this.content.add(Long.valueOf(v)); DataContainer.this.content.add(new LongContainer(v)); } /* (non-Javadoc) * @see java.io.DataOutput#writeFloat(float) */ public void writeFloat(float v) throws IOException { //flush(); //DataContainer.this.content.add(Float.valueOf(v)); DataContainer.this.content.add(new FloatContainer(v)); } /* (non-Javadoc) * @see java.io.DataOutput#writeDouble(double) */ public void writeDouble(double v) throws IOException { //flush(); //DataContainer.this.content.add(Double.valueOf(v)); DataContainer.this.content.add(new DoubleContainer(v)); } /* (non-Javadoc) * @see java.io.DataOutput#writeBytes(java.lang.String) */ public void writeBytes(String s) throws IOException { //createByteArray(); char[] chars = s.toCharArray(); for (int i=0;i=content.size()) { throw new EOFException("Unexpected end of repository"); } currentObject = content.get(position); return positionis not part of the public API used only during * the persistence of the meta-model into bytes which happens at {@link org.jboss.serial.objectmetamodel.DataContainer#saveData(DataOutput)} and {@link org.jboss.serial.objectmetamodel.DataContainer#loadData(DataInput))} * * So... Don't use this class * * $Id: DataExport.java,v 1.7 2006/02/24 20:33:10 csuconic Exp $ * @author Clebert Suconic */ public abstract class DataExport { //public abstract void writeMyself(DataOutput output) throws IOException; //public abstract void readMyself(DataInput input) throws IOException; } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/FieldsContainer.java0000644000175000017500000003046110421141242033321 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.objectmetamodel; import org.jboss.serial.finalcontainers.*; import org.jboss.serial.classmetamodel.ClassMetaData; import org.jboss.serial.classmetamodel.ClassMetaDataSlot; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.io.*; /** * $Id: FieldsContainer.java,v 1.9 2006/04/18 18:42:42 csuconic Exp $ * * @author Clebert Suconic */ public class FieldsContainer { ClassMetaDataSlot metaData; protected HashMap fields = new HashMap(); /** both {@link org.jboss.serial.persister.RegularObjectPersister) and writeMyself need to produce the same binary compatible output while * it's not required by RegularObjectPersister to create an intermediate HashMap to read its fields. Becuase of that we * have opted in keep static methods on FieldsContainer that will expose low level persistent operations */ /*public static void writeNumberOfFields(ObjectOutput out, int fields) throws IOException { out.writeInt(fields); } */ /** both {@link org.jboss.serial.persister.RegularObjectPersister) and writeMyself need to produce the same binary compatible output while * it's not required by RegularObjectPersister to create an intermediate HashMap to read its fields. Becuase of that we * have opted in keep static methods on FieldsContainer that will expose low level persistent operations */ public static void writeField(ObjectOutput out, Map.Entry entry) throws IOException { out.writeUTF((String)entry.getKey()); final Object value = entry.getValue(); if (value instanceof FinalContainer) { if (value instanceof BooleanContainer) { out.writeByte(DataContainerConstants.BOOLEAN); out.writeBoolean(((BooleanContainer)value).getValue()); } else if (value instanceof ByteContainer) { out.writeByte(DataContainerConstants.BYTE); out.writeByte(((ByteContainer)value).getValue()); } else if (value instanceof CharacterContainer) { out.writeByte(DataContainerConstants.CHARACTER); out.writeChar(((CharacterContainer)value).getValue()); } else if (value instanceof DoubleContainer) { out.writeByte(DataContainerConstants.DOUBLE); out.writeDouble(((DoubleContainer)value).getValue()); } else if (value instanceof FloatContainer) { out.writeByte(DataContainerConstants.FLOAT); out.writeFloat(((FloatContainer)value).getValue()); } else if (value instanceof IntegerContainer) { out.writeByte(DataContainerConstants.INTEGER); out.writeInt(((IntegerContainer)value).getValue()); } else if (value instanceof LongContainer) { out.writeByte(DataContainerConstants.LONG); out.writeLong(((LongContainer)value).getValue()); } else if (value instanceof ShortContainer) { out.writeByte(DataContainerConstants.SHORT); out.writeShort(((ShortContainer)value).getValue()); } else { throw new RuntimeException ("Unexpected datatype " + value.getClass().getName()); } } else { out.writeByte(DataContainerConstants.OBJECTREF); out.writeObject(value); } } public void writeMyself(ObjectOutput output) throws IOException { output.writeInt(fields.size()); Iterator iter = fields.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); writeField(output,entry); } } /** both {@link org.jboss.serial.persister.RegularObjectPersister) and readMyself need to produce the same binary compatible output while * it's not required by RegularObjectPersister to create an intermediate HashMap to read its fields. Becuase of that we * have opted in keep static methods on FieldsContainer that will expose low level persistent operations */ /*public static int readNumberOfFields(ObjectInput input) throws IOException { return input.readInt(); }*/ public static Map.Entry readField(ObjectInput input) throws IOException,ClassNotFoundException { String name = input.readUTF(); byte datatype = (byte)input.readByte(); Object value = null; switch (datatype) { case DataContainerConstants.BOOLEAN: value = BooleanContainer.valueOf(input.readBoolean()); break; case DataContainerConstants.BYTE: value = new ByteContainer(input.readByte()); break; case DataContainerConstants.CHARACTER: value = new CharacterContainer(input.readChar()); break; case DataContainerConstants.DOUBLE: value = new DoubleContainer(input.readDouble()); break; case DataContainerConstants.FLOAT: value = new FloatContainer(input.readFloat()); break; case DataContainerConstants.INTEGER: value = new IntegerContainer(input.readInt()); break; case DataContainerConstants.LONG: value = new LongContainer(input.readLong()); break; case DataContainerConstants.SHORT: value = new ShortContainer(input.readShort()); break; case DataContainerConstants.OBJECTREF: value = input.readObject(); break; default: throw new RuntimeException("Unexpected datatype " + datatype); } return new EntryImpl(name,value); } public static class EntryImpl implements Map.Entry { private Object key; private Object value; public EntryImpl(Object key, Object value) { this.key=key; this.value=value; } public Object getKey() { return key; } public Object getValue() { return value; } public Object setValue(Object value) { throw new RuntimeException("method not supported"); } } public void readMyself(ObjectInput input) throws IOException,ClassNotFoundException { fields.clear(); int numberOfFields = input.readInt(); for (int i=0;iClebert Suconic */ public interface ObjectSubstitutionInterface { public Object replaceObject(Object obj) throws IOException; } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/objectmetamodel/ObjectsCache.java0000644000175000017500000002036010474543366032607 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.objectmetamodel; import gnu.trove.TIntObjectHashMap; import gnu.trove.TObjectIntHashMap; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import org.jboss.serial.classmetamodel.ClassResolver; import org.jboss.serial.objectmetamodel.safecloning.SafeCloningRepository; import org.jboss.serial.util.ClassMetaConsts; import org.jboss.serial.util.StringUtilBuffer; /** * @author clebert suconic */ public class ObjectsCache extends DataExport implements ClassMetaConsts { final TObjectIntHashMap objectsCacheOnWrite = new TObjectIntHashMap(identityHashStrategy); final TIntObjectHashMap objectsCacheOnRead = new TIntObjectHashMap(); ObjectSubstitutionInterface substitution; ClassLoader loader=null; boolean checkSerializableClass=true; SafeCloningRepository safeToReuse; JBossSeralizationOutputInterface output; JBossSeralizationInputInterface input; StringUtilBuffer stringBuffer; ClassResolver resolver; public ObjectsCache cloneCache() { ObjectsCache newCache = new ObjectsCache(); newCache.substitution = this.substitution; newCache.loader = this.loader; newCache.checkSerializableClass = this.checkSerializableClass; newCache.safeToReuse = this.safeToReuse; newCache.resolver = this.resolver; newCache.stringBuffer=null; return newCache; } private ObjectsCache() { } public ObjectsCache(ObjectSubstitutionInterface substitution, ClassLoader loader, SafeCloningRepository safeToReuse, boolean checkSerializableClass, StringUtilBuffer stringBuffer) { this.loader=loader; this.substitution=substitution; this.checkSerializableClass=checkSerializableClass; this.safeToReuse=safeToReuse; this.stringBuffer=stringBuffer; } public void reset() { if (safeToReuse!=null) { safeToReuse.clear(); } objectsCacheOnWrite.clear(); objectsCacheOnRead.clear(); } public ClassLoader getLoader() { if (loader==null) { return Thread.currentThread().getContextClassLoader(); } else { return loader; } } public void setLoader(ClassLoader loader) { this.loader = loader; } public ObjectSubstitutionInterface getSubstitution() { return substitution; } public void setSubstitution(ObjectSubstitutionInterface substitution) { this.substitution = substitution; } //final HashSet classesCache = new HashSet(); public StringUtilBuffer getStringBuffer() { return stringBuffer; } public void setStringBuffer(StringUtilBuffer stringBuffer) { this.stringBuffer = stringBuffer; } // @todo should stop using ObjectReference public int findIdInCacheWrite(final Object obj) { return objectsCacheOnWrite.get(obj); } /** * @param cacheId * @return */ public Object findObjectInCacheRead(int key) { return objectsCacheOnRead.get(key); } public void putObjectInCacheRead(int key, final Object obj) { objectsCacheOnRead.put(key,obj); } public void reassignObjectInCacheRead(int key, Object value) { objectsCacheOnRead.remove(key); putObjectInCacheRead(key,value); } public int putObjectInCacheWrite(final Object obj) { objectsCacheOnWrite.put(obj,objectsCacheOnWrite.size()+1); return objectsCacheOnWrite.size(); } /*public void putClassMetaData(final ClassMetaData metaData) { classesCache.add(metaData); }*/ /* (non-Javadoc) * @see org.jboss.serial.objectmetamodel.DataExport#writeMyself(java.io.DataOutput) */ // public void writeMyself(DataOutput output) throws IOException // { // // /*output.writeInt(classesCache.size()); // Iterator iter = classesCache.iterator(); // while (iter.hasNext()) // { // ClassMetaData metaData = (ClassMetaData )iter.next(); // output.writeUTF(metaData.getClassName()); // } */ // // output.writeInt(objectsCache.size()); // Iterator iter = objectsCache.entrySet().iterator(); // while (iter.hasNext()) // { // Map.Entry entry = (Map.Entry)iter.next(); // ObjectReference hashKey = (ObjectReference)entry.getKey(); // ObjectDescription value = (ObjectDescription)entry.getValue(); // hashKey.writeMyself(output); // value.writeMyself(output); // } // // } // // /* (non-Javadoc) // * @see org.jboss.serial.objectmetamodel.DataExport#readMyself(java.io.DataInput) // */ // public void readMyself(DataInput input) throws IOException // { // // int size=input.readInt(); // // for (int i=0;iClebert Suconic */ public class ClassReferencePersister implements Persister { byte id; public byte getId() { return id; } public void setId(byte id) { this.id = id; } public void writeData(ClassMetaData clazzMetaData, ObjectOutput output, Object obj, ObjectSubstitutionInterface substitution) throws IOException { Class clazz = (Class)obj; boolean isProxy = clazzMetaData.isProxy(); output.writeBoolean(isProxy); if (isProxy) { Class interfaces[] = clazz.getInterfaces(); output.writeInt(interfaces.length); for (int i=0;iInputStream */ public int available() throws IOException { return 1; } public void close() throws IOException { } public boolean readBoolean() throws IOException { return input.readBoolean(); } public byte readByte() throws IOException { return input.readByte(); } public int readUnsignedByte() throws IOException { return input.readUnsignedByte(); } public char readChar() throws IOException { return input.readChar(); } public short readShort() throws IOException { return input.readShort(); } public int readUnsignedShort() throws IOException { return input.readUnsignedShort(); } public int readInt() throws IOException { return input.readInt(); } public long readLong() throws IOException { return input.readLong(); } public float readFloat() throws IOException { return input.readFloat(); } public double readDouble() throws IOException { return input.readDouble(); } public void readFully(byte[] buf) throws IOException { input.readFully(buf); } public void readFully(byte[] buf, int off, int len) throws IOException { input.readFully(buf, off, len); } public int skipBytes(int len) throws IOException { return input.skipBytes(len); } public String readLine() throws IOException { return input.readLine(); } public String readUTF() throws IOException { return input.readUTF(); } /* * (non-Javadoc) * * @see java.io.ObjectInput#read(byte[]) */ public int read(byte[] b) throws IOException { return input.read(b); } /* * (non-Javadoc) * * @see java.io.ObjectInput#skip(long) */ public long skip(long n) throws IOException { return input.skip(n); } public ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException { FieldsContainer container = new FieldsContainer(currentMetaClass); container.readMyself(this); return container.createGet(); } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/persister/ObjectOutputStreamProxy.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/persister/ObjectOutputStreamProxy.jav0000644000175000017500000001273110416743606033656 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.persister; import org.jboss.serial.exception.SerializationException; import org.jboss.serial.objectmetamodel.FieldsContainer; import org.jboss.serial.objectmetamodel.ObjectSubstitutionInterface; import org.jboss.serial.classmetamodel.ClassMetaData; import org.jboss.serial.classmetamodel.ClassMetaDataSlot; import java.io.IOException; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import java.io.ObjectStreamClass; /** * $Id: ObjectOutputStreamProxy.java,v 1.7 2006/04/11 23:13:09 csuconic Exp $ * @author Clebert Suconic */ public class ObjectOutputStreamProxy extends ObjectOutputStream { Object currentObj; ClassMetaDataSlot currentMetaClass; ObjectSubstitutionInterface currentSubstitution; FieldsContainer currentContainer = null; ObjectOutput bout; public ObjectOutputStreamProxy(ObjectOutput output, Object currentObj, ClassMetaDataSlot currentMetaClass, ObjectSubstitutionInterface currentSubstitution) throws IOException { super(); this.bout=output; this.currentObj=currentObj; this.currentMetaClass=currentMetaClass; this.currentSubstitution=currentSubstitution; } protected void writeObjectOverride(Object obj) throws IOException { bout.writeObject(obj); } public void writeUnshared(Object obj) throws IOException { writeObjectOverride(obj); } public void defaultWriteObject() throws IOException { writeFields(); } public void writeFields() throws IOException { if (currentContainer!=null) { currentContainer.writeMyself(this); currentContainer=null; } else { RegularObjectPersister.writeSlotWithFields(currentMetaClass,bout,currentObj, currentSubstitution); } } public void reset() throws IOException { } protected void writeStreamHeader() throws IOException { } protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { } /** * Writes a byte. This method will block until the byte is actually * written. * * @param val the byte to be written to the stream * @throws IOException If an I/O error has occurred. */ public void write(int val) throws IOException { bout.write(val); } /** * Writes an array of bytes. This method will block until the bytes are * actually written. * * @param buf the data to be written * @throws IOException If an I/O error has occurred. */ public void write(byte[] buf) throws IOException { bout.write(buf); } public void write(byte[] buf, int off, int len) throws IOException { if (buf == null) { throw new SerializationException("buf can't be null"); } bout.write(buf, off, len); } /** * Flushes the stream. This will write any buffered output bytes and flush * through to the underlying stream. * * @throws IOException If an I/O error has occurred. */ public void flush() throws IOException { bout.flush(); } protected void drain() throws IOException { //bout.drain(); } public void close() throws IOException { flush(); bout.close(); } public void writeBoolean(boolean val) throws IOException { bout.writeBoolean(val); } public void writeByte(int val) throws IOException { bout.writeByte(val); } public void writeShort(int val) throws IOException { bout.writeShort(val); } public void writeChar(int val) throws IOException { bout.writeChar(val); } public void writeInt(int val) throws IOException { bout.writeInt(val); } public void writeLong(long val) throws IOException { bout.writeLong(val); } public void writeFloat(float val) throws IOException { bout.writeFloat(val); } public void writeDouble(double val) throws IOException { bout.writeDouble(val); } public void writeBytes(String str) throws IOException { bout.writeBytes(str); } public void writeChars(String str) throws IOException { bout.writeChars(str); } public void writeUTF(String str) throws IOException { bout.writeUTF(str); } public ObjectOutputStream.PutField putFields() throws IOException { currentContainer = new FieldsContainer(currentMetaClass); return currentContainer.createPut(); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/persister/PersistResolver.java0000644000175000017500000000757010441761120032317 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.persister; import org.jboss.serial.classmetamodel.ClassMetaData; /** * @author clebert suconic */ public class PersistResolver { static Persister arrayPersister = new ArrayPersister(); static ExternalizePersister externalizePersister = new ExternalizePersister(); static RegularObjectPersister defaultPersister = new RegularObjectPersister(); static ClassReferencePersister classReferencePersister = new ClassReferencePersister(); static ProxyPersister proxyPersister = new ProxyPersister(); static Persister enumPersister = null; static { try { Class enumClass = Class.forName("java.lang.Enum"); if (enumClass!=null) { try { enumPersister =(Persister)PersistResolver.class.getClassLoader().loadClass("org.jboss.serial.persister.EnumerationPersister").newInstance(); } catch (Exception e) { e.printStackTrace(); } } } catch (Throwable e) { } } static { defaultPersister.setId((byte)1); arrayPersister.setId((byte)2); externalizePersister.setId((byte)3); classReferencePersister.setId((byte)5); proxyPersister.setId((byte)6); if (enumPersister!=null) { enumPersister.setId((byte)7); } } public static Persister resolvePersister(byte id) { switch (id) { case 1: return defaultPersister; case 2: return arrayPersister; case 3: return externalizePersister; case 4: throw new RuntimeException("This persister is not valid any more"); case 5: return classReferencePersister; case 6: return proxyPersister; case 7: if (enumPersister==null) { throw new RuntimeException("This current VM doesn't support Enumerations"); } return enumPersister; default: return defaultPersister; } } public static Persister resolvePersister(Object objToBeSerialized, ClassMetaData metaData) { if (metaData.isArray() && (!(objToBeSerialized instanceof Class))) { return arrayPersister; } else if (objToBeSerialized instanceof Class || metaData.getClazz()==java.lang.Class.class) { return classReferencePersister; } else if (metaData.isExternalizable()) { return externalizePersister; } if (metaData.isProxy()) { return proxyPersister; } else if (enumPersister!=null) { if (enumPersister.canPersist(objToBeSerialized)) { return enumPersister; } else { return defaultPersister; } } else { return defaultPersister; } } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/persister/Persister.java0000644000175000017500000000503610423171624031123 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.persister; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import org.jboss.serial.classmetamodel.ClassMetaData; import org.jboss.serial.classmetamodel.StreamingClass; import org.jboss.serial.objectmetamodel.ObjectSubstitutionInterface; import org.jboss.serial.objectmetamodel.ObjectsCache; /** * Interface used to define how to load complex objects from the repository or streaming * $Id: Persister.java,v 1.11 2006/04/24 23:49:40 csuconic Exp $ * @author clebert suconic */ public interface Persister { /** You need to always return what was sent by setId. This is to enable Streaming to discover what Persister to use */ public byte getId(); public void setId(byte id); public void writeData(ClassMetaData metaData, ObjectOutput out, Object obj, ObjectSubstitutionInterface substitution) throws IOException; /** * * @param loader * @param metaData * @param referenceId * @param cache It's the persister job to assign the cache with a created object, right after its creation, as if in case of circular references those references are respected. * @param input * @param substitution * @return * @throws IOException */ public Object readData (ClassLoader loader, StreamingClass streaming, ClassMetaData metaData, int referenceId, ObjectsCache cache, ObjectInput input, ObjectSubstitutionInterface substitution) throws IOException; /** Ask the persister if the persister can handle this object */ public boolean canPersist(Object obj); } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/persister/ProxyPersister.java0000644000175000017500000000661310423171624032167 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.persister; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Proxy; import org.jboss.serial.classmetamodel.ClassMetaData; import org.jboss.serial.classmetamodel.StreamingClass; import org.jboss.serial.exception.SerializationException; import org.jboss.serial.objectmetamodel.ObjectSubstitutionInterface; import org.jboss.serial.objectmetamodel.ObjectsCache; /** * $Id: ProxyPersister.java,v 1.11 2006/04/24 23:49:40 csuconic Exp $ * * @author Clebert Suconic */ public class ProxyPersister implements Persister { private byte id; public byte getId() { return id; } public void setId(byte id) { this.id = id; } public void writeData(ClassMetaData metaData, ObjectOutput output, Object obj, ObjectSubstitutionInterface substitution) throws IOException{ Object handler = Proxy.getInvocationHandler(obj); output.writeObject(handler); output.writeObject(obj.getClass()); } public Object readData (ClassLoader loader, StreamingClass streaming, ClassMetaData metaData, int referenceId, ObjectsCache cache, ObjectInput input, ObjectSubstitutionInterface substitution) throws IOException{ try { Object handler = input.readObject(); Class proxy = (Class)input.readObject(); Constructor constructor = proxy.getConstructor(new Class[] { InvocationHandler.class }); Object obj = constructor.newInstance(new Object[]{handler}); cache.putObjectInCacheRead(referenceId,obj); return obj; } catch (ClassNotFoundException e) { throw new SerializationException(e); } catch (NoSuchMethodException e) { throw new SerializationException(e); } catch (IllegalAccessException e) { throw new SerializationException(e); } catch (InstantiationException e) { throw new SerializationException(e); } catch (InvocationTargetException e) { throw new SerializationException(e); } } public boolean canPersist(Object obj) { // not implemented return false; } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/persister/RegularObjectPersister.javalibjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/persister/RegularObjectPersister.java0000644000175000017500000003124110425430046033567 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.persister; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.lang.reflect.Field; import org.apache.log4j.Logger; import org.jboss.serial.classmetamodel.ClassMetaData; import org.jboss.serial.classmetamodel.ClassMetaDataSlot; import org.jboss.serial.classmetamodel.ClassMetadataField; import org.jboss.serial.classmetamodel.FieldsManager; import org.jboss.serial.classmetamodel.StreamingClass; import org.jboss.serial.exception.SerializationException; import org.jboss.serial.objectmetamodel.DataContainerConstants; import org.jboss.serial.objectmetamodel.ObjectSubstitutionInterface; import org.jboss.serial.objectmetamodel.ObjectsCache; /** * This is the persister of a regular object. * @author clebert suconic */ public class RegularObjectPersister implements Persister { private static final Logger log = Logger.getLogger(RegularObjectPersister.class); private static final boolean isDebug = log.isDebugEnabled(); byte id; public byte getId() { return id; } public void setId(byte id) { this.id = id; } public void writeData(ClassMetaData metaData, ObjectOutput out, Object obj, ObjectSubstitutionInterface substitution) throws IOException { defaultWrite(out, obj, metaData, substitution); } public static void defaultWrite(ObjectOutput output, Object obj, ClassMetaData metaClass, ObjectSubstitutionInterface substitution) throws IOException { //data.getCache().putClassMetaData(metaClass); ClassMetaDataSlot slots[] = metaClass.getSlots(); if (isDebug) { log.debug("defaultWrite::" + metaClass.getClassName() + " contains " + slots.length + " slots"); } //output.writeInt(slots.length); for (int slotNr=0;slotNr. * */ // This class was taken from Apache commons-collections - // I made it final + removed the "slow" mode... package org.jboss.serial.util; import java.io.Serializable; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Set; /** *

A customized implementation of java.util.HashMap designed * to operate in a multithreaded environment where the large majority of * method calls are read-only, instead of structural changes. * Read calls are non-synchronized and write calls perform the * following steps:

*
    *
  • Clone the existing collection *
  • Perform the modification on the clone *
  • Replace the existing collection with the (modified) clone *
*

NOTE: If you are creating and accessing a * HashMap only within a single thread, you should use * java.util.HashMap directly (with no synchronization), for * maximum performance.

* */ public final class FastHashMap implements Map, Serializable { // ----------------------------------------------------------- Constructors /** * Construct a an empty map. */ public FastHashMap() { super(); this.map = new HashMap(); } /** * Construct an empty map with the specified capacity. * * @param capacity The initial capacity of the empty map */ public FastHashMap(int capacity) { super(); this.map = new HashMap(capacity); } /** * Construct an empty map with the specified capacity and load factor. * * @param capacity The initial capacity of the empty map * @param factor The load factor of the new map */ public FastHashMap(int capacity, float factor) { super(); this.map = new HashMap(capacity, factor); } /** * Construct a new map with the same mappings as the specified map. * * @param map The map whose mappings are to be copied */ public FastHashMap(Map map) { super(); this.map = new HashMap(map); } // ----------------------------------------------------- Instance Variables /** * The underlying map we are managing. */ private HashMap map = null; // --------------------------------------------------------- Public Methods /** * Remove all mappings from this map. */ public void clear() { synchronized (this) { HashMap temp = (HashMap) map.clone(); temp.clear(); map = temp; } } /** * Return a shallow copy of this FastHashMap instance. * The keys and values themselves are not copied. */ public Object clone() { return new FastHashMap(map); } /** * Return true if this map contains a mapping for the * specified key. * * @param key Key to be searched for */ public boolean containsKey(Object key) { return map.containsKey(key); } /** * Return true if this map contains one or more keys mapping * to the specified value. * * @param value Value to be searched for */ public boolean containsValue(Object value) { return map.containsValue(value); } /** * Return a collection view of the mappings contained in this map. Each * element in the returned collection is a Map.Entry. */ public Set entrySet() { return map.entrySet(); } /** * Compare the specified object with this list for equality. This * implementation uses exactly the code that is used to define the * list equals function in the documentation for the * Map.equals method. * * @param o Object to be compared to this list */ public boolean equals(Object o) { // Simple tests that require no synchronization if (o == this) return true; else if ( !(o instanceof Map) ) return false; Map mo = (Map) o; // Compare the two maps for equality if ( mo.size() != map.size() ) return false; java.util.Iterator i = map.entrySet().iterator(); while ( i.hasNext() ) { Map.Entry e = (Map.Entry) i.next(); Object key = e.getKey(); Object value = e.getValue(); if (value == null) { if ( !( mo.get(key) == null && mo.containsKey(key) ) ) return false; } else { if ( !value.equals( mo.get(key) ) ) return false; } } return true; } /** * Return the value to which this map maps the specified key. Returns * null if the map contains no mapping for this key, or if * there is a mapping with a value of null. Use the * containsKey() method to disambiguate these cases. * * @param key Key whose value is to be returned */ public Object get(Object key) { return map.get(key); } /** * Return the hash code value for this map. This implementation uses * exactly the code that is used to define the list hash function in the * documentation for the Map.hashCode method. */ public int hashCode() { int h = 0; java.util.Iterator i = map.entrySet().iterator(); while ( i.hasNext() ) h += i.next().hashCode(); return h; } /** * Return true if this map contains no mappings. */ public boolean isEmpty() { return map.isEmpty(); } /** * Return a set view of the keys contained in this map. */ public Set keySet() { return map.keySet(); } /** * Associate the specified value with the specified key in this map. * If the map previously contained a mapping for this key, the old * value is replaced and returned. * * @param key The key with which the value is to be associated * @param value The value to be associated with this key */ public Object put(Object key, Object value) { synchronized (this) { HashMap temp = (HashMap) map.clone(); Object result = temp.put(key, value); map = temp; return (result); } } /** * Copy all of the mappings from the specified map to this one, replacing * any mappings with the same keys. * * @param in Map whose mappings are to be copied */ public void putAll(Map in) { synchronized (this) { HashMap temp = (HashMap) map.clone(); temp.putAll(in); map = temp; } } /** * Remove any mapping for this key, and return any previously * mapped value. * * @param key Key whose mapping is to be removed */ public Object remove(Object key) { synchronized (this) { HashMap temp = (HashMap) map.clone(); Object result = temp.remove(key); map = temp; return (result); } } /** * Return the number of key-value mappings in this map. */ public int size() { return map.size(); } /** * Return a collection view of the values contained in this map. */ public Collection values() { return map.values(); } public String toString() { return map.toString(); } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/util/HashStringUtil.java0000644000175000017500000000450210423171624031005 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.serial.util; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; import org.apache.log4j.Logger; /** * * This code was extracted from MarshalledInvocation. It converts any string to a unique HashCode * @author Clebert Suconic * */ public class HashStringUtil { private static final Logger log = Logger.getLogger(HashStringUtil.class); private static final boolean isDebug = log.isDebugEnabled(); public static long hashName(String name) { try { long hash=0; ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(512); MessageDigest messagedigest = MessageDigest.getInstance("SHA"); DataOutputStream dataoutputstream = new DataOutputStream(new DigestOutputStream(bytearrayoutputstream, messagedigest)); dataoutputstream.writeUTF(name); dataoutputstream.flush(); byte abyte0[] = messagedigest.digest(); for (int j = 0; j < Math.min(8, abyte0.length); j++) hash += (long) (abyte0[j] & 0xff) << j * 8; if (isDebug) { log.debug("hash on field " + name + " = " + hash); } return hash; } catch (Exception e) { RuntimeException rte = new RuntimeException(e); throw rte; } } } libjboss-serialization-java-1.0.3.GA.orig/src/org/jboss/serial/util/PartitionedWeakHashMap.java0000644000175000017500000000546410421112674032437 0ustar twernertwernerpackage org.jboss.serial.util; import java.util.*; /** This is a WeakHashMap divided into partitions, using a simple algorithm of using the hashCode of a Key % numberOfPartitions to determine what partition to use. * This is intended to minimize synchroniozation affects * @author Clebert Suconic*/ public class PartitionedWeakHashMap extends AbstractMap { boolean issynchronized; Map[] partitionMaps; public PartitionedWeakHashMap() { this(false); } public PartitionedWeakHashMap(boolean issynchronized) { super(); this.issynchronized=issynchronized; partitionMaps = new Map[PARTITION_SIZE]; for (int i=0;iClebert Suconic */ public class StringUtil { static boolean optimizeStrings = true; private static final Logger log = Logger.getLogger(StringUtil.class); private static final boolean isDebug = log.isDebugEnabled(); private static void flushByteBuffer(DataOutput out, byte[] byteBuffer, StringUtilBuffer.Position pos) throws IOException { out.write(byteBuffer,0,pos.pos); pos.pos=0; } public static void saveString(DataOutput out, String str, StringUtilBuffer buffer) throws IOException { if (!optimizeStrings) { saveString(out,str); return; } if (buffer==null) { buffer=StringUtil.getThreadLocalBuffer(); } long len = StringUtil.calculateUTFSize(str,buffer); if (len>0xffff) { out.writeBoolean(true); // the size is bigger than a short value out.writeLong(len); } else { out.writeBoolean(false); out.writeShort((short)len); } if (len == (long) str.length()) { if (len>buffer.byteBuffer.length) { buffer.resizeByteBuffer((int)len); } for (int byteLocation=0;byteLocationClebert Suconic */ public class StringUtilBuffer { /* A way to pass an integer as a parameter to a method */ public static class Position { int pos; long size; public Position reset() { pos=0; size=0; return this; } } Position position = new Position(); public char charBuffer[]; public byte byteBuffer[]; public void resizeCharBuffer(int newSize) { if (newSize<=charBuffer.length) { throw new RuntimeException("New buffer can't be smaller"); } char[] newCharBuffer = new char[newSize]; for (int i=0;iClebert Suconic */ public class Version { private static final String VERSION="1.0.3.GA"; public static void main(String arg[]) { System.out.println(VERSION); } } libjboss-serialization-java-1.0.3.GA.orig/licenses/0000755000175000017500000000000010504501476022106 5ustar twernertwernerlibjboss-serialization-java-1.0.3.GA.orig/licenses/LicenseList.txt0000644000175000017500000000003610426114032025053 0ustar twernertwernerLog4j - apache2.0 Trove - LGPLlibjboss-serialization-java-1.0.3.GA.orig/licenses/apache-2.0.txt0000644000175000017500000002613610426114032024364 0ustar twernertwerner Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. libjboss-serialization-java-1.0.3.GA.orig/licenses/lgpl.txt0000644000175000017500000006347610426114032023614 0ustar twernertwerner GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libjboss-serialization-java-1.0.3.GA.orig/log4j.xml0000644000175000017500000000407610426113754022052 0ustar twernertwerner libjboss-serialization-java-1.0.3.GA.orig/readme.txt0000644000175000017500000000235110462457100022275 0ustar twernertwerner readme.txt - $Version$ LICENSING This software is distributed under the terms of the LGPL license. USING JBOSS SERIALIZATION 1. You just need to instantiate your ObjectOutputStream as new JBossObjectOutputStream, and your input stream as JBossObjectInputStream. 2. You will need to add log4j.jar and trove.jar in your library dependencies, as these classes are used by jboss-serialization. 3. Make sure you also include log4j.xml in your classpath. (If you miss it, DEBUG statements will be used by default what will cause really bad performance serializing your objects) COMPATIBILITY WITH OBJECT SERIALIZATION 1. There is no compatibility between JBossSerialization's and JavaSerialization's protocol. We have made optimizations to the streaming hence the output is not compatible each other. NOTES 1. In case you need support to reset commands, and having multiple objects sharing the same object tree between distinct read and writeObjects, use JBossObjectInputStreamSharedTree 2. There are two MarshalledObjects under org.jboss.serial.io. MarshalledObject and MarshalledObjectForLocalCalls. MarshalledObjectForLocalCalls will use te DataContainer for fast call-by-value operations. More information available at http://www.jboss.org