public interface Lifespan extends QosPolicy.ForTopic, QosPolicy.ForDataWriter
DataWriter
. The default value of the lifespan duration is infinite.
Concerns: Topic
, DataWriter
RxO: N/A
Changeable: Yes
The purpose of this QoS is to avoid delivering "stale" data to the
application.
Each data sample written by the DataWriter has an associated "expiration
time" beyond which the data should not be delivered to any application.
Once the sample expires, the data will be removed from the DataReader
caches as well as from the transient and persistent information caches.
The "expiration time" of each sample is computed by adding the duration
specified by the LIFESPAN QoS to the source time stamp. As described in
DataWriter.write(Object)
and
DataWriter.write(Object, org.omg.dds.core.Time)
, the source time
stamp is either automatically computed by the Service each time the
write operation is called, or else supplied by the application.
This QoS relies on the sender and receiving applications having their
clocks sufficiently synchronized. If this is not the case and the Service
can detect it, the DataReader is allowed to use the reception time stamp
instead of the source time stamp in its computation of the "expiration
time."QosPolicy.ForDataReader, QosPolicy.ForDataWriter, QosPolicy.ForDomainParticipant, QosPolicy.ForDomainParticipantFactory, QosPolicy.ForPublisher, QosPolicy.ForSubscriber, QosPolicy.ForTopic
Modifier and Type | Method and Description |
---|---|
Duration |
getDuration() |
Lifespan |
withDuration(Duration duration)
Copy this policy and override the value of the property.
|
Lifespan |
withDuration(long duration,
TimeUnit unit)
Copy this policy and override the value of the property.
|
getEnvironment
Copyright © 2014. All rights reserved.