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

Since a org.omg.dds.pub.Publisher is a kind of org.omg.dds.core.Entity, it has the ability to have a listener associated with it. More...

Inheritance diagram for org.omg.dds.pub.PublisherListener:
Inheritance graph
Collaboration diagram for org.omg.dds.pub.PublisherListener:
Collaboration graph

Public Member Functions

void onLivelinessLost (LivelinessLostEvent<?> status)
 This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the org.omg.dds.core.status.LivelinessLostStatus changes. More...
 
void onOfferedDeadlineMissed (OfferedDeadlineMissedEvent<?> status)
 This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the org.omg.dds.core.status.OfferedDeadlineMissedStatus changes. More...
 
void onOfferedIncompatibleQos (OfferedIncompatibleQosEvent<?> status)
 This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the org.omg.dds.core.status.OfferedIncompatibleQosStatus changes. More...
 
void onPublicationMatched (PublicationMatchedEvent<?> status)
 This operation must be implemented by the application and is called by the Data Distribution Service when a new match has been discovered for the current publication, or when an existing match has ceased to exist. More...
 

Detailed Description

Since a org.omg.dds.pub.Publisher is a kind of org.omg.dds.core.Entity, it has the ability to have a listener associated with it.

In this case, the associated listener must be of concrete type PublisherListener.

Example


public class MyPublisherListener extends PublisherAdapter
{
     public void onLivelinessLost(LivelinessLostEvent<?> status)
         // Handle the lost data here.
     }
     public void onOfferedIncompatibleQos(OfferedIncompatibleQosEvent<?> status)
         // Handle the incompatibility here.
     }
}
//Instantiate a PublisherListener.
MyPublisherListener listener = new MyPublisherListener();
// Instantiate and add the status masks.
Collection<Class<? extends Status>> statuses = new HashSet<Class<? extends Status>>();
statuses.add(LivelinessLostStatus.class);
statuses.add(OfferedIncompatibleQosStatus.class);
// Create the Publisher with the listener and the bit-mask.
participant.createPublisher( participant.getDefaultPublisherQos(), listener, statuses);

Definition at line 57 of file PublisherListener.java.

Member Function Documentation

◆ onLivelinessLost()

void org.omg.dds.pub.PublisherListener.onLivelinessLost ( LivelinessLostEvent<?>  status)

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the org.omg.dds.core.status.LivelinessLostStatus changes.

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant PublisherListener is installed and enabled for the liveliness lost status. The liveliness lost status will change when the liveliness that the DataWriter has committed through its LivelinessQosPolicy was not respected. In other words, the DataWriter failed to actively signal its liveliness within the offered liveliness period. As a result, the DataReader objects will consider the DataWriter as no longer "alive". The Data Distribution Service will call the PublisherListener operation with a parameter status, which will contain the LivelinessLostStatus object.

Parameters
statusContains the LivelinessLostStatus object (this is an input to the application)

Implemented in org.omg.dds.domain.DomainParticipantAdapter, and org.omg.dds.pub.PublisherAdapter.

◆ onOfferedDeadlineMissed()

void org.omg.dds.pub.PublisherListener.onOfferedDeadlineMissed ( OfferedDeadlineMissedEvent<?>  status)

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the org.omg.dds.core.status.OfferedDeadlineMissedStatus changes.

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant PublisherListener is installed and enabled for the offered deadline missed status. The offered deadline missed status will change when the deadline that the DataWriter has committed through its DeadlineQosPolicy was not respected for a specific instance. The Data Distribution Service will call the PublisherListener operation with a parameter status, which will contain the OfferedDeadlineMissedStatus object.

Parameters
statusContains the OfferedDeadlineMissedStatus object (this is an input to the application).

Implemented in org.omg.dds.domain.DomainParticipantAdapter, and org.omg.dds.pub.PublisherAdapter.

◆ onOfferedIncompatibleQos()

void org.omg.dds.pub.PublisherListener.onOfferedIncompatibleQos ( OfferedIncompatibleQosEvent<?>  status)

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the org.omg.dds.core.status.OfferedIncompatibleQosStatus changes.

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant PublisherListener is installed and enabled for the OfferedIncompatibleQosStatus. The incompatible Qos status will change when a DataReader object has been discovered by the DataWriter with the same Topic and a requested DataReaderQos that was incompatible with the one offered by the DataWriter. The Data Distribution Service will call the PublisherListener operation with a parameter status, which will contain the OfferedIncompatibleQosStatus object.

Parameters
statusContain the OfferedIncompatibleQosStatus object (this is an input to the application).

Implemented in org.omg.dds.domain.DomainParticipantAdapter, and org.omg.dds.pub.PublisherAdapter.

◆ onPublicationMatched()

void org.omg.dds.pub.PublisherListener.onPublicationMatched ( PublicationMatchedEvent<?>  status)

This operation must be implemented by the application and is called by the Data Distribution Service when a new match has been discovered for the current publication, or when an existing match has ceased to exist.

Usually this means that a new DataReader that matches the Topic and that has compatible Qos as the current DataWriter has either been discovered, or that a previously discovered DataReader has ceased to be matched to the current DataWriter. A DataReader may cease to match when it gets deleted, when it changes its Qos to a value that is incompatible with the current DataWriter or when either the DataWriter or the DataReader has chosen to put its matching counterpart on its ignore-list using the ignoreSubcription or ignorePublication operations on the DomainParticipant. The implementation of this Listener operation may be left empty when this functionality is not needed: it will only be called when the relevant PublisherListener is installed and enabled for the org.omg.dds.core.status.PublicationMatchedStatus. The Data Distribution Service will provide a reference to the PublicationMatchedStatus object in the parameter status for use by the application.

Parameters
statusContains the PublicationMatchedStatus object (this is an input to the application provided by the Data Distribution Service).

Implemented in org.omg.dds.domain.DomainParticipantAdapter, and org.omg.dds.pub.PublisherAdapter.


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