KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > connectors > PoolMetaData


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.connectors;
25
26 import javax.resource.spi.ManagedConnectionFactory JavaDoc;
27 import javax.security.auth.Subject JavaDoc;
28 import com.sun.enterprise.deployment.ResourcePrincipal;
29 import com.sun.enterprise.connectors.authentication.RuntimeSecurityMap;
30
31
32 /**
33   * Information about the ConnectorConnectionPool.
34   * Stored inofrmation is:
35   * 1. Default Subject
36   * 2. MCF Instance
37   * 3. Password, UserName
38   * 4. The transaction-support attribute level in case of connector
39   * connection pools
40   * 5. The allow-non-component-callers, non-trasnactional-connections
41   * attribs for jdbc connection pools
42   *
43   * @author Binod P.G., Aditya Gore
44   * @version
45  */

46
47 public class PoolMetaData {
48
49     private ManagedConnectionFactory JavaDoc mcf = null;
50     private String JavaDoc poolName = null;
51     private Subject JavaDoc subj = null;
52     private ResourcePrincipal prin_;
53     private int txSupport_;
54     private boolean isPM_ = false;
55     private boolean isNonTx_ = false;
56     private RuntimeSecurityMap runtimeSecurityMap;
57     private boolean lazyEnlistable_ = false;
58     private boolean lazyAssoc_ = false;
59     private boolean isAuthCredentialsDefinedInPool_ = true;
60     
61     public PoolMetaData(String JavaDoc poolName, ManagedConnectionFactory JavaDoc mcf,
62                    Subject JavaDoc s, int txSupport, ResourcePrincipal prin,
63                    boolean isPM, boolean isNonTx, boolean lazyEnlistable,
64                    RuntimeSecurityMap runtimeSecurityMap, boolean lazyAssoc) {
65         this.poolName = poolName;
66     this.mcf = mcf;
67     this.subj = s;
68     txSupport_ = txSupport;
69     prin_ = prin;
70         isPM_ = isPM;
71         isNonTx_ = isNonTx;
72         lazyEnlistable_ = lazyEnlistable;
73         lazyAssoc_ = lazyAssoc;
74         this.runtimeSecurityMap = runtimeSecurityMap;
75     }
76
77     public ManagedConnectionFactory JavaDoc getMCF() {
78         return this.mcf;
79     }
80
81     public Subject JavaDoc getSubject() {
82         return this.subj;
83     }
84
85     public int getTransactionSupport() {
86         return txSupport_;
87     }
88
89     public ResourcePrincipal getResourcePrincipal() {
90         return prin_;
91     }
92     
93     
94     public void setIsNonTx( boolean flag ) {
95         isNonTx_ = flag;
96     }
97     
98     
99     public boolean isNonTx() {
100         return isNonTx_;
101     }
102     
103     
104     public void setIsPM( boolean flag ) {
105         isPM_ = flag;
106     }
107     
108     
109     public boolean isPM() {
110         return isPM_;
111     }
112     
113     public RuntimeSecurityMap getRuntimeSecurityMap(){
114         return this.runtimeSecurityMap;
115     }
116
117     public void setLazyEnlistable( boolean flag ) {
118         lazyEnlistable_ = flag;
119     }
120     
121     public boolean isLazyEnlistable() {
122         return lazyEnlistable_;
123     }
124
125     public void setLazyAssoc( boolean flag ) {
126         lazyAssoc_ = flag;
127     }
128     
129     public boolean isLazyAssociatable() {
130         return lazyAssoc_;
131     }
132
133     public void setAuthCredentialsDefinedInPool(boolean authCred) {
134         this.isAuthCredentialsDefinedInPool_ = authCred;
135     }
136
137     public boolean isAuthCredentialsDefinedInPool() {
138         return this.isAuthCredentialsDefinedInPool_;
139     }
140    
141     public String JavaDoc toString() {
142         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("PoolMetaData : " + poolName );
143         sb.append( "\ntxSupport => " + txSupport_ );
144         sb.append( "\nisPM_ => " + isPM_ );
145         sb.append( "\nisNonTx_ => " + isNonTx_ );
146         sb.append( "\nisLazyEnlistable_ => " + lazyEnlistable_ );
147         sb.append( "\nisLazyAssociatable => " + lazyAssoc_ );
148         sb.append( "\nsecurityMap => " + runtimeSecurityMap.toString());
149         return sb.toString();
150     }
151 }
152
Popular Tags