コード例 #1
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Topic[] participantFindTopic(Participant participant, String topicName)
      throws CommunicationException {
    Topic[] result = null;
    this.checkConnection();

    try {
      String xmlEntity = entitySerializer.serializeEntity(participant);
      String xmlEntities = this.jniParticipantFindTopic(xmlEntity, topicName);
      this.checkConnection();
      Entity[] entityResult = entityDeserializer.deserializeEntityList(xmlEntities);

      if (entityResult != null) {
        result = new Topic[entityResult.length];

        for (int i = 0; i < entityResult.length; i++) {
          result[i] = (Topic) (entityResult[i]);
        }
      } else {
        throw new CommunicationException("Could not find topic.");
      }
    } catch (TransformationException e) {
      throw new CommunicationException("Could not find topic.");
    }
    return result;
  }
コード例 #2
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Entity[] waitsetTimedWait(Waitset waitset, Time time) throws CommunicationException {
    Entity[] result = null;
    this.checkConnection();

    try {
      String xmlWaitset = entitySerializer.serializeEntity(waitset);
      String xmlEntities = this.jniWaitsetTimedWait(xmlWaitset, time.sec, time.nsec);
      this.checkConnection();

      Entity[] entityResult = entityDeserializer.deserializeEntityList(xmlEntities);

      if (entityResult != null) {
        result = new Entity[entityResult.length];

        for (int i = 0; i < entityResult.length; i++) {
          result[i] = entityResult[i];
        }
      } else {
        throw new CommunicationException("waitsetTimedWait failed (2)");
      }
    } catch (TransformationException e) {
      throw new CommunicationException("waitsetTimedWait failed");
    }
    return result;
  }
コード例 #3
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Partition partitionNew(Participant p, String name) throws CommunicationException {
    Partition dom;
    this.checkConnection();

    try {
      String xmlEntity = entitySerializer.serializeEntity(p);
      String xmlDom = this.jniDomainNew(xmlEntity, name);
      this.checkConnection();
      dom = (Partition) (entityDeserializer.deserializeEntity(xmlDom));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not create partition.");
    }
    return dom;
  }
コード例 #4
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public ServiceState serviceGetState(Service service) throws CommunicationException {
    ServiceState state;
    this.checkConnection();

    try {
      String xmlEntity = entitySerializer.serializeEntity(service);
      String xmlState = this.jniGetServiceState(xmlEntity);
      this.checkConnection();
      state = (ServiceState) (entityDeserializer.deserializeEntity(xmlState));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not resolve service state.");
    }
    return state;
  }
コード例 #5
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Waitset waitsetNew(Participant participant) throws CommunicationException {
    Waitset waitset = null;

    this.checkConnection();

    try {
      String xmlEntity = entitySerializer.serializeEntity(participant);
      String xmlWaitset = this.jniWaitsetNew(xmlEntity);
      this.checkConnection();
      waitset = (Waitset) (entityDeserializer.deserializeEntity(xmlWaitset));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not create waitset.");
    }
    return waitset;
  }
コード例 #6
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Query queryNew(Reader source, String name, String expression)
      throws CommunicationException {
    Query q;
    this.checkConnection();

    try {
      String xmlRea = entitySerializer.serializeEntity(source);
      String xmlResult = this.jniQueryNew(xmlRea, name, expression);
      this.checkConnection();
      q = (Query) (entityDeserializer.deserializeEntity(xmlResult));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not create query.");
    }
    return q;
  }
コード例 #7
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Entity[] entityDependantEntities(Entity entity, EntityFilter filter)
      throws CommunicationException {
    Entity[] result = null;
    this.checkConnection();

    try {
      String xmlEntity = entitySerializer.serializeEntity(entity);
      String xmlEntities = this.jniGetDependantEntities(xmlEntity, EntityFilter.getString(filter));
      this.checkConnection();
      result = entityDeserializer.deserializeEntityList(xmlEntities);
    } catch (TransformationException e) {
      throw new CommunicationException("Could not resolve dependant entities.");
    }
    return result;
  }
コード例 #8
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Participant participantNew(String uri, int timeout, String name, ParticipantQoS qos)
      throws CommunicationException {
    Participant participant;
    String xmlQos = null;
    this.checkConnection();

    try {
      if (qos != null) {
        xmlQos = qosSerializer.serializeQoS(qos);
      }
      String xmlEntity = this.jniCreateParticipant(uri, timeout, name, xmlQos);
      this.checkConnection();
      participant = (Participant) (entityDeserializer.deserializeEntity(xmlEntity));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not create participant");
    }
    return participant;
  }
コード例 #9
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Topic topicNew(Participant p, String name, String typeName, String keyList, TopicQoS qos)
      throws CommunicationException {
    Topic top;
    String xmlQos = null;
    this.checkConnection();

    try {
      if (qos != null) {
        xmlQos = qosSerializer.serializeQoS(qos);
      }
      String xmlEntity = entitySerializer.serializeEntity(p);
      String xmlTop = this.jniTopicNew(xmlEntity, name, typeName, keyList, xmlQos);
      this.checkConnection();
      top = (Topic) (entityDeserializer.deserializeEntity(xmlTop));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not create topic.");
    }
    return top;
  }
コード例 #10
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public DataReader dataReaderNew(Subscriber s, String name, String viewExpression, ReaderQoS qos)
      throws CommunicationException {
    DataReader dr;
    String xmlQos = null;
    this.checkConnection();

    try {
      if (qos != null) {
        xmlQos = qosSerializer.serializeQoS(qos);
      }
      String xmlSub = entitySerializer.serializeEntity(s);
      String xmlResult = this.jniCreateDataReader(xmlSub, name, viewExpression, xmlQos);
      this.checkConnection();
      dr = (DataReader) (entityDeserializer.deserializeEntity(xmlResult));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not create datareader.");
    }
    return dr;
  }
コード例 #11
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Subscriber subscriberNew(Participant p, String name, SubscriberQoS qos)
      throws CommunicationException {
    Subscriber sub;
    String xmlQos = null;
    this.checkConnection();

    try {
      if (qos != null) {
        xmlQos = qosSerializer.serializeQoS(qos);
      }
      String xmlEntity = entitySerializer.serializeEntity(p);
      String xmlSub = this.jniSubscriberNew(xmlEntity, name, xmlQos);
      this.checkConnection();
      sub = (Subscriber) (entityDeserializer.deserializeEntity(xmlSub));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not create subscriber.");
    }
    return sub;
  }
コード例 #12
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Writer writerNew(Publisher p, String name, Topic t, WriterQoS qos)
      throws CommunicationException {
    Writer wri;
    String xmlQos = null;
    this.checkConnection();

    try {
      if (qos != null) {
        xmlQos = qosSerializer.serializeQoS(qos);
      }
      String xmlEntity = entitySerializer.serializeEntity(p);
      String xmlTopic = entitySerializer.serializeEntity(t);
      String xmlResult = this.jniCreateWriter(xmlEntity, name, xmlTopic, xmlQos);
      this.checkConnection();
      wri = (Writer) (entityDeserializer.deserializeEntity(xmlResult));
    } catch (TransformationException e) {
      throw new CommunicationException("Could not create writer.");
    }
    return wri;
  }
コード例 #13
0
ファイル: JniCommunicator.java プロジェクト: xrl/opensplice
  public Partition[] participantAllDomains(Participant p) throws CommunicationException {
    Partition[] result = null;
    this.checkConnection();

    try {
      String xmlEntity = entitySerializer.serializeEntity(p);
      String xmlEntities = this.jniParticipantAllDomains(xmlEntity);
      this.checkConnection();
      Entity[] entityResult = entityDeserializer.deserializeEntityList(xmlEntities);

      if (entityResult != null) {
        result = new Partition[entityResult.length];

        for (int i = 0; i < entityResult.length; i++) {
          result[i] = (Partition) (entityResult[i]);
        }
      } else {
        throw new CommunicationException("Could not resolve all partitions");
      }
    } catch (TransformationException e) {
      throw new CommunicationException("Could not resolve all partitions");
    }
    return result;
  }