/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); ConnectionControl info = (ConnectionControl)o; info.setClose(dataIn.readBoolean()); info.setExit(dataIn.readBoolean()); info.setFaultTolerant(dataIn.readBoolean()); info.setResume(dataIn.readBoolean()); info.setSuspend(dataIn.readBoolean()); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); ConnectionControl info = (ConnectionControl)o; info.setClose(dataIn.readBoolean()); info.setExit(dataIn.readBoolean()); info.setFaultTolerant(dataIn.readBoolean()); info.setResume(dataIn.readBoolean()); info.setSuspend(dataIn.readBoolean()); }
protected byte[] looseUnmarshalByteArray(DataByteArrayInputStream dataIn) throws IOException { byte rc[] = null; if (dataIn.readBoolean()) { int size = dataIn.readInt(); rc = new byte[size]; dataIn.readFully(rc); } return rc; }
protected byte[] looseUnmarshalByteArray(DataByteArrayInputStream dataIn) throws IOException { byte rc[] = null; if (dataIn.readBoolean()) { int size = dataIn.readInt(); rc = new byte[size]; dataIn.readFully(rc); } return rc; }
public DataStructure looseUnmarshalNestedObject(DataByteArrayInputStream dis) throws IOException { if (dis.readBoolean()) { byte dataType = dis.readByte(); DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[dataType & 0xFF]; if (dsm == null) { throw new IOException("Unknown data type: " + dataType); } DataStructure data = dsm.createObject(); dsm.looseUnmarshal(this, data, dis); return data; } else { return null; } }
public DataStructure looseUnmarshalNestedObject(DataByteArrayInputStream dis) throws IOException { if (dis.readBoolean()) { byte dataType = dis.readByte(); DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[dataType & 0xFF]; if (dsm == null) { throw new IOException("Unknown data type: " + dataType); } DataStructure data = dsm.createObject(); dsm.looseUnmarshal(this, data, dis); return data; } else { return null; } }
protected Buffer looseUnmarshalBuffer(DataByteArrayInputStream dataIn) throws IOException { Buffer rc = null; if (dataIn.readBoolean()) { int size = dataIn.readInt(); byte[] t = new byte[size]; dataIn.readFully(t); rc = new Buffer(t, 0, size); } return rc; } }
protected UTF8Buffer looseUnmarshalString(DataByteArrayInputStream dataIn) throws IOException { if (dataIn.readBoolean()) { int size = dataIn.readShort(); return dataIn.readBuffer(size).utf8(); } else { return null; } }
protected Buffer looseUnmarshalBuffer(DataByteArrayInputStream dataIn) throws IOException { Buffer rc = null; if (dataIn.readBoolean()) { int size = dataIn.readInt(); byte[] t = new byte[size]; dataIn.readFully(t); rc = new Buffer(t, 0, size); } return rc; } }
public void decodeResponse(ClassLoader loader, Class<?> type, DataByteArrayInputStream source, AsyncCallback result) throws IOException, ClassNotFoundException, NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException { if( source.readBoolean() ) { String className = source.readUTF(); String message = source.readUTF(); Throwable error; try { // try to build the exception... Constructor<?> ctr = loader.loadClass(className).getConstructor(new Class[]{String.class}); error = (Throwable) ctr.newInstance(message); } catch (Throwable e) { // fallback to something simple.. error = new RuntimeException(className+": "+message); } result.onFailure(error); } else { result.onSuccess(decodeProtobuf(type, source)); } }
protected UTF8Buffer looseUnmarshalString(DataByteArrayInputStream dataIn) throws IOException { if (dataIn.readBoolean()) { int size = dataIn.readShort(); return dataIn.readBuffer(size).utf8(); } else { return null; } }
@SuppressWarnings("unchecked") public void decodeResponse(ClassLoader loader, Class<?> type, DataByteArrayInputStream source, AsyncCallback result) throws IOException, ClassNotFoundException, NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException { if( source.readBoolean() ) { String className = source.readUTF(); String message = source.readUTF(); Throwable error; try { // try to build the exception... Constructor<?> ctr = loader.loadClass(className).getConstructor(new Class[]{String.class}); error = (Throwable) ctr.newInstance(message); } catch (Throwable e) { // fallback to something simple.. error = new RuntimeException(className+": "+message); } result.onFailure(error); } else { result.onSuccess(decodeProtobuf(type, source)); } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); BaseCommand info = (BaseCommand)o; info.setCommandId(dataIn.readInt()); info.setResponseRequired(dataIn.readBoolean()); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); BaseCommand info = (BaseCommand)o; info.setCommandId(dataIn.readInt()); info.setResponseRequired(dataIn.readBoolean()); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); ConsumerControl info = (ConsumerControl)o; info.setClose(dataIn.readBoolean()); info.setConsumerId((ConsumerId)looseUnmarsalNestedObject(wireFormat, dataIn)); info.setPrefetch(dataIn.readInt()); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); DataArrayResponse info = (DataArrayResponse)o; if (dataIn.readBoolean()) { short size = dataIn.readShort(); DataStructure value[] = new DataStructure[size]; for( int i=0; i < size; i++ ) { value[i] = (DataStructure)looseUnmarsalNestedObject(wireFormat,dataIn); } info.setData(value); } else { info.setData(null); } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); ConsumerControl info = (ConsumerControl)o; info.setClose(dataIn.readBoolean()); info.setConsumerId((ConsumerId)looseUnmarsalNestedObject(wireFormat, dataIn)); info.setPrefetch(dataIn.readInt()); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); DataArrayResponse info = (DataArrayResponse)o; if (dataIn.readBoolean()) { short size = dataIn.readShort(); DataStructure value[] = new DataStructure[size]; for( int i=0; i < size; i++ ) { value[i] = (DataStructure)looseUnmarsalNestedObject(wireFormat,dataIn); } info.setData(value); } else { info.setData(null); } }
protected DataStructure looseUnmarsalCachedObject(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn) throws IOException { if (wireFormat.isCacheEnabled()) { if (dataIn.readBoolean()) { short index = dataIn.readShort(); DataStructure object = wireFormat.looseUnmarshalNestedObject(dataIn); wireFormat.setInUnmarshallCache(index, object); return object; } else { short index = dataIn.readShort(); return wireFormat.getFromUnmarshallCache(index); } } else { return wireFormat.looseUnmarshalNestedObject(dataIn); } }
protected DataStructure looseUnmarsalCachedObject(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn) throws IOException { if (wireFormat.isCacheEnabled()) { if (dataIn.readBoolean()) { short index = dataIn.readShort(); DataStructure object = wireFormat.looseUnmarshalNestedObject(dataIn); wireFormat.setInUnmarshallCache(index, object); return object; } else { short index = dataIn.readShort(); return wireFormat.getFromUnmarshallCache(index); } } else { return wireFormat.looseUnmarshalNestedObject(dataIn); } }