OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org.omg.dds.core.policy.Liveliness Interface Reference

Determines the mechanism and parameters used by the application to determine whether an org.omg.dds.core.Entity is "active" (alive). More...

Inheritance diagram for org.omg.dds.core.policy.Liveliness:
Inheritance graph
Collaboration diagram for org.omg.dds.core.policy.Liveliness:
Collaboration graph

Classes

enum  Kind
 

Public Member Functions

ServiceEnvironment getEnvironment ()
 
Kind getKind ()
 
Duration getLeaseDuration ()
 
Comparable< SELF > requestedOfferedContract ()
 Use the object returned by this method to evaluate the Request/Offer relationship with another instance of this policy. More...
 
Liveliness withAutomatic ()
 
Liveliness withKind (Kind kind)
 Copy this policy and override the value of the property. More...
 
Liveliness withLeaseDuration (Duration leaseDuration)
 Copy this policy and override the value of the property. More...
 
Liveliness withLeaseDuration (long leaseDuration, TimeUnit unit)
 Copy this policy and override the value of the property. More...
 
Liveliness withManualByParticipant ()
 
Liveliness withManualByTopic ()
 

Detailed Description

Determines the mechanism and parameters used by the application to determine whether an org.omg.dds.core.Entity is "active" (alive).

The "liveliness" status of an Entity is used to maintain instance ownership in combination with the setting of the org.omg.dds.core.policy.Ownership . The application is also informed via an Entity org.omg.dds.core.status.Status change when an Entity is no longer alive. The org.omg.dds.sub.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 org.omg.dds.pub.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: org.omg.dds.topic.Topic, org.omg.dds.sub.DataReader, org.omg.dds.pub.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 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 org.omg.dds.domain.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 (Kind#MANUAL_BY_PARTICIPANT, 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 ( org.omg.dds.pub.DataWriter#assertLiveliness(), org.omg.dds.domain.DomainParticipant#assertLiveliness()) or implicit by writing some data.

The two possible manual settings control the granularity at which the application must assert liveliness.

  • The setting MANUAL_BY_PARTICIPANT requires only that one Entity within the publisher is asserted to be alive to deduce all other Entity objects within the same DomainParticipant are also alive.
  • The setting MANUAL_BY_TOPIC requires that at least one instance within the DataWriter is asserted.

The value offered is considered compatible with the value requested if and only if the following conditions are met:

  1. the inequality "offered kind &gt;= requested kind" evaluates to true. For the purposes of this inequality, the values of LIVELINESS kind are considered ordered such that: AUTOMATIC < MANUAL_BY_PARTICIPANT < MANUAL_BY_TOPIC .
  2. the inequality "offered leaseDuration &lt;= requested leaseDuration" evaluates to true.

Changes in LIVELINESS must be detected by the Service with a time granularity greater or equal to the leaseDuration. This ensures that the value of the org.omg.dds.core.status.LivelinessChangedStatus is updated at least once during each leaseDuration and the related Listeners and org.omg.dds.core.WaitSets are notified within a leaseDuration from the time the LIVELINESS changed.

Definition at line 102 of file Liveliness.java.

Member Function Documentation

◆ getEnvironment()

ServiceEnvironment org.omg.dds.core.DDSObject.getEnvironment ( )
inherited
Returns
the org.omg.dds.core.ServiceEnvironment object that directly or indirectly was used to create this object.

Implemented in org.omg.dds.core.ServiceEnvironment, org.opensplice.dds.sub.ReflectionDataReader< TYPE, OUT_TYPE >, org.opensplice.dds.core.ModifiableTimeImpl, org.opensplice.dds.pub.ReflectionDataWriter< TYPE >, org.opensplice.dds.core.DurationImpl, org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >, org.opensplice.dds.sub.ReadConditionImpl< TYPE >, org.opensplice.dds.core.EntityQosImpl< T extends QosPolicy >, org.opensplice.dds.type.TypeSupportImpl< TYPE >, org.opensplice.dds.topic.PublicationBuiltinTopicDataImpl, org.opensplice.dds.topic.SubscriptionBuiltinTopicDataImpl, org.opensplice.dds.topic.TopicBuiltinTopicDataImpl, org.opensplice.dds.domain.DomainParticipantFactoryImpl, org.opensplice.dds.core.QosProviderImpl, org.opensplice.dds.core.status.OfferedIncompatibleQosStatusImpl, org.opensplice.dds.core.status.RequestedIncompatibleQosStatusImpl, org.opensplice.dds.core.InstanceHandleImpl, org.opensplice.dds.core.StatusConditionImpl< T extends Entity<?, ?>, org.opensplice.dds.core.status.LivelinessChangedStatusImpl, org.opensplice.dds.core.status.PublicationMatchedStatusImpl, org.opensplice.dds.core.status.SubscriptionMatchedStatusImpl, org.opensplice.dds.sub.SampleImpl< TYPE >, org.opensplice.dds.core.policy.ShareImpl, org.opensplice.dds.core.status.OfferedDeadlineMissedStatusImpl, org.opensplice.dds.core.status.SampleRejectedStatusImpl, org.opensplice.dds.core.WaitSetImpl, org.opensplice.dds.topic.ParticipantBuiltinTopicDataImpl, org.opensplice.dds.core.status.RequestedDeadlineMissedStatusImpl, org.opensplice.dds.topic.BuiltinTopicKeyImpl, org.opensplice.dds.core.GuardConditionImpl, org.opensplice.dds.core.event.AllDataDisposedEventImpl< TYPE >, org.opensplice.dds.core.policy.QosPolicyCountImpl, org.opensplice.dds.core.status.InconsistentTopicStatusImpl, org.opensplice.dds.core.status.LivelinessLostStatusImpl, org.opensplice.dds.core.status.SampleLostStatusImpl, org.opensplice.dds.core.policy.QosPolicyImpl, org.opensplice.dds.core.status.AllDataDisposedStatusImpl, org.opensplice.dds.core.IllegalArgumentExceptionImpl, org.opensplice.dds.core.InconsistentPolicyExceptionImpl, org.opensplice.dds.core.policy.PolicyFactoryImpl, org.opensplice.dds.core.policy.TypeConsistencyEnforcementImpl, org.opensplice.dds.core.PreconditionNotMetExceptionImpl, org.opensplice.dds.core.AlreadyClosedExceptionImpl, org.opensplice.dds.core.IllegalOperationExceptionImpl, org.opensplice.dds.core.ImmutablePolicyExceptionImpl, org.opensplice.dds.core.NotEnabledExceptionImpl, org.opensplice.dds.core.OutOfResourcesExceptionImpl, org.opensplice.dds.core.DDSExceptionImpl, org.opensplice.dds.core.status.DataAvailableStatusImpl, and org.opensplice.dds.core.status.DataOnReadersStatusImpl.

◆ getKind()

Kind org.omg.dds.core.policy.Liveliness.getKind ( )
Returns
the kind

Implemented in org.opensplice.dds.core.policy.LivelinessImpl.

◆ getLeaseDuration()

Duration org.omg.dds.core.policy.Liveliness.getLeaseDuration ( )
Returns
the lease duration

Implemented in org.opensplice.dds.core.policy.LivelinessImpl.

◆ requestedOfferedContract()

Comparable<SELF> org.omg.dds.core.policy.RequestedOffered< SELF >.requestedOfferedContract ( )
inherited

Use the object returned by this method to evaluate the Request/Offer relationship with another instance of this policy.

If this policy is offered by a org.omg.dds.pub.DataWriter (or org.omg.dds.pub.Publisher), any other policy evaluated as less than or equal to it by the Comparable may be compatibly requested by a org.omg.dds.sub.DataReader (or org.omg.dds.sub.Subscriber). Similarly, if this policy is requested, any other policy that is greater than or equal to it may be compatibly offered.

Returns
a Comparable object capable of evaluating the Request/Offer relationship between two instances of the QoS policy identified by the type parameter SELF.

◆ withAutomatic()

Liveliness org.omg.dds.core.policy.Liveliness.withAutomatic ( )
Returns
Liveliness automatic policy

Implemented in org.opensplice.dds.core.policy.LivelinessImpl.

◆ withKind()

Liveliness org.omg.dds.core.policy.Liveliness.withKind ( Kind  kind)

Copy this policy and override the value of the property.

Parameters
kindSpecifies the way the liveliness of an Entity is determined
Returns
a new Liveliness policy

Implemented in org.opensplice.dds.core.policy.LivelinessImpl.

◆ withLeaseDuration() [1/2]

Liveliness org.omg.dds.core.policy.Liveliness.withLeaseDuration ( Duration  leaseDuration)

Copy this policy and override the value of the property.

Parameters
leaseDurationSpecifies the duration of the interval within which the liveliness must be determined.
Returns
a new Liveliness policy

Implemented in org.opensplice.dds.core.policy.LivelinessImpl.

◆ withLeaseDuration() [2/2]

Liveliness org.omg.dds.core.policy.Liveliness.withLeaseDuration ( long  leaseDuration,
TimeUnit  unit 
)

Copy this policy and override the value of the property.

Parameters
leaseDurationSpecifies a long leaseDuration for the interval within which the liveliness must be determined.
unitThe TimeUnit which the duration describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Returns
a new Liveliness policy

Implemented in org.opensplice.dds.core.policy.LivelinessImpl.

◆ withManualByParticipant()

Liveliness org.omg.dds.core.policy.Liveliness.withManualByParticipant ( )
Returns
Liveliness manual by participant policy

Implemented in org.opensplice.dds.core.policy.LivelinessImpl.

◆ withManualByTopic()

Liveliness org.omg.dds.core.policy.Liveliness.withManualByTopic ( )
Returns
Liveliness manual by topic policy

Implemented in org.opensplice.dds.core.policy.LivelinessImpl.


The documentation for this interface was generated from the following file: