OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org.omg.dds.topic.TopicListener< TYPE > Interface Template Reference

Since org.omg.dds.topic.Topic is a kind of org.omg.dds.core.Entity, it has the ability to have an associated listener. More...

Inheritance diagram for org.omg.dds.topic.TopicListener< TYPE >:
Inheritance graph
Collaboration diagram for org.omg.dds.topic.TopicListener< TYPE >:
Collaboration graph

Public Member Functions

void onInconsistentTopic (InconsistentTopicEvent< TYPE > 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.InconsistentTopicStatus changes. More...
 

Detailed Description

Since org.omg.dds.topic.Topic is a kind of org.omg.dds.core.Entity, it has the ability to have an associated listener.

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

Example


public class MyTopicListener extends TopicAdapter<Foo>
{
    public void onInconsistentTopic(InconsistentTopicEvent<Foo> status)
         // Handle the inconsistency here.
    }
}
//Instantiate a TopicListener.
MyTopicListener listener = new MyTopicListener();
// Instantiate and add the status masks.
Collection<Class<? extends Status>> statuses = new HashSet<Class<? extends Status>>();
statuses.add(InconsistentTopicStatus.class);
// Create the Topic with the listener and the bit-mask.
participant.createTopic("fooTopic", Foo.class, participant.getDefaultTopicQos(), listener, statuses);

Parameters
<TYPE>The concrete type of the data published and/or subscribed by the readers and writers that use to topic.

Definition at line 54 of file TopicListener.java.

Member Function Documentation

◆ onInconsistentTopic()

void org.omg.dds.topic.TopicListener< TYPE >.onInconsistentTopic ( InconsistentTopicEvent< TYPE >  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.InconsistentTopicStatus changes.

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant TopicListener is installed and enabled for the InconsistentTopicStatus. The InconsistentTopicStatus will change when another Topic exists with the same topicName but different characteristics. The Data Distribution Service will call the TopicListener operation with a parameter status, which will contain the InconsistentTopicStatus struct.

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

Implemented in org.omg.dds.topic.TopicAdapter< TYPE >.


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