OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
PublisherListenerImpl.java
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2024 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.pub;
22 
23 import java.io.Serializable;
24 
33 
34 import DDS.DataWriter;
35 import DDS.LivelinessLostStatus;
36 import DDS.OfferedDeadlineMissedStatus;
37 import DDS.OfferedIncompatibleQosStatus;
38 import DDS.PublicationMatchedStatus;
39 
40 public class PublisherListenerImpl extends Listener<PublisherListener>
41  implements DDS.PublisherListener, Serializable {
42  private static final long serialVersionUID = -7442074499638981651L;
43  private final transient PublisherImpl publisher;
44 
47  this(environment, publisher, listener, false);
48  }
49 
52  boolean waitUntilInitialised) {
53  super(environment, listener, waitUntilInitialised);
54  this.publisher = publisher;
55  }
56 
57  @Override
60  org.omg.dds.pub.DataWriter<Object> found = this.publisher
61  .lookupDataWriter(writer);
62 
63  if (found != null) {
64  this.waitUntilInitialised();
65  this.listener
66  .onOfferedDeadlineMissed(new OfferedDeadlineMissedEventImpl<Object>(
67  this.environment, found, StatusConverter.convert(
68  this.environment, status)));
69  }
70  }
71 
72  @Override
73  public void on_liveliness_lost(DataWriter writer,
74  LivelinessLostStatus status) {
75  org.omg.dds.pub.DataWriter<Object> found = this.publisher
76  .lookupDataWriter(writer);
77 
78  if (found != null) {
79  this.waitUntilInitialised();
80  this.listener.onLivelinessLost(new LivelinessLostEventImpl<Object>(
81  this.environment, found, StatusConverter.convert(
82  this.environment, status)));
83  }
84  }
85 
86  @Override
89  org.omg.dds.pub.DataWriter<Object> found = this.publisher
90  .lookupDataWriter(writer);
91 
92  if (found != null) {
93  this.waitUntilInitialised();
94  this.listener
95  .onOfferedIncompatibleQos(new OfferedIncompatibleQosEventImpl<Object>(
96  this.environment, found, StatusConverter.convert(
97  this.environment, status)));
98  }
99  }
100 
101  @Override
102  public void on_publication_matched(DataWriter writer,
103  PublicationMatchedStatus status) {
104  org.omg.dds.pub.DataWriter<Object> found = this.publisher
105  .lookupDataWriter(writer);
106 
107  if (found != null) {
108  this.waitUntilInitialised();
109  this.listener
110  .onPublicationMatched(new PublicationMatchedEventImpl<Object>(
111  this.environment, found, StatusConverter.convert(
112  this.environment, status)));
113  }
114  }
115 }
void on_publication_matched(DataWriter writer, PublicationMatchedStatus status)
void on_offered_incompatible_qos(DataWriter writer, OfferedIncompatibleQosStatus status)
void on_offered_deadline_missed(DataWriter writer, OfferedDeadlineMissedStatus status)
This class contains the statistics about the discovered number of org.omg.dds.sub.DataReaders that are compatible with the org.omg.dds.pub.DataWriter to which the Status is attached.
PublisherListenerImpl(OsplServiceEnvironment environment, PublisherImpl publisher, PublisherListener listener)
void on_liveliness_lost(DataWriter writer, LivelinessLostStatus status)
static QosPolicyCount [] convert(OsplServiceEnvironment env, DDS.QosPolicyCount[] old)
DataWriter allows the application to set the value of the data to be published under a given org...
Definition: DataWriter.java:86
The liveliness that the org.omg.dds.pub.DataWriter has committed through its org.omg.dds.core.policy.Liveliness was not respected; thus org.omg.dds.sub.DataReader entities will consider the DataWriter as no longer "active.".
OsplServiceEnvironment environment
Definition: Listener.java:33
A org.omg.dds.core.policy.QosPolicy value was incompatible with what was requested.
PublisherListenerImpl(OsplServiceEnvironment environment, PublisherImpl publisher, PublisherListener listener, boolean waitUntilInitialised)
Since a org.omg.dds.pub.Publisher is a kind of org.omg.dds.core.Entity, it has the ability to have a ...
The deadline that the org.omg.dds.pub.DataWriter has committed through its org.omg.dds.core.policy.Deadline was not respected for a specific instance.