001: /*
002: * DDS (Data Distribution Service) for JacORB
003: *
004: * Copyright (C) 2005 , Ahmed yehdih <ahmed.yehdih@gmail.com>, fouad
005: * allaoui <fouad.allaoui@gmail.com>, Didier Donsez (didier.donsez@ieee.org)
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Library General Public License
009: * as published by the Free Software Foundation; either version 2
010: * of the License, or (at your option) any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015: * GNU Library General Public License for more details.
016: *
017: * You should have received a copy of the GNU Library General Public
018: * License along with this program; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
020: * 02111-1307, USA.
021: *
022: * Coontact: Ahmed yehdih <ahmed.yehdih@gmail.com>, fouad allaoui
023: * <fouad.allaoui@gmail.com>, Didier Donsez (didier.donsez@ieee.org)
024: * Contributor(s)
025: *
026: **/
027: package demo.dds.dcps.foosample;
028:
029: import org.jacorb.dds.Supplier;
030: import org.omg.dds.DataWriterListener;
031: import org.omg.dds.DataWriterQos;
032: import org.omg.dds.DataWriterQosHolder;
033: import org.omg.dds.InstanceHandleSeqHolder;
034: import org.omg.dds.LivelinessLostStatus;
035: import org.omg.dds.OfferedDeadlineMissedStatus;
036: import org.omg.dds.OfferedIncompatibleQosStatus;
037: import org.omg.dds.PublicationMatchStatus;
038: import org.omg.dds.Publisher;
039: import org.omg.dds.StatusCondition;
040: import org.omg.dds.SubscriptionBuiltinTopicDataHolder;
041: import org.omg.dds.Time_t;
042: import org.omg.dds.Topic;
043:
044: /**
045: * A DataWriter is attached to exactly one Publisher which acts as a factory for it.
046: * A DataWriter is bound to exactly one Topic and therefore to exactly one data type. The
047: * Topic must exist prior to the DataWriter's creation.
048: * DataWriter is an abstract class. It must be specialized for each particular application
049: * data-type . The additional methods that must be defined in the autogenerated
050: * class for a hypothetical application type “Foo”
051: *
052: */
053: public class FooDataWriterImpl extends FooDataWriterPOA {
054:
055: private DataWriterQos qos;
056: private DataWriterListener a_listener;
057: private Publisher PubParent;
058: private Topic topic;
059: org.omg.CORBA.ORB orb;
060: org.omg.PortableServer.POA poa;
061: // put instance of Foo in channel event
062: private Supplier _Supplier;
063:
064: /**
065: * @param qos
066: * @param a_listener
067: * @param pubParent
068: * @param topic_name
069: */
070: public FooDataWriterImpl(DataWriterQos qos,
071: DataWriterListener a_listener, Publisher pubParent,
072: Topic topic, org.omg.CORBA.ORB orb,
073: org.omg.PortableServer.POA poa) {
074: this .orb = orb;
075: this .poa = poa;
076: this .qos = qos;
077: this .a_listener = a_listener;
078: PubParent = pubParent;
079: this .topic = topic;
080: _Supplier = new Supplier(orb, poa);
081: }
082:
083: /**
084: * Not Implemented
085: */
086: public int register(Foo instance_data) {
087: return 0;
088: }
089:
090: /**
091: * Not Implemented
092: */
093: public int register_w_timestamp(Foo instance_data, int handle,
094: Time_t source_timestamp) {
095: return 0;
096: }
097:
098: /**
099: * Not Implemented
100: */
101: public int unregister(Foo instance_data, int handle) {
102: return 0;
103: }
104:
105: /**
106: * Not Implemented
107: */
108: public int unregister_w_timestamp(Foo instance_data, int handle,
109: Time_t source_timestamp) {
110: return 0;
111: }
112:
113: /**
114: * Not Implemented
115: */
116: public int write(Foo instance_data, int handle) {
117: _Supplier.Write(topic, instance_data);
118: return 0;
119: }
120:
121: /**
122: * Not Implemented
123: */
124: public int write_w_timestamp(Foo instance_data, int handle,
125: Time_t source_timestamp) {
126: return 0;
127: }
128:
129: /**
130: * Not Implemented
131: */
132: public int dispose(Foo instance_data, int instance_handle) {
133: return 0;
134: }
135:
136: /**
137: * Not Implemented
138: */
139: public int dispose_w_timestamp(Foo instance_data,
140: int instance_handle, Time_t source_timestamp) {
141: return 0;
142: }
143:
144: /**
145: * Not Implemented
146: */
147: public int get_key_value(FooHolder key_holder, int handle) {
148: return 0;
149: }
150:
151: /**
152: * Not Implemented
153: */
154: public int set_qos(DataWriterQos qos) {
155: return 0;
156: }
157:
158: /**
159: * Not Implemented
160: */
161: public void get_qos(DataWriterQosHolder qos) {
162: }
163:
164: /**
165: * Not Implemented
166: */
167: public int set_listener(DataWriterListener a_listener, int mask) {
168: return 0;
169: }
170:
171: /**
172: * Not Implemented
173: */
174: public DataWriterListener get_listener() {
175: return null;
176: }
177:
178: /**
179: * Not Implemented
180: */
181: public Topic get_topic() {
182: return null;
183: }
184:
185: /**
186: * Not Implemented
187: */
188: public Publisher get_publisher() {
189: return PubParent;
190: }
191:
192: /**
193: * Not Implemented
194: */
195: public LivelinessLostStatus get_liveliness_lost_status() {
196: return null;
197: }
198:
199: /**
200: * Not Implemented
201: */
202: public OfferedDeadlineMissedStatus get_offered_deadline_missed_status() {
203: return null;
204: }
205:
206: /**
207: * Not Implemented
208: */
209: public OfferedIncompatibleQosStatus get_offered_incompatible_qos_status() {
210: return null;
211: }
212:
213: /**
214: * Not Implemented
215: */
216: public PublicationMatchStatus get_publication_match_status() {
217: return null;
218: }
219:
220: /**
221: * Not Implemented
222: */
223: public void assert_liveliness() {
224: }
225:
226: /**
227: * Not Implemented
228: */
229: public int get_matched_subscriptions(
230: InstanceHandleSeqHolder subscription_handles) {
231: return 0;
232: }
233:
234: /**
235: * Not Implemented
236: */
237: public int get_matched_subscription_data(
238: SubscriptionBuiltinTopicDataHolder subscription_data,
239: int subscription_handle) {
240: return 0;
241: }
242:
243: /**
244: * Not Implemented
245: */
246: public int enable() {
247: return 0;
248: }
249:
250: /**
251: * Not Implemented
252: */
253: public StatusCondition get_statuscondition() {
254: return null;
255: }
256:
257: /**
258: * Not Implemented
259: */
260: public int get_status_changes() {
261: return 0;
262: }
263:
264: /**
265: * @return Returns the pubParent.
266: */
267: public Publisher getPubParent() {
268: return PubParent;
269: }
270:
271: /**
272: * @return Returns the topic_name.
273: */
274: public Topic getTopic() {
275: return topic;
276: }
277: }
|