KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > instance > ModulesManager


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.instance;
25
26 import java.util.Map JavaDoc;
27 import java.util.HashMap JavaDoc;
28
29 import com.sun.enterprise.config.ConfigContext;
30 import com.sun.enterprise.deployment.backend.DeployableObjectInfo;
31 import com.sun.enterprise.deployment.backend.DeployableObjectType;
32 import com.sun.enterprise.deployment.Application;
33 import com.sun.enterprise.deployment.RootDeploymentDescriptor;
34 import com.sun.enterprise.config.serverbeans.*;
35 import com.sun.enterprise.config.ConfigException;
36
37 import com.sun.enterprise.config.serverbeans.PropertyResolver;
38
39 /** Base-class for all the different types of ModulesManager's.
40  * Put common code that applies to all types of modules in here...
41  **/

42
43 public abstract class ModulesManager extends BaseManager {
44     protected ModulesManager(InstanceEnvironment env, boolean useBackupServerXml) throws ConfigException {
45         super(env, useBackupServerXml);
46     }
47     
48     /**
49      * @return the registered descriptors map
50      */

51     public Map JavaDoc getRegisteredDescriptors() {
52                 
53         if (modules==null) {
54             synchronized (ModulesManager.class) {
55                 if (modules==null) {
56                     modules = new HashMap JavaDoc();
57                 }
58             }
59         }
60         return modules;
61     }
62     
63     protected String JavaDoc resolvePath(String JavaDoc path) {
64         String JavaDoc resolved = path;
65         try {
66             resolved = new PropertyResolver(configContext,
67                 getInstanceEnvironment().getName()).resolve(path);
68         } catch (ConfigException ce) {
69             //log this.
70
}
71         return resolved;
72     }
73
74     private static Map JavaDoc modules = null;
75     
76 }
77
Popular Tags