RTI Connext Java API  Version 5.3.1
 All Classes Namespaces Functions Variables Groups Pages
InstanceStateKind Class Reference

Indicates if the samples are from a live com.rti.dds.publication.DataWriter or not. More...

Static Public Attributes

static final int ALIVE_INSTANCE_STATE = 0x0001 << 0
 Instance is currently in existence.
 
static final int NOT_ALIVE_DISPOSED_INSTANCE_STATE = 0x0001 << 1
 Not alive disposed instance. The instance has been disposed by a DataWriter.
 
static final int NOT_ALIVE_NO_WRITERS_INSTANCE_STATE = 0x0001 << 2
 Not alive no writers for instance. None of the com.rti.dds.publication.DataWriter objects that are currently alive (according to the LIVELINESS) are writing the instance.
 
static final int ANY_INSTANCE_STATE = 0xffff
 Any instance state ALIVE_INSTANCE_STATE | NOT_ALIVE_DISPOSED_INSTANCE_STATE | NOT_ALIVE_NO_WRITERS_INSTANCE_STATE.
 
static final int NOT_ALIVE_INSTANCE_STATE = 0x006
 Not alive instance state NOT_ALIVE_DISPOSED_INSTANCE_STATE | NOT_ALIVE_NO_WRITERS_INSTANCE_STATE.
 

Detailed Description

Indicates if the samples are from a live com.rti.dds.publication.DataWriter or not.

For each instance, the middleware internally maintains an instance state. The instance state can be:

  • com.rti.dds.subscription.InstanceStateKind.InstanceStateKind.ALIVE_INTANCE_STATE indicates that (a) samples have been received for the instance, (b) there are live com.rti.dds.publication.DataWriter entities writing the instance, and (c) the instance has not been explicitly disposed (or else more samples have been received after it was disposed).
  • com.rti.dds.subscription.InstanceStateKind.InstanceStateKind.NOT_ALIVE_DISPOSED_INSTANCE_STATE indicates the instance was explicitly disposed by a com.rti.dds.publication.DataWriter by means of the dispose operation.

The precise behavior events that cause the instance state to change depends on the setting of the OWNERSHIP QoS:

  • If OWNERSHIP is set to com.rti.dds.infrastructure.OwnershipQosPolicyKind.OwnershipQosPolicyKind.EXCLUSIVE_OWNERSHIP_QOS, then the instance state becomes com.rti.dds.subscription.InstanceStateKind.InstanceStateKind.NOT_ALIVE_DISPOSED_INSTANCE_STATE only if the com.rti.dds.publication.DataWriter that "owns" the instance explicitly disposes it. The instance state becomes com.rti.dds.subscription.InstanceStateKind.InstanceStateKind.ALIVE_INTANCE_STATE again only if the com.rti.dds.publication.DataWriter that owns the instance writes it.
  • If OWNERSHIP is set to com.rti.dds.infrastructure.OwnershipQosPolicyKind.OwnershipQosPolicyKind.SHARED_OWNERSHIP_QOS, then the instance state becomes com.rti.dds.subscription.InstanceStateKind.InstanceStateKind.NOT_ALIVE_DISPOSED_INSTANCE_STATE if any com.rti.dds.publication.DataWriter explicitly disposes the instance. The instance state becomes com.rti.dds.subscription.InstanceStateKind.InstanceStateKind.ALIVE_INTANCE_STATE as soon as any com.rti.dds.publication.DataWriter writes the instance again.

The instance state available in the com.rti.dds.subscription.SampleInfo is a snapshot of the instance state of the instance at the time the collection was obtained (i.e. at the time read or take was called). The instance state is therefore the same for all samples in the returned collection that refer to the same instance.

Member Data Documentation

final int ALIVE_INSTANCE_STATE = 0x0001 << 0
static

Instance is currently in existence.

final int NOT_ALIVE_DISPOSED_INSTANCE_STATE = 0x0001 << 1
static

Not alive disposed instance. The instance has been disposed by a DataWriter.

final int NOT_ALIVE_NO_WRITERS_INSTANCE_STATE = 0x0001 << 2
static

Not alive no writers for instance. None of the com.rti.dds.publication.DataWriter objects that are currently alive (according to the LIVELINESS) are writing the instance.


RTI Connext Java API Version 5.3.1 Copyright © Mon Feb 19 2018 Real-Time Innovations, Inc