Example #1
0
  public Object readMap(AbstractHessianInput in, Object obj) throws IOException {
    try {
      int ref = in.addRef(obj);

      while (!in.isEnd()) {
        Object key = in.readObject();

        FieldDeserializer deser = (FieldDeserializer) _fieldMap.get(key);

        if (deser != null) deser.deserialize(in, obj);
        else in.readObject();
      }

      in.readMapEnd();

      Object resolve = resolve(obj);

      if (obj != resolve) in.setRef(ref, resolve);

      return resolve;
    } catch (IOException e) {
      throw e;
    } catch (Exception e) {
      throw new IOExceptionWrapper(e);
    }
  }
Example #2
0
  public Object readObject(AbstractHessianInput in, Object obj, String[] fieldNames)
      throws IOException {
    try {
      int ref = in.addRef(obj);

      for (int i = 0; i < fieldNames.length; i++) {
        String name = fieldNames[i];

        FieldDeserializer deser = (FieldDeserializer) _fieldMap.get(name);

        if (deser != null) deser.deserialize(in, obj);
        else in.readObject();
      }

      Object resolve = resolve(obj);

      if (obj != resolve) in.setRef(ref, resolve);

      return resolve;
    } catch (IOException e) {
      throw e;
    } catch (Exception e) {
      throw new IOExceptionWrapper(obj.getClass().getName() + ":" + e, e);
    }
  }
Example #3
0
    void deserialize(AbstractHessianInput in, Object obj) throws IOException {
      Object value = null;

      try {
        value = in.readObject(_field.getType());

        _field.set(obj, value);
      } catch (Exception e) {
        logDeserializeError(_field, obj, value, e);
      }
    }
Example #4
0
    void deserialize(AbstractHessianInput in, Object obj) throws IOException {
      java.sql.Time value = null;

      try {
        java.util.Date date = (java.util.Date) in.readObject();
        value = new java.sql.Time(date.getTime());

        _field.set(obj, value);
      } catch (Exception e) {
        logDeserializeError(_field, obj, value, e);
      }
    }