本文整理汇总了Java中com.rti.dds.publication.PublisherQos类的典型用法代码示例。如果您正苦于以下问题:Java PublisherQos类的具体用法?Java PublisherQos怎么用?Java PublisherQos使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PublisherQos类属于com.rti.dds.publication包,在下文中一共展示了PublisherQos类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPartition
import com.rti.dds.publication.PublisherQos; //导入依赖的package包/类
private void addPartition(
String partition
) {
// get publisher
Publisher publisher = dataWriter.get_publisher();
// get QoS
PublisherQos publisherQos = new PublisherQos();
publisher.get_qos(publisherQos);
// update QoS if necessary
if (!publisherQos.partition.name.contains(partition)) {
publisherQos.partition.name.add(partition);
publisher.set_qos(publisherQos);
}
}
示例2: removePartition
import com.rti.dds.publication.PublisherQos; //导入依赖的package包/类
private void removePartition(
String partition
) {
// get publisher
Publisher publisher = dataWriter.get_publisher();
// get QoS
PublisherQos publisherQos = new PublisherQos();
publisher.get_qos(publisherQos);
// update QoS if necessary
if (publisherQos.partition.name.contains(partition)) {
publisherQos.partition.name.remove(partition);
publisher.set_qos(publisherQos);
}
}
示例3: Publisher
import com.rti.dds.publication.PublisherQos; //导入依赖的package包/类
Publisher(final DomainParticipant domainParticipant,
final com.rider.ddswrapper.configuration.Publisher publisherXML,
final Logger defaultLogger) {
if (publisherXML.getLoggerName() == null) {
logger = defaultLogger;
} else {
logger = Logger.getLogger(publisherXML.getLoggerName());
}
name = publisherXML.getPublisherName();
writers = new HashMap<>();
ddsPublisher = domainParticipant.getDDSDomainParticipant().create_publisher_with_profile(publisherXML.getQoSLibrary(), publisherXML.getQoSProfile(), null, StatusKind.STATUS_MASK_NONE);
if (ddsPublisher == null) {
logger.error("Error creating Publisher (DomainParticipant=\"" + domainParticipant.getName() + "\",Publisher=\"" + publisherXML.getPublisherName() + "\",QoSLibrary=\"" + publisherXML.getQoSLibrary() + "\",QoSProfile=\"" + publisherXML.getQoSProfile() + "\",Partitions=\"" + publisherXML.getPartitionNames() + "\")");
} else {
if (!publisherXML.getPartitionNames().isEmpty()) {
final PublisherQos publisherQoS = new PublisherQos();
ddsPublisher.get_qos(publisherQoS);
publisherXML.getPartitionNames().stream().forEach(partition -> publisherQoS.partition.name.add(partition));
ddsPublisher.set_qos(publisherQoS);
}
logger.info("Created Publisher (DomainParticipant=\"" + domainParticipant.getName() + "\",Publisher=\"" + publisherXML.getPublisherName() + "\",QoSLibrary=\"" + publisherXML.getQoSLibrary() + "\",QoSProfile=\"" + publisherXML.getQoSProfile() + "\",Partitions=\"" + publisherXML.getPartitionNames() + "\")");
publisherXML.getWriter().stream().forEach(writerXML -> {
if (writers.containsKey(writerXML.getWriterName())) {
logger.warn("Publisher (DomainParticipant=\"" + domainParticipant.getName() + "\",Publisher=\"" + publisherXML.getPublisherName() + "\") contains multiple Writers called \"" + writerXML.getWriterName() + "\". Using only the first one");
} else {
writers.put(writerXML.getWriterName(), new Writer(domainParticipant, this, writerXML, logger));
}
});
}
}
示例4: getPublisherQos
import com.rti.dds.publication.PublisherQos; //导入依赖的package包/类
private PublisherQos getPublisherQos(DomainParticipant participant, DdsQosConfiguration config) {
PublisherQos qos = new PublisherQos();
participant.get_default_publisher_qos(qos);
if (config != null && config.isCustom()) {
try {
if (config.getLibrary() != null && config.getProfile() != null) {
DomainParticipantFactory.get_instance().get_publisher_qos_from_profile(qos, config.getLibrary(), config.getProfile());
}
RtiHelper.setQosPolicies(qos, config, getEndpoint().getCamelContext());
} catch (Exception e) {
throw new RuntimeCamelException("Cannot create qos instance from profile", e);
}
}
return qos;
}