KickJava   Java API By Example, From Geeks To Geeks.

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


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
27 /**
28  * Resource info for ExternalJndiResource.
29  * IASRI #4626188
30  * @author Sridatta Viswanath
31  */

32 public class ExternalJndiResource extends J2EEResourceBase implements Serializable JavaDoc {
33     
34     private String JavaDoc jndiLookupName_;
35     private String JavaDoc resType_;
36     private String JavaDoc factoryClass_;
37     
38     public ExternalJndiResource(String JavaDoc name) {
39         super(name);
40     }
41     
42     protected J2EEResource doClone(String JavaDoc name) {
43         ExternalJndiResource clone = new ExternalJndiResource(name);
44         clone.setJndiLookupName(getJndiLookupName());
45         clone.setResType(getResType());
46         clone.setFactoryClass(getFactoryClass());
47         return clone;
48     }
49     
50     public int getType() {
51         return J2EEResource.EXTERNAL_JNDI_RESOURCE;
52     }
53     
54     public String JavaDoc getJndiLookupName() {
55         return jndiLookupName_;
56     }
57     
58     public void setJndiLookupName(String JavaDoc jndiLookupName) {
59         jndiLookupName_ = jndiLookupName;
60     }
61     
62     public String JavaDoc getResType() {
63         return resType_;
64     }
65     
66     public void setResType(String JavaDoc resType) {
67         resType_ = resType;
68     }
69     
70     public String JavaDoc getFactoryClass() {
71         return factoryClass_;
72     }
73     
74     public void setFactoryClass(String JavaDoc factoryClass) {
75         factoryClass_ = factoryClass;
76     }
77     
78     //START OF IASRI 4660565
79
public boolean isJMSConnectionFactory() {
80         if (resType_ == null) return false;
81
82         return (IASJ2EEResourceFactoryImpl.JMS_QUEUE_CONNECTION_FACTORY.equals(resType_) ||
83                 IASJ2EEResourceFactoryImpl.JMS_TOPIC_CONNECTION_FACTORY.equals(resType_));
84     }
85     //END OF IASRI 4660565
86

87     public String JavaDoc toString() {
88         return "< External Jndi Resource : " + getName() + " , " + getJndiLookupName() + "... >";
89     }
90 }
91
Popular Tags