本文整理汇总了Java中com.rti.dds.infrastructure.WaitSet类的典型用法代码示例。如果您正苦于以下问题:Java WaitSet类的具体用法?Java WaitSet怎么用?Java WaitSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WaitSet类属于com.rti.dds.infrastructure包,在下文中一共展示了WaitSet类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ReaderWaitset
import com.rti.dds.infrastructure.WaitSet; //导入依赖的package包/类
public ReaderWaitset(final ReaderListener readerListener, final WaitSet waitset, final DataReader reader) {
this.waitset = waitset;
this.readerListener = readerListener;
this.reader = reader;
start();
}
示例2: DiscoveryAdapter
import com.rti.dds.infrastructure.WaitSet; //导入依赖的package包/类
protected DiscoveryAdapter(final DataReader reader) {
this.terminar = false;
this.reader = reader;
this.duracion = new Duration_t(MAX_TIME_SEC, MAX_TIME_NANO);
this.waitset = new WaitSet();
this.waitset.attach_condition(reader.get_statuscondition());
}
示例3: DataCallback
import com.rti.dds.infrastructure.WaitSet; //导入依赖的package包/类
/**
* Crea una nueva instancia para un lector con condición dada.
*
* @param reader Lector del que recibir datos.
* @param condicion Condición a aplicar sobre los datos.
*/
public DataCallback(final DynamicDataReader reader, final int mask) {
this.procesar = true;
this.terminar = false;
this.reader = reader;
this.mask = mask;
this.duracion = new Duration_t(MAX_TIME_SEC, MAX_TIME_NANO);
this.waitset = new WaitSet();
// Le añado el StatusCondition de condición
StatusCondition condicion = reader.get_statuscondition();
condicion.set_enabled_statuses(StatusKind.DATA_AVAILABLE_STATUS);
this.waitset.attach_condition(condicion);
}
示例4: doStart
import com.rti.dds.infrastructure.WaitSet; //导入依赖的package包/类
@Override
protected void doStart() throws Exception {
ddsContext = ((RtiEndpoint)getEndpoint()).createDdsContext();
if (ddsContext == null) {
throw new CamelException("Cannot start RtiPollingConsumer: invalid setup.");
}
// Create the data reader using the default subscriber
DomainParticipant p = ddsContext.getParticipant().getValue();
typeSupport = ddsContext.getParticipant().getRegisteredTypeSupport(ddsContext.getEndpoint().getRegisteredType());
subscriber = p.create_subscriber(
getSubscriberQos(p, ((DdsInstanceData)getEndpoint()).getSubscriberQos()),
null,
StatusKind.STATUS_MASK_NONE);
if (subscriber == null) {
throw new CamelException("Cannot start RtiPollingConsumer: invalid setup.");
}
// create the data reader -- no listener
reader = subscriber.create_datareader(
ddsContext.getTopic().getValue(),
getDataReaderQos(p, ((DdsInstanceData)getEndpoint()).getDataReaderQos()),
null,
StatusKind.STATUS_MASK_NONE);
if (reader == null) {
throw new CamelException("Cannot start RtiPollingConsumer: invalid setup.");
}
// create the WaitSet infrastructure
waitSet = new WaitSet();
statusCond = reader.get_statuscondition();
statusCond.set_enabled_statuses(StatusKind.DATA_AVAILABLE_STATUS);
waitSet.attach_condition(statusCond);
// create object that can be reused when retrieving an instance handle
keyHolder = typeSupport.create_data();
dataSeq = new LoanableSequence(keyHolder.getClass());
infoSeq = new SampleInfoSeq();
LOG.info("RtiPollingConsumer(" + reader.get_topicdescription().get_name() + ") started...");
}