KickJava   Java API By Example, From Geeks To Geeks.

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


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.*;
27 import com.sun.enterprise.util.Utility;
28
29 /**
30  * Resource info for JDBC XA DataSources.
31  *
32  * @author Kenneth Saks
33  */

34 public class IASJdbcXAResource extends JdbcXAResource {
35     
36     private JdbcConnectionPool jdbcConnectionPool_;
37     
38     public IASJdbcXAResource(String JavaDoc name) {
39         super(name);
40     }
41
42     protected J2EEResource doClone(String JavaDoc name) {
43         IASJdbcXAResource clone = new IASJdbcXAResource(name);
44         clone.setEnabled(isEnabled());
45         clone.setDescription(getDescription());
46         clone.setJdbcConnectionPool(getJdbcConnectionPool());
47         return clone;
48     }
49
50
51     public String JavaDoc getUserName() {
52         return getJdbcConnectionPool().getUserName();
53     }
54     
55     public String JavaDoc getPassword() {
56         return getJdbcConnectionPool().getPassword();
57     }
58     
59     public String JavaDoc getClassname() {
60         return getJdbcConnectionPool().getDatasourceClassname();
61     }
62
63     public void setClassname(String JavaDoc classname) {
64         getJdbcConnectionPool().setDatasourceClassname(classname);
65     }
66     
67     public JdbcConnectionPool getJdbcConnectionPool() {
68         return jdbcConnectionPool_;
69     }
70     
71     public void setJdbcConnectionPool(JdbcConnectionPool jdbcConnectionPool) {
72         jdbcConnectionPool_ = jdbcConnectionPool;
73     }
74
75     public Set getProperties() {
76         return getJdbcConnectionPool().getProperties();
77     }
78     
79     public void addProperty(ResourceProperty property) {
80         getJdbcConnectionPool().addProperty(property);
81     }
82
83     public boolean removeProperty(ResourceProperty property) {
84         return getJdbcConnectionPool().removeProperty(property);
85     }
86
87     public ResourceProperty getProperty(String JavaDoc propertyName) {
88         return getJdbcConnectionPool().getProperty(propertyName);
89     }
90     
91     public String JavaDoc toString() {
92         String JavaDoc propsString = getPropsString();
93         return "< IAS JDBC XA Resource : " + getName() +
94             ((propsString.length() > 0) ?
95              propsString : "No properties") + " >";
96     }
97 }
98
Popular Tags