コード例 #1
0
    public void beginUnmarshalCustomValue(
        InputStreamHook stream, boolean calledDefaultWriteObject, boolean hasReadObject)
        throws IOException {

      if (hasReadObject) {
        if (calledDefaultWriteObject) stream.setState(IN_READ_OBJECT_DEFAULTS_SENT);
        else {
          try {
            if (stream.getStreamFormatVersion() == 2)
              ((ValueInputStream) stream.getOrbStream()).start_value();
          } catch (Exception e) {
            // This will happen for Big Integer which uses
            // writeFields in it's writeObject. We should be past
            // start_value by now.
            // NOTE: If we don't log any exception here we should
            // be fine. If there is an error, it will be caught
            // while reading the optional data.

          }
          stream.setState(IN_READ_OBJECT_OPT_DATA);
        }
      } else {
        if (calledDefaultWriteObject) stream.setState(NO_READ_OBJECT_DEFAULTS_SENT);
        else
          // XXX I18N and logging needed.
          throw new StreamCorruptedException("No default data sent");
      }
    }
コード例 #2
0
    public void endDefaultReadObject(InputStreamHook stream) throws IOException {

      // Read the fake valuetype header in stream format version 2
      if (stream.getStreamFormatVersion() == 2)
        ((ValueInputStream) stream.getOrbStream()).start_value();

      stream.setState(IN_READ_OBJECT_OPT_DATA);
    }
コード例 #3
0
    public void endUnmarshalCustomValue(InputStreamHook stream) throws IOException {
      // Code should read default fields before calling this

      if (stream.getStreamFormatVersion() == 2) {
        ((ValueInputStream) stream.getOrbStream()).start_value();
        ((ValueInputStream) stream.getOrbStream()).end_value();
      }

      stream.setState(DEFAULT_STATE);
    }
コード例 #4
0
    public void endUnmarshalCustomValue(InputStreamHook stream) {

      // In stream format version 2, we can skip over
      // the optional data this way.  In stream format version 1,
      // we will probably wind up with an error if we're
      // unmarshaling a superclass.
      if (stream.getStreamFormatVersion() == 2) {
        ((ValueInputStream) stream.getOrbStream()).start_value();
        ((ValueInputStream) stream.getOrbStream()).end_value();
      }

      stream.setState(DEFAULT_STATE);
    }
コード例 #5
0
    public void readData(InputStreamHook stream) throws IOException {
      org.omg.CORBA.ORB orb = stream.getOrbStream().orb();
      if ((orb == null) || !(orb instanceof com.sun.corba.se.spi.orb.ORB)) {
        throw new StreamCorruptedException("Default data must be read first");
      }
      ORBVersion clientOrbVersion = ((com.sun.corba.se.spi.orb.ORB) orb).getORBVersion();

      // Fix Date interop bug. For older versions of the ORB don't do
      // anything for readData(). Before this used to throw
      // StreamCorruptedException for older versions of the ORB where
      // calledDefaultWriteObject always returns true.
      if ((ORBVersionFactory.getPEORB().compareTo(clientOrbVersion) <= 0)
          || (clientOrbVersion.equals(ORBVersionFactory.getFOREIGN()))) {
        // XXX I18N and logging needed.
        throw new StreamCorruptedException("Default data must be read first");
      }
    }
コード例 #6
0
 public void readData(InputStreamHook stream) throws IOException {
   stream.throwOptionalDataIncompatibleException();
 }
コード例 #7
0
 public void endUnmarshalCustomValue(InputStreamHook stream) throws IOException {
   if (stream.getStreamFormatVersion() == 2) {
     ((ValueInputStream) stream.getOrbStream()).end_value();
   }
   stream.setState(DEFAULT_STATE);
 }
コード例 #8
0
 public void endDefaultReadObject(InputStreamHook stream) {
   stream.setState(IN_READ_OBJECT_PAST_DEFAULTS_REMOTE_NOT_CUSTOM);
 }