KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > repository > JmsCnxFactoryResource


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 package com.sun.enterprise.repository;
24
25 import java.io.Serializable JavaDoc;
26 import java.util.Set JavaDoc;
27 import java.util.Iterator JavaDoc;
28 import com.sun.enterprise.util.LocalStringManagerImpl;
29
30 /**
31  * Resource info for Jms Connection Factory info,
32  * both topic and queue.
33  *
34  * @author Kenneth Saks
35  */

36 public class JmsCnxFactoryResource extends J2EEResourceBase
37     implements Serializable JavaDoc {
38
39     private static LocalStringManagerImpl localStrings =
40         new LocalStringManagerImpl(JmsCnxFactoryResource.class);
41
42     private boolean isQueue_;
43
44     public JmsCnxFactoryResource(String JavaDoc name) {
45         super(name);
46     }
47
48     protected J2EEResource doClone(String JavaDoc name) {
49         JmsCnxFactoryResource clone = new JmsCnxFactoryResource(name);
50         clone.setIsQueue(getIsQueue());
51         return clone;
52     }
53
54     public int getType() {
55         return J2EEResource.JMS_CNX_FACTORY;
56     }
57
58     //START IASRI 4675235
59
public String JavaDoc getTypeString() {
60         if (getIsQueue()) return IASJ2EEResourceFactoryImpl.JMS_QUEUE_CONNECTION_FACTORY;
61         return IASJ2EEResourceFactoryImpl.JMS_TOPIC_CONNECTION_FACTORY;
62     }
63     //END IASRI 4675235
64

65     public boolean getIsQueue() {
66         return isQueue_;
67     }
68     
69     public void setIsQueue(boolean isQueue) {
70         isQueue_ = isQueue;
71     }
72
73     public String JavaDoc toString() {
74         String JavaDoc propsString = getPropsString();
75         
76         //START IASRI 4675235
77
String JavaDoc npMsg = localStrings.getLocalString("enterprise.repository.resource_noproperties", "No Properties");
78
79         return "< JMS Connection Factory: " + getName() + ", " +
80                   getTypeString()+ ", " +
81                   ((propsString.length() > 0) ?
82                   propsString : npMsg) + " >";
83         //END IASRI 4675235
84

85     }
86 }
87
Popular Tags