KickJava   Java API By Example, From Geeks To Geeks.

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


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;
26
27 /**
28  * This is a factory class for the connector admin services classes.
29  * @author Srikanth P
30  */

31
32 public class ConnectorAdminServicesFactory {
33
34
35     /**
36      * Returns a specific connector admin service implemntation class based
37      * on the type of service.
38      *
39      * @param type Service type.
40      * @return COnnectorAdminService implementation class
41      */

42
43     public static ConnectorAdminService getService(String JavaDoc type) {
44
45         if(type == null) {
46             return null;
47         }
48         if(type.equals(ConnectorAdminService.CCP)) {
49             return new ConnectorConnectionPoolAdminServiceImpl();
50         } else if(type.equals(ConnectorAdminService.CR)) {
51             return new ConnectorResourceAdminServiceImpl();
52         } else if(type.equals(ConnectorAdminService.AOR)) {
53             return new ConnectorAdminObjectAdminServiceImpl();
54         } else if(type.equals(ConnectorAdminService.SEC)) {
55             return new ConnectorSecurityAdminServiceImpl();
56         } else if(type.equals(ConnectorAdminService.RA)) {
57             return new ResourceAdapterAdminServiceImpl();
58         } else {
59             return null;
60         }
61     }
62 }
63
Popular Tags