KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > upgrade > cluster > LBInstance


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 /*
25  * LBInstance.java
26  *
27  * Created on June 21, 2004, 4:54 PM
28  */

29
30 package com.sun.enterprise.tools.upgrade.cluster;
31
32 /**
33  * This class represents instance element in loadbalancer.
34  *
35  * @author prakash
36  */

37
38 import java.util.*;
39 import org.w3c.dom.Element JavaDoc;
40
41 public class LBInstance {
42     
43     private String JavaDoc name;
44     private boolean enabled;
45     private int disableTimeOut;
46     private List listeners; // delimiter is space
47
/** Creates a new instance of LBInstance */
48     public LBInstance(Element JavaDoc ele) {
49         this.name = ele.getAttribute("name");
50         this.enabled = Boolean.getBoolean(ele.getAttribute("enabled"));
51         this.disableTimeOut = Integer.getInteger(ele.getAttribute("disable-timeout-in-minutes")).intValue();
52         listeners = new ArrayList();
53         String JavaDoc listenersList = ele.getAttribute("listeners");
54         StringTokenizer stk = new StringTokenizer(listenersList, " ");
55         while(stk.hasMoreTokens()){
56             listeners.add(stk.nextToken());
57         }
58     }
59     public int getDisableTimeOut() {
60         return disableTimeOut;
61     }
62         
63     public boolean isEnabled() {
64         return enabled;
65     }
66     
67     public java.util.List JavaDoc getListeners() {
68         return listeners;
69     }
70     public java.lang.String JavaDoc getName() {
71         return name;
72     }
73 }
74
Popular Tags