KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > server > DummyWebModuleLoader


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 package com.sun.enterprise.server;
24
25 import javax.management.MBeanException JavaDoc;
26 import com.sun.enterprise.instance.WebModulesManager;
27 import com.sun.enterprise.deployment.Descriptor;
28 import java.net.URL JavaDoc;
29 import java.util.jar.Manifest JavaDoc;
30 import java.util.logging.Level JavaDoc;
31 import java.util.logging.Logger JavaDoc;
32 import com.sun.logging.LogDomains;
33 import com.sun.enterprise.config.ConfigException;
34 import com.sun.enterprise.server.event.ApplicationEvent;
35
36 /**
37  * This is just a dummy module loader for web application. The only responsibility
38  * of this class is to generate a notifictation event so that ondemand init code
39  * can load the web applications as the appserver starts up.
40  *
41  * @author Binod PG
42  */

43 public class DummyWebModuleLoader extends AbstractLoader {
44
45     static Logger JavaDoc _logger=LogDomains.getLogger(LogDomains.LOADER_LOGGER);
46
47     /**
48      * Constructs a dummy loader. It generates a descriptor representing
49      * the webapp.
50      */

51     DummyWebModuleLoader(String JavaDoc id, ClassLoader JavaDoc loader, WebModulesManager manager) {
52         super(id, loader, manager);
53         try {
54             this.application = manager.getDescriptor(id, manager.getLocation(id));
55         } catch (ConfigException confEx) {
56             _logger.log(Level.SEVERE,"loader.configexception", confEx);
57         }
58     }
59
60     //Dummy load. Notification is fired here.
61
boolean load(boolean jsr77) {
62         notifyAppEvent(ApplicationEvent.BEFORE_APPLICATION_LOAD);
63         loadWebserviceEndpoints(jsr77);
64         return true;
65     }
66
67     boolean unload(boolean jsr77) {
68         unloadWebserviceEndpoints(jsr77);
69         return true;
70     }
71
72     void createRootMBean () throws MBeanException JavaDoc {
73     }
74
75     void deleteRootMBean () throws MBeanException JavaDoc{
76     }
77
78     void createLeafMBeans () throws MBeanException JavaDoc{
79     }
80
81     void deleteLeafMBeans () throws MBeanException JavaDoc {
82     }
83
84     void createLeafMBean (Descriptor descriptor) throws MBeanException JavaDoc {
85     }
86
87     void deleteLeafMBean (Descriptor descriptor) throws MBeanException JavaDoc {
88     }
89
90     void deleteLeafAndRootMBeans () throws MBeanException JavaDoc {
91     }
92
93     void setState(int state) throws MBeanException JavaDoc {
94     }
95 }
96
Popular Tags