summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/tags/2.0.1-RC1/testing/itest/jms/ttl/src/main/java/itest/MockInitialContextFactory.java
blob: 336fecf67b0981cbfdde0ce007ddf41493285f20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.    
 */

package itest;

import java.io.Serializable;
import java.util.Enumeration;
import java.util.Hashtable;

import javax.jms.BytesMessage;
import javax.jms.Connection;
import javax.jms.ConnectionConsumer;
import javax.jms.ConnectionFactory;
import javax.jms.ConnectionMetaData;
import javax.jms.Destination;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.QueueBrowser;
import javax.jms.ServerSessionPool;
import javax.jms.Session;
import javax.jms.StreamMessage;
import javax.jms.TemporaryQueue;
import javax.jms.TemporaryTopic;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.NameClassPair;
import javax.naming.NameParser;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;

/**
 * Some classes that mock up various JMS interfaces with the end result
 * of having the Time-To-Live value set on the static timeToLive 
 * 
 * This class is referenced from the AMQ jndi.properties file
 */
public class MockInitialContextFactory extends org.apache.activemq.jndi.ActiveMQInitialContextFactory{
    
    public static Object lock = new Object();
    public static Long timeToLive;

    public Context getInitialContext(Hashtable environment) throws NamingException {
        return new Context() {

            public Object addToEnvironment(String propName, Object propVal) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public void bind(Name name, Object obj) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public void bind(String name, Object obj) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public void close() throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public Name composeName(Name name, Name prefix) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public String composeName(String name, String prefix) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public Context createSubcontext(Name name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public Context createSubcontext(String name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public void destroySubcontext(Name name) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public void destroySubcontext(String name) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public Hashtable<?, ?> getEnvironment() throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public String getNameInNamespace() throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public NameParser getNameParser(Name name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public NameParser getNameParser(String name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public Object lookup(Name name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public Object lookup(String name) throws NamingException {
                if (name.endsWith("ConnectionFactory")) {
                    return new ConnectionFactory() {
                        public Connection createConnection() throws JMSException {
                            return new Connection(){

                                public void close() throws JMSException {
                                    // TODO Auto-generated method stub
                                    
                                }

                                public ConnectionConsumer createConnectionConsumer(Destination arg0,
                                                                                   String arg1,
                                                                                   ServerSessionPool arg2,
                                                                                   int arg3) throws JMSException {
                                    // TODO Auto-generated method stub
                                    return null;
                                }

                                public ConnectionConsumer createDurableConnectionConsumer(Topic arg0,
                                                                                          String arg1,
                                                                                          String arg2,
                                                                                          ServerSessionPool arg3,
                                                                                          int arg4) throws JMSException {
                                    // TODO Auto-generated method stub
                                    return null;
                                }

                                public Session createSession(boolean arg0, int arg1) throws JMSException {
                                    // TODO Auto-generated method stub
                                    return new Session() {

                                        public void close() throws JMSException {
                                            // TODO Auto-generated method stub
                                            
                                        }

                                        public void commit() throws JMSException {
                                            // TODO Auto-generated method stub
                                            
                                        }

                                        public QueueBrowser createBrowser(Queue arg0) throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public QueueBrowser createBrowser(Queue arg0, String arg1) throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public BytesMessage createBytesMessage() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return new BytesMessage() {

                                                public long getBodyLength() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public boolean readBoolean() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return false;
                                                }

                                                public byte readByte() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public int readBytes(byte[] arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public int readBytes(byte[] arg0, int arg1) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public char readChar() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public double readDouble() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public float readFloat() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public int readInt() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public long readLong() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public short readShort() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public String readUTF() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public int readUnsignedByte() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public int readUnsignedShort() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public void reset() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeBoolean(boolean arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeByte(byte arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeBytes(byte[] arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeBytes(byte[] arg0, int arg1, int arg2)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeChar(char arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeDouble(double arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeFloat(float arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeInt(int arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeLong(long arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeObject(Object arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeShort(short arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void writeUTF(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void acknowledge() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void clearBody() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void clearProperties() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public boolean getBooleanProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return false;
                                                }

                                                public byte getByteProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public double getDoubleProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public float getFloatProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public int getIntProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public String getJMSCorrelationID() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public int getJMSDeliveryMode() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public Destination getJMSDestination() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public long getJMSExpiration() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public String getJMSMessageID() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public int getJMSPriority() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public boolean getJMSRedelivered() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return false;
                                                }

                                                public Destination getJMSReplyTo() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public long getJMSTimestamp() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public String getJMSType() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public long getLongProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public Object getObjectProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public Enumeration getPropertyNames() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public short getShortProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public String getStringProperty(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public boolean propertyExists(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return false;
                                                }

                                                public void setBooleanProperty(String arg0, boolean arg1)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setByteProperty(String arg0, byte arg1) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setDoubleProperty(String arg0, double arg1)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setFloatProperty(String arg0, float arg1)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setIntProperty(String arg0, int arg1) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSCorrelationID(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSCorrelationIDAsBytes(byte[] arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSDeliveryMode(int arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSDestination(Destination arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSExpiration(long arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSMessageID(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSPriority(int arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSRedelivered(boolean arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSReplyTo(Destination arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSTimestamp(long arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setJMSType(String arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setLongProperty(String arg0, long arg1) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setObjectProperty(String arg0, Object arg1)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setShortProperty(String arg0, short arg1)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setStringProperty(String arg0, String arg1)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }};
                                        }

                                        public MessageConsumer createConsumer(Destination arg0) throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public MessageConsumer createConsumer(Destination arg0, String arg1)
                                            throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public MessageConsumer createConsumer(Destination arg0,
                                                                              String arg1,
                                                                              boolean arg2) throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public TopicSubscriber createDurableSubscriber(Topic arg0, String arg1)
                                            throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public TopicSubscriber createDurableSubscriber(Topic arg0,
                                                                                       String arg1,
                                                                                       String arg2,
                                                                                       boolean arg3)
                                            throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public MapMessage createMapMessage() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public Message createMessage() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public ObjectMessage createObjectMessage() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public ObjectMessage createObjectMessage(Serializable arg0) throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public MessageProducer createProducer(Destination arg0) throws JMSException {
                                            return  new MessageProducer() {

                                                public void close() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public int getDeliveryMode() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public Destination getDestination() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return null;
                                                }

                                                public boolean getDisableMessageID() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return false;
                                                }

                                                public boolean getDisableMessageTimestamp() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return false;
                                                }

                                                public int getPriority() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public long getTimeToLive() throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    return 0;
                                                }

                                                public void send(Message arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void send(Destination arg0, Message arg1) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void send(Message arg0, int arg1, int arg2, long arg3)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void send(Destination arg0,
                                                                 Message arg1,
                                                                 int arg2,
                                                                 int arg3,
                                                                 long arg4) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setDeliveryMode(int arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setDisableMessageID(boolean arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setDisableMessageTimestamp(boolean arg0)
                                                    throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setPriority(int arg0) throws JMSException {
                                                    // TODO Auto-generated method stub
                                                    
                                                }

                                                public void setTimeToLive(long arg0) throws JMSException {
                                                    MockInitialContextFactory.timeToLive = Long.valueOf(arg0);
                                                    synchronized(MockInitialContextFactory.lock) {
                                                        MockInitialContextFactory.lock.notifyAll();
                                                    }
                                                }};
                                        }

                                        public Queue createQueue(String arg0) throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public StreamMessage createStreamMessage() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public TemporaryQueue createTemporaryQueue() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public TemporaryTopic createTemporaryTopic() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public TextMessage createTextMessage() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public TextMessage createTextMessage(String arg0) throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public Topic createTopic(String arg0) throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public int getAcknowledgeMode() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return 0;
                                        }

                                        public MessageListener getMessageListener() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return null;
                                        }

                                        public boolean getTransacted() throws JMSException {
                                            // TODO Auto-generated method stub
                                            return false;
                                        }

                                        public void recover() throws JMSException {
                                            // TODO Auto-generated method stub
                                            
                                        }

                                        public void rollback() throws JMSException {
                                            // TODO Auto-generated method stub
                                            
                                        }

                                        public void run() {
                                            // TODO Auto-generated method stub
                                            
                                        }

                                        public void setMessageListener(MessageListener arg0) throws JMSException {
                                            // TODO Auto-generated method stub
                                            
                                        }

                                        public void unsubscribe(String arg0) throws JMSException {
                                            // TODO Auto-generated method stub
                                            
                                        }};
                                }

                                public String getClientID() throws JMSException {
                                    // TODO Auto-generated method stub
                                    return null;
                                }

                                public ExceptionListener getExceptionListener() throws JMSException {
                                    // TODO Auto-generated method stub
                                    return null;
                                }

                                public ConnectionMetaData getMetaData() throws JMSException {
                                    // TODO Auto-generated method stub
                                    return null;
                                }

                                public void setClientID(String arg0) throws JMSException {
                                    // TODO Auto-generated method stub
                                    
                                }

                                public void setExceptionListener(ExceptionListener arg0) throws JMSException {
                                    // TODO Auto-generated method stub
                                    
                                }

                                public void start() throws JMSException {
                                    // TODO Auto-generated method stub
                                    
                                }

                                public void stop() throws JMSException {
                                    // TODO Auto-generated method stub
                                    
                                }};
                        }
                        public Connection createConnection(String arg0, String arg1) throws JMSException {
                            return null;
                        }};
                } else {
                    return new Queue(){
                        public String getQueueName() throws JMSException {
                            return null;
                        }};
                }
            }

            public Object lookupLink(Name name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public Object lookupLink(String name) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public void rebind(Name name, Object obj) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public void rebind(String name, Object obj) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public Object removeFromEnvironment(String propName) throws NamingException {
                // TODO Auto-generated method stub
                return null;
            }

            public void rename(Name oldName, Name newName) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public void rename(String oldName, String newName) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public void unbind(Name name) throws NamingException {
                // TODO Auto-generated method stub
                
            }

            public void unbind(String name) throws NamingException {
                // TODO Auto-generated method stub
                
            }};
    }
    
}