MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / write

Method write

java/tests/multirepo/MultiRepoWorker.java:82–117  ·  view source on GitHub ↗
(final String text)

Source from the content-addressed store, hash-verified

80 }
81
82 public void write(final String text) {
83 Publisher publisher =
84 participant.create_publisher(PUBLISHER_QOS_DEFAULT.get(), null, DEFAULT_STATUS_MASK.value);
85
86 assert (publisher != null);
87
88 TheTransportRegistry.bind_config(transportConfig, publisher);
89
90 publisher.create_datawriter(topic, DATAWRITER_QOS_DEFAULT.get(),
91 new _DataWriterListenerLocalBase() {
92 public void on_liveliness_lost(DataWriter dw, LivelinessLostStatus status) {}
93
94 public void on_offered_deadline_missed(DataWriter dw, OfferedDeadlineMissedStatus status) {}
95
96 public void on_offered_incompatible_qos(DataWriter dw, OfferedIncompatibleQosStatus status) {}
97
98 public void on_publication_matched(DataWriter dw, PublicationMatchedStatus status) {
99 if (status.total_count < 1) {
100 throw new IllegalArgumentException("Unable to match publication!");
101 }
102
103 MessageDataWriter writer = MessageDataWriterHelper.narrow(dw);
104
105 Message message = new Message();
106 message.text = text;
107
108 int handle = writer.register_instance(message);
109 if (writer.write(message, handle) != RETCODE_OK.value) {
110 throw new IllegalStateException("Unable to write message!");
111 }
112
113 System.out.printf("[%s] wrote %s\n", participant, message);
114 }
115 }, DEFAULT_STATUS_MASK.value
116 );
117 }
118
119 public void read() {
120 Subscriber subscriber =

Callers 10

mainMethod · 0.95
mainMethod · 0.95
createIndexMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45

Calls 5

getMethod · 0.95
bind_configMethod · 0.95
getMethod · 0.95
create_publisherMethod · 0.45
create_datawriterMethod · 0.45

Tested by

no test coverage detected