![]() |
OpenSplice Java 5 DCPS
v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
|
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...
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... | |
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);
<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.
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.
status | Contains the InconsistentTopicStatus object (this is an input to the application). |
Implemented in org.omg.dds.topic.TopicAdapter< TYPE >.