Example #1
0
  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;
  }
Example #2
0
  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;
  }
Example #3
0
  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;
  }
Example #4
0
  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;
  }
Example #5
0
  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;
  }
Example #6
0
  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;
  }
Example #7
0
  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;
  }
Example #8
0
  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;
  }
Example #9
0
  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;
  }