KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > common > JMSObjectInfo


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.admin.common;
25
26 import java.io.Serializable JavaDoc;
27 import java.util.Properties JavaDoc;
28
29 import com.sun.enterprise.admin.util.ArgChecker;
30 import com.sun.enterprise.admin.util.StringValidator;
31
32 /**
33     A class representing the <code> information </code> on one JMS object.
34
35    @author Isa Hashim
36     @version 1.0
37 */

38
39 public class JMSObjectInfo implements Serializable JavaDoc
40 {
41     private String JavaDoc jndiName,
42             type;
43     private Properties JavaDoc attrs;
44
45     public JMSObjectInfo (String JavaDoc jndiName, String JavaDoc type)
46     {
47         ArgChecker.checkValid(jndiName, "jndiName",
48                               StringValidator.getInstance()); //noi18n
49
ArgChecker.checkValid(type, "type",
50                               StringValidator.getInstance()); //noi18n
51

52         this.jndiName = jndiName;
53         this.type = type;
54         this.attrs = new Properties JavaDoc();
55     }
56
57     public JMSObjectInfo (String JavaDoc jndiName, String JavaDoc type, Properties JavaDoc attrs)
58     {
59         this(jndiName, type);
60         ArgChecker.checkValid(attrs, "attrs"); //noi18n
61
this.attrs = attrs;
62     }
63
64     public String JavaDoc getJndiName() {
65         return (jndiName);
66     }
67
68     public String JavaDoc getType() {
69         return (type);
70     }
71
72     public Properties JavaDoc getAttrs() {
73         return (attrs);
74     }
75
76     public String JavaDoc toString() {
77         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
78         sb.append(jndiName);
79         sb.append(' ');
80         sb.append(type);
81         sb.append(' ');
82         sb.append(attrs);
83         return sb.toString();
84     }
85 }
Popular Tags