djencks 2003/12/28 11:38:19
Modified: modules/web/src/java/org/apache/geronimo/web
AbstractWebApplication.java
modules/web/src/java/org/apache/geronimo/web/jetty
JettyWebApplication.java
JettyWebApplicationContext.java
Log:
minor cleanup to go with security service changes
Revision Changes Path
1.11 +63 -63
incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/AbstractWebApplication.java
Index: AbstractWebApplication.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/AbstractWebApplication.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AbstractWebApplication.java 20 Nov 2003 09:10:17 -0000 1.10
+++ AbstractWebApplication.java 28 Dec 2003 19:38:19 -0000 1.11
@@ -79,8 +79,8 @@
*
* Instances are created by a deployer. The deployer finds the
* WebContainer and associates it with the WebApplication.
- *
- * @jmx:mbean extends="org.apache.geronimo.web.WebApplication,
org.apache.geronimo.kernel.management.ManagedObject,
org.apache.geronimo.kernel.management.StateManageable,
javax.management.MBeanRegistration"
+ *
+ * @jmx:mbean extends="org.apache.geronimo.web.WebApplication,
org.apache.geronimo.kernel.management.ManagedObject,
org.apache.geronimo.kernel.management.StateManageable,
javax.management.MBeanRegistration"
* @version $Revision$ $Date$
*/
public abstract class AbstractWebApplication extends
AbstractManagedComponent implements WebApplication {
@@ -88,43 +88,43 @@
private final static Log log =
LogFactory.getLog(AbstractWebApplication.class);
//uri of the webapp
- protected URI uri;
-
+ protected final URI uri;
+
// pojo for web.xml
protected WebApp webDDObj;
-
+
// pojo for geronimo-web.xml
protected GeronimoWebAppDocument geronimoDDObj;
-
+
// parsed web.xml
protected Document deploymentDescriptorDoc;
-
+
// deployment descriptor as a string
protected String deploymentDescriptorStr;
-
+
//jndi context for webapp
protected Context context;
-
+
//servlet definitions
protected String[] servlets;
-
+
// context path of webapp
protected String contextPath;
-
+
//class loading delegation model. Default to web-app scope
private boolean java2ClassloadingCompliance = false;
-
+
/**
* Creates a new <code>AbstractWebApplication</code> instance.
*
*/
public AbstractWebApplication() {
-
+ uri = null;
}
-
-
+
+
/**
* Creates a new <code>AbstractWebApplication</code> instance.
*
@@ -135,19 +135,19 @@
}
-
-
-
+
+
+
/**
* Start the webapp. Called by the container or management interface
* @throws Exception
* @throws IllegalStateException
*/
public void doStart() throws Exception {
-
+
}
-
+
/**
* Stop the webapp. Called by the container, or by mangement
* interface
@@ -156,10 +156,10 @@
}
-
-
-
+
+
+
/** Get the URI of this webapp
* @return the URI of the webapp
* @see org.apache.geronimo.web.WebApplication#getURI()
@@ -168,9 +168,9 @@
return uri;
}
-
-
+
+
/**
* Setter for classloading compliance. If true, then classloading will
* delegate first to parent classloader a la Java2 spec. If false, then
@@ -181,7 +181,7 @@
java2ClassloadingCompliance = state;
}
-
+
/**
* Getter for classloading compliance.
* @return truen if application is using Java 2 compliant class loading
@@ -191,7 +191,7 @@
}
-
+
/** Set the container to which this webapp belongs.
* In turn, we add ourselves as a component to that container.
* @param container
@@ -201,8 +201,8 @@
super.setContainer(container);
container.addComponent (this);
}
-
-
+
+
/** JSR077
* Return the list of Servlets of this webapp
* @return
@@ -210,31 +210,31 @@
*/
public String[] getServlets() {
if (servlets == null) {
- if (webDDObj == null)
+ if (webDDObj == null)
return null;
-
+
Servlet[] servletObjs = webDDObj.getServlet();
servlets = new String[servletObjs.length];
for (int i=0; i<servletObjs.length; i++) {
- servlets[i] = servletObjs[i].getServletName();
+ servlets[i] = servletObjs[i].getServletName();
}
}
-
+
return servlets;
}
-
+
/** JSR077
- * TODO: This method should be able to be implemented based on the
pojos.
+ * TODO: This method should be able to be implemented based on the
pojos.
* Need a method to get from pojo->xml->string
* @return web.xml as a string
* @see org.apache.geronimo.web.WebApplication#getDeploymentDescriptor()
*/
public abstract String getDeploymentDescriptor();
-
-
+
+
/**JSR077
* @return ObjectName(s) as string of JVM(s) on which this webapp is
deployed
* @see org.apache.geronimo.kernel.management.J2EEModule#getJavaVMs()
@@ -245,7 +245,7 @@
}
- /** JSR077
+ /** JSR077
* @return ObjectName as string of Geronimo server on which this webapp
is deployed
* @see
org.apache.geronimo.kernel.management.J2EEDeployedObject#getServer()
*/
@@ -255,8 +255,8 @@
}
-
- /*
+
+ /*
* @return
* @see org.apache.geronimo.web.WebApplication#getComponentContext()
*/
@@ -265,15 +265,15 @@
}
- /*
+ /*
* @param context
* @see
org.apache.geronimo.web.WebApplication#setComponentContext(javax.naming.Context)
*/
public void setComponentContext(Context context) {
this.context = context;
}
-
- /*
+
+ /*
* @return
* @see org.apache.geronimo.web.WebApplication#getContextPath()
*/
@@ -281,17 +281,17 @@
return contextPath;
}
-
- /*
+
+ /*
* @param path
* @see
org.apache.geronimo.web.WebApplication#setContextPath(java.lang.String)
*/
public void setContextPath(String path) {
contextPath = path;
}
-
-
- /*
+
+
+ /*
* @return
* @see org.apache.geronimo.web.WebApplication#getParentClassLoader()
*/
@@ -300,12 +300,12 @@
return null;
}
-
-
-
- /*
+
+
+
+ /*
* @param loader
* @see
org.apache.geronimo.web.WebApplication#setParentClassLoader(java.lang.ClassLoader)
*/
@@ -314,18 +314,18 @@
}
-
-
- /*
- *
+
+
+ /*
+ *
* @see org.apache.geronimo.web.WebApplication#setGeronimoDDObj()
*/
public void setGeronimoDDObj(GeronimoWebAppDocument geronimoDDObj) {
this.geronimoDDObj = geronimoDDObj;
}
-
-
- /*
+
+
+ /*
* @return
* @see org.apache.geronimo.web.WebApplication#getGeronimoDDObj()
*/
@@ -333,18 +333,18 @@
return geronimoDDObj;
}
- /*
+ /*
* @param webDDObj
* @see
org.apache.geronimo.web.WebApplication#setWebDDObj(org.apache.geronimo.deployment.model.web.WebApp)
*/
public void setWebDDObj(WebApp webDDObj) {
this.webDDObj = webDDObj;
}
-
+
public WebApp getWebDDObj () {
return webDDObj;
}
-
+
}
1.8 +8 -8
incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty/JettyWebApplication.java
Index: JettyWebApplication.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty/JettyWebApplication.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- JettyWebApplication.java 25 Nov 2003 13:51:30 -0000 1.7
+++ JettyWebApplication.java 28 Dec 2003 19:38:19 -0000 1.8
@@ -30,7 +30,7 @@
private JettyWebApplicationContext jettyContext;
private final Log log = LogFactory.getLog(getClass());
-
+
public JettyWebApplication() {
super();
jettyContext = new JettyWebApplicationContext();
@@ -74,7 +74,7 @@
return jettyContext.getContextPath();
}
-
+
/* Hacky implementation of getting the web.xm as a String.
* This should be handled by converting pojo->xml->string
* @return
@@ -83,7 +83,7 @@
public String getDeploymentDescriptor() {
if (deploymentDescriptorStr != null)
return deploymentDescriptorStr;
-
+
BufferedReader reader = null;
try {
URL url = new URL (jettyContext.getDeploymentDescriptor());
@@ -97,11 +97,11 @@
else
strbuff.append (line);
}
-
+
deploymentDescriptorStr = strbuff.toString();
return deploymentDescriptorStr;
-
+
} catch (IOException e) {
log.error (e);
return null;
@@ -112,8 +112,8 @@
} catch (IOException e) {
log.warn("Error closing web.xml reader", e);
}
-
- }
+
+ }
}
public boolean getJava2ClassloadingCompliance() {
1.4 +3 -5
incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty/JettyWebApplicationContext.java
Index: JettyWebApplicationContext.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty/JettyWebApplicationContext.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JettyWebApplicationContext.java 25 Nov 2003 13:51:30 -0000 1.3
+++ JettyWebApplicationContext.java 28 Dec 2003 19:38:19 -0000 1.4
@@ -60,7 +60,6 @@
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.naming.java.ReadOnlyContext;
import org.apache.geronimo.naming.java.RootContext;
-import org.apache.geronimo.security.GeronimoLoginConfiguration;
import org.mortbay.http.HttpRequest;
import org.mortbay.http.HttpResponse;
@@ -70,8 +69,8 @@
import javax.security.jacc.PolicyContext;
/**
- *
- *
+ *
+ *
* @version $Revision$ $Date$
*/
public class JettyWebApplicationContext extends WebApplicationContext {
@@ -90,7 +89,6 @@
public Object enterContextScope(HttpRequest httpRequest, HttpResponse
httpResponse) {
log.info("Entering context " + httpRequest.getRequestURL());
RootContext.setComponentContext((ReadOnlyContext)componentContext);
- GeronimoLoginConfiguration.setMBeanServer(server);
PolicyContext.setContextID(contextID);
return super.enterContextScope(httpRequest, httpResponse);
}