コード例 #1
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Sample snapshotTake(Snapshot snapshot)
      throws CommunicationException, DataTypeUnsupportedException {
    Sample s = null;
    this.checkConnection();

    try {
      String xmlSnapshot = snapshotSerializer.serializeSnapshot(snapshot);
      String xmlSample = this.jniSnapshotTake(xmlSnapshot);
      this.checkConnection();
      s = untypedSampleDeserializer.deserializeSample(xmlSample, snapshot.getUserDataType());
    } catch (TransformationException e) {
      throw new CommunicationException("Could not take from snapshot.");
    } catch (CMException ce) {
      throw new CommunicationException(ce.getMessage());
    }
    return s;
  }
コード例 #2
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Sample readerTake(Reader reader)
      throws CommunicationException, DataTypeUnsupportedException {
    Sample result = null;
    this.checkConnection();

    try {
      String xmlEntity = entitySerializer.serializeEntity(reader);
      String xmlSample = this.jniReaderTake(xmlEntity);
      this.checkConnection();
      result = untypedSampleDeserializer.deserializeSample(xmlSample, reader.getDataType());
    } catch (CMException e) {
      throw new CommunicationException(e.getMessage());
    } catch (TransformationException e) {
      throw new CommunicationException("Could not take sample.");
    }
    return result;
  }
コード例 #3
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Sample readerReadNext(Reader reader, GID instanceGID)
      throws CommunicationException, DataTypeUnsupportedException {
    Sample result = null;
    this.checkConnection();

    try {
      String xmlEntity = entitySerializer.serializeEntity(reader);
      String xmlSample =
          this.jniReaderReadNext(
              xmlEntity,
              Long.toString(instanceGID.getLocalId()),
              Long.toString(instanceGID.getSystemId()));
      this.checkConnection();
      result = untypedSampleDeserializer.deserializeSample(xmlSample, reader.getDataType());
    } catch (CMException e) {
      throw new CommunicationException(e.getMessage());
    } catch (TransformationException e) {
      throw new CommunicationException("Could not read next sample.");
    }
    return result;
  }