KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > connectors > util > ConnectorConfigParserFactory


1
2 /*
3  * The contents of this file are subject to the terms
4  * of the Common Development and Distribution License
5  * (the License). You may not use this file except in
6  * compliance with the License.
7  *
8  * You can obtain a copy of the license at
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
10  * glassfish/bootstrap/legal/CDDLv1.0.txt.
11  * See the License for the specific language governing
12  * permissions and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL
15  * Header Notice in each file and include the License file
16  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
17  * If applicable, add the following below the CDDL Header,
18  * with the fields enclosed by brackets [] replaced by
19  * you own identifying information:
20  * "Portions Copyrighted [year] [name of copyright owner]"
21  *
22  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23  */

24
25 package com.sun.enterprise.connectors.util;
26
27 /**
28  * This is a factory class for the connector configuration parser classes.
29  * @author Srikanth P
30  */

31
32 public class ConnectorConfigParserFactory {
33
34
35     /**
36      * Returns a specific connector configuration parser class based on the
37      * type of configurations to parse.
38      *
39      * @param type Parser class type.
40      * @return parser class
41      */

42
43     public static ConnectorConfigParser getParser(String JavaDoc type) {
44
45         if(type == null) {
46             return null;
47         }
48         if(type.equals(ConnectorConfigParser.AOR)) {
49             return new AdminObjectConfigParserImpl();
50         } else if(type.equals(ConnectorConfigParser.MCF)) {
51             return new MCFConfigParserImpl();
52         } else if(type.equals(ConnectorConfigParser.RA)) {
53             return new ResourceAdapterConfigParserImpl();
54         } else if(type.equals(ConnectorConfigParser.MSL)) {
55             return new MessageListenerConfigParserImpl();
56         } else {
57             return null;
58         }
59     }
60 }
61
Popular Tags