KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > server > ondemand > OnDemandServices


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.server.ondemand;
25
26 import java.util.Properties JavaDoc;
27 import com.sun.enterprise.server.pluggable.InternalServicesList;
28
29 /**
30  * pluggable interface (this class will provide ApplicationServer
31  * with the right lifecycles array)
32  */

33 public class OnDemandServices implements InternalServicesList {
34
35    public String JavaDoc[][] getServicesByName() {
36         int sze = getEjbServiceGroupServices().length +
37                   getWebServiceGroupServices().length +
38                   getResourcesServiceGroupServices().length ;
39         String JavaDoc[][] servicesByName = new String JavaDoc[sze][2];
40
41         int idx = 0;
42         for (String JavaDoc[] service : getEjbServiceGroupServices()) {
43              servicesByName[idx][0] = service[0];
44              servicesByName[idx][1] = service[1];
45              idx++;
46         }
47
48         for (String JavaDoc[] service : getWebServiceGroupServices()) {
49              servicesByName[idx][0] = service[0];
50              servicesByName[idx][1] = service[1];
51              idx++;
52         }
53
54         for (String JavaDoc[] service : getResourcesServiceGroupServices()) {
55              servicesByName[idx][0] = service[0];
56              servicesByName[idx][1] = service[1];
57              idx++;
58         }
59
60     return servicesByName;
61    }
62
63
64    // Return all services belongs to EJB servicegroup.
65
public static String JavaDoc[][] getEjbServiceGroupServices() {
66     String JavaDoc[][] servicesByName = {
67     };
68     return servicesByName;
69    }
70
71    // Return all services belongs to Web servicegroup.
72
public static String JavaDoc[][] getWebServiceGroupServices () {
73     String JavaDoc[][] servicesByName = {
74                 {"Servlet/JSP Service",
75                 "com.sun.enterprise.web.PEWebContainerLifecycle"},
76     };
77     return servicesByName;
78    }
79
80    // Return all services belongs to Resources servicegroup.
81
public static String JavaDoc[][] getResourcesServiceGroupServices () {
82     String JavaDoc[][] servicesByName = {
83         {"JMSProvider",
84             "com.sun.enterprise.jms.JmsProviderLifecycle"},
85     };
86     return servicesByName;
87    }
88
89 }
90
Popular Tags