public interface Liveliness extends QosPolicy.ForTopic, QosPolicy.ForDataReader, QosPolicy.ForDataWriter, RequestedOffered<Liveliness>
Entity
is "active" (alive). The "liveliness"
status of an Entity is used to maintain instance ownership in combination
with the setting of the Ownership
. The application is
also informed via an Entity Status
change when an Entity is no
longer alive. The DataReader
requests that liveliness of the
writers is maintained by the requested means and loss of liveliness is
detected with delay not to exceed the leaseDuration. The DataWriter
commits to signaling its liveliness using the stated means at intervals
not to exceed the leaseDuration. The default kind is
Liveliness.Kind.AUTOMATIC
and the default value of the
leaseDuration is infinite.
Concerns: Topic
, DataReader
, DataWriter
RxO: Yes
Changeable: No
This policy has several settings to support both data objects that are
updated periodically as well as those that are changed sporadically. It
also allows customizing for different application requirements in terms of
the kinds of failures that will be detected by the liveliness mechanism.
The Liveliness.Kind.AUTOMATIC
liveliness setting is most appropriate for
applications that only need to detect failures at the process level, but
not application-logic failures within a process. The Service takes
responsibility for renewing the leases at the required rates and thus, as
long as the local process where a DomainParticipant
is running and
the link connecting it to remote participants remains connected, the
entities within the DomainParticipant will be considered alive. This
requires the lowest overhead.
The MANUAL settings (Liveliness.Kind.MANUAL_BY_PARTICIPANT
,
Liveliness.Kind.MANUAL_BY_TOPIC
) require the application on the publishing
side to periodically assert the liveliness before the lease expires to
indicate the corresponding Entity is still alive. The action can be
explicit by calling the assertLiveliness
operations
(DataWriter.assertLiveliness()
,
DomainParticipant.assertLiveliness()
) or implicit by writing some
data.
The two possible manual settings control the granularity at which the
application must assert liveliness.
AUTOMATIC < MANUAL_BY_PARTICIPANT < MANUAL_BY_TOPIC
.LivelinessChangedStatus
is updated at least once
during each leaseDuration and the related Listeners and WaitSet
s
are notified within a leaseDuration from the time the LIVELINESS changed.Modifier and Type | Interface and Description |
---|---|
static class |
Liveliness.Kind |
QosPolicy.ForDataReader, QosPolicy.ForDataWriter, QosPolicy.ForDomainParticipant, QosPolicy.ForDomainParticipantFactory, QosPolicy.ForPublisher, QosPolicy.ForSubscriber, QosPolicy.ForTopic
Modifier and Type | Method and Description |
---|---|
Liveliness.Kind |
getKind() |
Duration |
getLeaseDuration() |
Liveliness |
withAutomatic() |
Liveliness |
withKind(Liveliness.Kind kind)
Copy this policy and override the value of the property.
|
Liveliness |
withLeaseDuration(Duration leaseDuration)
Copy this policy and override the value of the property.
|
Liveliness |
withLeaseDuration(long leaseDuration,
TimeUnit unit)
Copy this policy and override the value of the property.
|
Liveliness |
withManualByParticipant() |
Liveliness |
withManualByTopic() |
getEnvironment
requestedOfferedContract
compareTo
Liveliness.Kind getKind()
Duration getLeaseDuration()
Liveliness withKind(Liveliness.Kind kind)
Liveliness withLeaseDuration(Duration leaseDuration)
Liveliness withLeaseDuration(long leaseDuration, TimeUnit unit)
Liveliness withAutomatic()
Liveliness withManualByParticipant()
Liveliness withManualByTopic()
Copyright © 2014. All rights reserved.