RTI Connext Java API  Version 5.0.0
com::rti::dds::subscription Namespace Reference

Contains the com.rti.dds.subscription.Subscriber, com.rti.dds.subscription.DataReader, com.rti.dds.subscription.ReadCondition, and com.rti.dds.subscription.QueryCondition classes, as well as the com.rti.dds.subscription.SubscriberListener and com.rti.dds.subscription.DataReaderListener interfaces, and more generally, all that is needed on the subscription side. More...

Namespaces

namespace  builtin
 Builtin topic for accessing information about the Subscriptions discovered by RTI Connext.
 

Classes

interface  DataReader
 <<interface>> Allows the application to: (1) declare the data it wishes to receive (i.e. make a subscription) and (2) access the data received by the attached com.rti.dds.subscription.Subscriber. More...
 
class  DataReaderAdapter
 <<eXtension>> A listener adapter in the spirit of the Java AWT listener adapters. (The Adapter provides empty implementations for the listener methods) More...
 
class  DataReaderCacheStatus
 <<eXtension>> The status of the reader's cache. More...
 
interface  DataReaderListener
 <<interface>> com.rti.dds.infrastructure.Listener for reader status. More...
 
class  DataReaderProtocolStatus
 <<eXtension>> The status of a reader's internal protocol related metrics, like the number of samples received, filtered, rejected; and status of wire protocol traffic. More...
 
class  DataReaderQos
 QoS policies supported by a com.rti.dds.subscription.DataReader entity. More...
 
class  DataReaderSeq
 Declares IDL sequence < com.rti.dds.subscription.DataReader > . More...
 
class  InstanceStateKind
 Indicates is the samples are from a live com.rti.dds.publication.DataWriter or not. More...
 
class  LivelinessChangedStatus
 com.rti.dds.infrastructure.StatusKind.StatusKind.LIVELINESS_CHANGED_STATUS More...
 
interface  QueryCondition
 <<interface>> These are specialised com.rti.dds.subscription.ReadCondition objects that allow the application to also specify a filter on the locally available data. More...
 
interface  ReadCondition
 <<interface>> Conditions specifically dedicated to read operations and attached to one com.rti.dds.subscription.DataReader. More...
 
class  RequestedDeadlineMissedStatus
 com.rti.dds.infrastructure.StatusKind.StatusKind.REQUESTED_DEADLINE_MISSED_STATUS More...
 
class  RequestedIncompatibleQosStatus
 com.rti.dds.infrastructure.StatusKind.StatusKind.REQUESTED_INCOMPATIBLE_QOS_STATUS More...
 
class  SampleInfo
 Information that accompanies each sample that is read or taken. More...
 
class  SampleInfoSeq
 Declares IDL sequence < com.rti.dds.subscription.SampleInfo > . More...
 
class  SampleLostStatus
 com.rti.dds.infrastructure.StatusKind.StatusKind.SAMPLE_LOST_STATUS_STATUS More...
 
class  SampleLostStatusKind
 Kinds of reasons why a sample was lost. More...
 
class  SampleRejectedStatus
 com.rti.dds.infrastructure.StatusKind.StatusKind.SAMPLE_REJECTED_STATUS More...
 
class  SampleRejectedStatusKind
 Kinds of reasons for rejecting a sample. More...
 
class  SampleStateKind
 Indicates whether or not a sample has ever been read. More...
 
interface  Subscriber
 <<interface>> A subscriber is the object responsible for actually receiving data from a subscription. More...
 
class  SubscriberAdapter
 A listener adapter in the spirit of the Java AWT listener adapters. (The Adapter provides empty implementations for the listener methods) More...
 
interface  SubscriberListener
 <<interface>> com.rti.dds.infrastructure.Listener for status about a subscriber. More...
 
class  SubscriberQos
 QoS policies supported by a com.rti.dds.subscription.Subscriber entity. More...
 
class  SubscriberSeq
 Declares IDL sequence < com.rti.dds.subscription.Subscriber > . More...
 
class  SubscriptionMatchedStatus
 com.rti.dds.infrastructure.StatusKind.StatusKind.SUBSCRIPTION_MATCHED_STATUS More...
 
class  ViewStateKind
 Indicates whether or not an instance is new. More...
 

Detailed Description

Contains the com.rti.dds.subscription.Subscriber, com.rti.dds.subscription.DataReader, com.rti.dds.subscription.ReadCondition, and com.rti.dds.subscription.QueryCondition classes, as well as the com.rti.dds.subscription.SubscriberListener and com.rti.dds.subscription.DataReaderListener interfaces, and more generally, all that is needed on the subscription side.

DDSSubscriptionPackage.png
DCPS Subscription package

Access to data samples

Data is made available to the application by the following operations on com.rti.dds.subscription.DataReader objects: com.rti.ndds.example.FooDataReader.read, com.rti.ndds.example.FooDataReader.read_w_condition, com.rti.ndds.example.FooDataReader.take, com.rti.ndds.example.FooDataReader.take_w_condition, and the other variants of read() and take().

The general semantics of the read() operation is that the application only gets access to the corresponding data (i.e. a precise instance value); the data remains the responsibility of RTI Connext and can be read again.

The semantics of the take() operations is that the application takes full responsibility for the data; that data will no longer be available locally to RTI Connext. Consequently, it is possible to access the same information multiple times only if all previous accesses were read() operations, not take().

Each of these operations returns a collection of Data values and associated com.rti.dds.subscription.SampleInfo objects. Each data value represents an atom of data information (i.e., a value for one instance). This collection may contain samples related to the same or different instances (identified by the key). Multiple samples can refer to the same instance if the settings of the HISTORY QoS allow for it.

To return the memory back to the middleware, every read() or take() that retrieves a sequence of samples must be followed with a call to com.rti.ndds.example.FooDataReader.return_loan.

See Also
Interpretation of the SampleInfo

Data access patterns

The application accesses data by means of the operations read or take on the com.rti.dds.subscription.DataReader. These operations return an ordered collection of DataSamples consisting of a com.rti.dds.subscription.SampleInfo part and a Data part.

The way RTI Connext builds the collection depends on QoS policies set on the com.rti.dds.subscription.DataReader and com.rti.dds.subscription.Subscriber, as well as the source_timestamp of the samples, and the parameters passed to the read() / take() operations, namely:

The read() and take() operations are non-blocking and just deliver what is currently available that matches the specified states.

The read_w_condition() and take_w_condition() operations take a com.rti.dds.subscription.ReadCondition object as a parameter instead of sample, view or instance states. The behaviour is that the samples returned will only be those for which the condition is com.rti.dds.infrastructure.true. These operations, in conjunction with com.rti.dds.subscription.ReadCondition objects and a com.rti.dds.infrastructure.WaitSet, allow performing waiting reads.

Once the data samples are available to the data readers, they can be read or taken by the application. The basic rule is that the application may do this in any order it wishes. This approach is very flexible and allows the application ultimate control.

To access data coherently, or in order, the PRESENTATION QoS must be set properly.


RTI Connext Java API Version 5.0.0 Copyright © Thu Aug 30 2012 Real-Time Innovations, Inc