KickJava   Java API By Example, From Geeks To Geeks.

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


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
28 /**
29  * Resource info for Non-XA JDBC DataSources for IAS.
30  * IASRI #4626188
31  * @author Sridatta Viswanath
32  */

33 public class IASJdbcResource extends JdbcResource {
34
35     private JdbcConnectionPool jdbcConnectionPool_;
36
37     public IASJdbcResource(String JavaDoc name) {
38         super(name);
39     }
40     protected J2EEResource doClone(String JavaDoc name) {
41         IASJdbcResource clone = new IASJdbcResource(name);
42         clone.setEnabled(isEnabled());
43         clone.setDescription(getDescription());
44         clone.setJdbcConnectionPool(getJdbcConnectionPool());
45         return clone;
46     }
47
48     public String JavaDoc getUserName() {
49         return getJdbcConnectionPool().getUserName();
50     }
51    
52     public String JavaDoc getPassword() {
53         return getJdbcConnectionPool().getPassword();
54     }
55
56     public JdbcConnectionPool getJdbcConnectionPool() {
57         return jdbcConnectionPool_;
58     }
59     
60     public void setJdbcConnectionPool(JdbcConnectionPool jdbcConnectionPool) {
61         jdbcConnectionPool_ = jdbcConnectionPool;
62     }
63     
64     public Set getProperties() {
65         return getJdbcConnectionPool().getProperties();
66     }
67     
68     public void addProperty(ResourceProperty property) {
69         getJdbcConnectionPool().addProperty(property);
70     }
71
72     public boolean removeProperty(ResourceProperty property) {
73         return getJdbcConnectionPool().removeProperty(property);
74     }
75
76     public ResourceProperty getProperty(String JavaDoc propertyName) {
77         return getJdbcConnectionPool().getProperty(propertyName);
78     }
79     
80     public String JavaDoc toString() {
81         return "< IAS JDBC Resource : " + getName() + " >";
82     }
83 }
84
Popular Tags