Foo
under the name "My_Type" String type_name = "My_Type";
FooTypeSupport.register_type(participant, type_name);
String topic_name = "my_topic"; String type_type = "My_Type"; // user data type TopicQos topic_qos = new TopicQos(); // MyTopicListener is user defined and // implements TopicListener TopicListener topic_listener = new MyTopicListener(); // or = null participant.get_default_topic_qos(topic_qos); Topic topic = null; try { topic = participant.create_topic(topic_name, type_name, topic_qos, topic_listener, StatusKind.STATUS_MASK_ALL); } catch (RETCODE_ERROR err) { // handle exception }
try { participant.delete_topic(topic); } catch (RETCODE_ERROR err) { // handle exception }