KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > common > ResourceAdapterInfo


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.admin.common;
25
26 import java.io.Serializable JavaDoc;
27 import java.util.Properties JavaDoc;
28 import java.util.Set JavaDoc;
29 import java.util.Iterator JavaDoc;
30
31 import com.sun.enterprise.admin.util.ArgChecker;
32 import com.sun.enterprise.admin.util.StringValidator;
33
34
35 import com.sun.enterprise.repository.ResourceProperty;
36 /**
37     A class representing the <code> information </code> about a JCA resource adapter.
38
39    @author Ari Shapiro
40     @version 1.0
41 */

42
43 public class ResourceAdapterInfo implements Serializable JavaDoc {
44   /**the JNDI name of the resource adapter*/
45   private String JavaDoc jndiName;
46   /**the attributes of the resource adapter*/
47   private Properties JavaDoc attrs;
48
49   /**these are the iAS specific attributes*/
50   private static final String JavaDoc DEBUG_LEVEL = "debugLevel";
51   private static final String JavaDoc MAX_POOL_SIZE = "maxPoolSize";
52   private static final String JavaDoc STEADY_POOL_SIZE = "steadyPoolSize";
53   private static final String JavaDoc MAX_WAIT = "maxWait";
54   private static final String JavaDoc UNUSED_MAX_LIFE = "unusedMaxLife";
55     
56   public ResourceAdapterInfo (String JavaDoc jndiName) {
57   }
58    
59    
60    private void convertAdapterProps(Set JavaDoc props) {
61      if (props != null) {
62        Iterator JavaDoc itr = props.iterator();
63        while (itr.hasNext()) {
64          ResourceProperty prop = (ResourceProperty)itr.next();
65          attrs.setProperty(prop.getName(),prop.getValue().toString());
66        }
67      }
68    }
69    public String JavaDoc getJndiName() {
70       return jndiName;
71    }
72
73
74    public Properties JavaDoc getAttrs() {
75      return attrs;
76    }
77
78    public String JavaDoc toString() {
79      return jndiName + " " + attrs;
80    }
81 }
82
Popular Tags