OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
DataReaderListenerImpl.java
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2021 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 package org.opensplice.dds.sub;
22 
23 import java.io.Serializable;
24 
25 import org.omg.dds.sub.DataReader;
38 
39 import DDS.LivelinessChangedStatus;
40 import DDS.RequestedDeadlineMissedStatus;
41 import DDS.RequestedIncompatibleQosStatus;
42 import DDS.SampleLostStatus;
43 import DDS.SampleRejectedStatus;
44 import DDS.SubscriptionMatchedStatus;
45 
46 public class DataReaderListenerImpl<TYPE> extends
47  Listener<DataReaderListener<TYPE>> implements DDS.DataReaderListener,
48  Serializable {
49  private static final long serialVersionUID = 6892152554338498323L;
50  private final transient DataReader<TYPE> reader;
51 
54  this(environment, reader, listener, false);
55  }
56 
59  boolean waitUntilInitialised) {
60  super(environment, listener, waitUntilInitialised);
61  this.reader = reader;
62  }
63 
64  @Override
65  public void on_requested_deadline_missed(DDS.DataReader reader,
67  this.waitUntilInitialised();
68  this.listener
69  .onRequestedDeadlineMissed(new RequestedDeadlineMissedEventImpl<TYPE>(
70  this.environment, this.reader, StatusConverter.convert(
71  this.environment, status)));
72  }
73 
74  @Override
75  public void on_sample_rejected(DDS.DataReader reader,
76  SampleRejectedStatus status) {
77  this.waitUntilInitialised();
78  this.listener.onSampleRejected(new SampleRejectedEventImpl<TYPE>(
79  this.environment, this.reader, StatusConverter.convert(
80  this.environment, status)));
81  }
82 
83  @Override
84  public void on_liveliness_changed(DDS.DataReader reader,
85  LivelinessChangedStatus status) {
86  this.waitUntilInitialised();
87  this.listener.onLivelinessChanged(new LivelinessChangedEventImpl<TYPE>(
88  this.environment, this.reader, StatusConverter.convert(
89  this.environment, status)));
90  }
91 
92  @Override
93  public void on_data_available(DDS.DataReader reader) {
94  this.waitUntilInitialised();
95  this.listener.onDataAvailable(new DataAvailableEventImpl<TYPE>(
96  this.environment, this.reader, new DataAvailableStatusImpl(
97  this.environment)));
98  }
99 
100  @Override
101  public void on_requested_incompatible_qos(DDS.DataReader reader,
103  this.waitUntilInitialised();
104  this.listener
105  .onRequestedIncompatibleQos(new RequestedIncompatibleQosEventImpl<TYPE>(
106  this.environment, this.reader, StatusConverter.convert(
107  this.environment, status)));
108  }
109 
110  @Override
111  public void on_subscription_matched(DDS.DataReader reader,
112  SubscriptionMatchedStatus status) {
113  this.waitUntilInitialised();
114  this.listener
115  .onSubscriptionMatched(new SubscriptionMatchedEventImpl<TYPE>(
116  this.environment, this.reader, StatusConverter.convert(
117  this.environment, status)));
118  }
119 
120  @Override
121  public void on_sample_lost(DDS.DataReader reader, SampleLostStatus status) {
122  this.waitUntilInitialised();
123  this.listener.onSampleLost(new SampleLostEventImpl<TYPE>(
124  this.environment, this.reader, StatusConverter.convert(
125  this.environment, status)));
126  }
127 }
void on_requested_deadline_missed(DDS.DataReader reader, RequestedDeadlineMissedStatus status)
Since a org.omg.dds.sub.DataReader is a kind of org.omg.dds.core.Entity, it has the ability to have a...
A sample has been lost (never received).
A DataReader allows the application (1) to declare the data it wishes to receive (i.e., make a subscription) and (2) to access the data received by the attached org.omg.dds.sub.Subscriber.
void on_requested_incompatible_qos(DDS.DataReader reader, RequestedIncompatibleQosStatus status)
void on_sample_rejected(DDS.DataReader reader, SampleRejectedStatus status)
void on_liveliness_changed(DDS.DataReader reader, LivelinessChangedStatus status)
DataReaderListenerImpl(OsplServiceEnvironment environment, DataReader< TYPE > reader, DataReaderListener< TYPE > listener)
void on_sample_lost(DDS.DataReader reader, SampleLostStatus status)
static QosPolicyCount [] convert(OsplServiceEnvironment env, DDS.QosPolicyCount[] old)
DataReaderListenerImpl(OsplServiceEnvironment environment, DataReader< TYPE > reader, DataReaderListener< TYPE > listener, boolean waitUntilInitialised)
OsplServiceEnvironment environment
Definition: Listener.java:33
A org.omg.dds.core.policy.QosPolicy value was incompatible with what is offered.
This class contains the statistics about the discovered number of org.omg.dds.pub.DataWriters that are compatible with the org.omg.dds.sub.DataReader to which the Status is attached.
The liveliness of one or more org.omg.dds.pub.DataWriters that were writing instances read through th...
void on_subscription_matched(DDS.DataReader reader, SubscriptionMatchedStatus status)
A (received) sample has been rejected.
The deadline that the org.omg.dds.sub.DataReader was expecting through its org.omg.dds.core.policy.Deadline was not respected for a specific instance.