KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > resource > deployment > ds > metadata > AvailabilitySupportMetaData


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22
23 package org.jboss.resource.deployment.ds.metadata;
24
25 /**
26  * A AvailabilitySupportMetaData.
27  *
28  * @author <a HREF="weston.price@jboss.com">Weston Price</a>
29  * @version $Revision: 45634 $
30  */

31 public class AvailabilitySupportMetaData implements DsElementMetaData
32 {
33
34    /** The serialVersionUID */
35    private static final long serialVersionUID = -3988804445826223939L;
36
37    /** The support */
38    private final int support;
39    
40    /** The urlDelimeter */
41    private String JavaDoc urlDelimeter;
42    
43    /** The String */
44    private String JavaDoc urlProperty;
45    
46    private AvailabilitySupportMetaData(int support)
47    {
48
49       this.support = support;
50
51    }
52
53    /** Non-HA datasource */
54    public static final AvailabilitySupportMetaData NONE = new AvailabilitySupportMetaData(0);
55
56    /** HA datasource */
57    public static final AvailabilitySupportMetaData HA_LOCAL = new AvailabilitySupportMetaData(1);
58
59    /** The HA_XA */
60    public static final AvailabilitySupportMetaData HA_XA = new AvailabilitySupportMetaData(1);
61
62    public static AvailabilitySupportMetaData fromString(String JavaDoc value)
63    {
64       AvailabilitySupportMetaData amd = null;
65       
66       if(value.equals("ha-local-tx-datasource"))
67       {
68          amd = HA_LOCAL;
69          
70       }else if(value.equals("ha-xa-datasource"))
71       {
72          amd = HA_XA;
73       
74       }else
75       {
76          amd = NONE;
77          
78       }
79       
80       return amd;
81    }
82
83    public String JavaDoc getUrlDelimeter()
84    {
85       return urlDelimeter;
86    }
87
88    public void setUrlDelimeter(String JavaDoc urlDelimeter)
89    {
90       this.urlDelimeter = urlDelimeter;
91    }
92
93    public String JavaDoc getUrlProperty()
94    {
95       return urlProperty;
96    }
97
98    public void setUrlProperty(String JavaDoc urlProperty)
99    {
100       this.urlProperty = urlProperty;
101    }
102    
103    
104 }
105
Popular Tags