1 /*
2 * @(#)DestinationImpl.java
3 *
4 * JFoxMQ the open source JMS MOM.
5 *
6 * Corpyright 2002-2003 Huihoo Power, Inc. All Rights Reserved. This software
7 * is licensed under LGPL license.
8 *
9 * For more information, please visit: http://www.huihoo.org
10 */
11
12 package org.huihoo.jfox.ms.jms.base;
13
14 import java.io.Serializable;
15
16 import javax.jms.Destination;
17 import javax.naming.NamingException;
18 import javax.naming.Reference;
19 import javax.naming.Referenceable;
20 import javax.naming.StringRefAddr;
21
22 /***
23 * <p>
24 * This class implements javax.jms.Destination.
25 * </p>
26 *
27 * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter.Cheng</a>
28 * @version Revision: 1.1 Date: 2002-11-17 19:36:21
29 */
30
31 public class DestinationImpl
32 implements Destination, Referenceable, Serializable {
33
34 private String name;
35 public static final int QUEUE = 0;
36 public static final int TOPIC = 1;
37
38 public DestinationImpl() {
39 }
40
41 public Reference getReference() throws NamingException {
42 return new Reference(
43 this.getClass().getName(),
44 new StringRefAddr("name", name),
45 ConnectionFactoryObjectFactory.class.getName(),
46 null);
47 }
48
49 /***
50 * Create DestinationImpl with given name.
51 *
52 * @param name
53 */
54 public DestinationImpl(String name) {
55 this.name = name;
56 }
57
58 /***
59 * Return destination name.
60 *
61 * @return provider specific identity for destination.
62 */
63 public String toString() {
64 return "Destination name: " + name;
65 }
66
67 /***
68 * Set destination name.
69 *
70 * @param name
71 *
72 */
73 public void setName(String name) {
74 this.name = name;
75 }
76
77 /***
78 * Return destination name.
79 *
80 * @return name
81 */
82 public String getName() {
83 return this.name;
84 }
85 }
This page was automatically generated by Maven