User: janb
Date: 02/02/23 21:08:29
Modified: jetty/src/main/org/jboss/jetty
JBossWebApplicationContext.java Jetty.java
JettyService.java JettyServiceMBean.java
Log:
Added support for choice of Servlet2.3 or Java2 compliance for class loading
delegation.
Revision Changes Path
1.28 +8 -12
contrib/jetty/src/main/org/jboss/jetty/JBossWebApplicationContext.java
Index: JBossWebApplicationContext.java
===================================================================
RCS file:
/cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/JBossWebApplicationContext.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- JBossWebApplicationContext.java 21 Feb 2002 02:03:57 -0000 1.27
+++ JBossWebApplicationContext.java 24 Feb 2002 05:08:29 -0000 1.28
@@ -5,7 +5,7 @@
* See terms of license at gnu.org.
*/
-// $Id: JBossWebApplicationContext.java,v 1.27 2002/02/21 02:03:57 jules_gosnell
Exp $
+// $Id: JBossWebApplicationContext.java,v 1.28 2002/02/24 05:08:29 janb Exp $
// A Jetty HttpServer with the interface expected by JBoss'
// J2EEDeployer...
@@ -52,11 +52,7 @@
WebDescriptorParser descriptorParser,
WebApplication webApp,
DocumentBuilder parser,
- String warUrl,
- String storageStrategy,
- String snapshotFrequency,
- String notificationPolicy,
- String subjAttrName)
+ String warUrl)
throws java.io.IOException
{
@@ -67,13 +63,13 @@
_descriptorParser = descriptorParser;
_webApp = webApp;
_parser = parser;
- _subjAttrName = subjAttrName;
-
+ _subjAttrName = jetty.getSubjectAttributeName();
+
getServletHandler().
setSessionManager(new DistributedHttpSessionManager(this,
- storageStrategy,
- snapshotFrequency,
- notificationPolicy));
+
jetty.getHttpSessionStorageStrategy(),
+
jetty.getHttpSessionSnapshotFrequency(),
+
jetty.getHttpSessionSnapshotNotificationPolicy()));
}
/* ------------------------------------------------------------ */
@@ -162,7 +158,7 @@
ClassLoader _loader=getClassLoader();
if (_loader instanceof org.mortbay.http.ContextLoader)
- ((org.mortbay.http.ContextLoader)_loader).setJava2Compliant(true);
+
((org.mortbay.http.ContextLoader)_loader).setJava2Compliant(_jetty.getJava2ClassLoadingCompliance());
}
String _separator=System.getProperty("path.separator");
1.41 +28 -7 contrib/jetty/src/main/org/jboss/jetty/Jetty.java
Index: Jetty.java
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/Jetty.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- Jetty.java 21 Feb 2002 02:03:57 -0000 1.40
+++ Jetty.java 24 Feb 2002 05:08:29 -0000 1.41
@@ -5,7 +5,7 @@
* See terms of license at gnu.org.
*/
-// $Id: Jetty.java,v 1.40 2002/02/21 02:03:57 jules_gosnell Exp $
+// $Id: Jetty.java,v 1.41 2002/02/24 05:08:29 janb Exp $
// A Jetty HttpServer with the interface expected by JBoss'
// J2EEDeployer...
@@ -44,7 +44,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Julian Gosnell</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a>.
- * @version $Revision: 1.40 $
+ * @version $Revision: 1.41 $
*
* <p><b>Revisions:</b>
*
@@ -111,6 +111,31 @@
_log.warn("JSP compilation requires $JAVA_HOME/lib/tools.jar on your
JBOSS_CLASSPATH");
}
+
+
+ //----------------------------------------
+ // class loader delegation policy property
+ //----------------------------------------
+ boolean _loaderCompliance = true;
+ /**
+ * @param loaderCompliance if true, Jetty delegates class loading
+ *to parent class loader first, false implies servlet spec 2.3 compliance
+ */
+ public synchronized void setJava2ClassLoadingCompliance (boolean
loaderCompliance)
+ {
+ _loaderCompliance = loaderCompliance;
+ }
+
+ /**
+ * @return true if Java2 style class loading delegation, false if
+ *servlet2.3 spec compliance
+ */
+ public synchronized boolean getJava2ClassLoadingCompliance ()
+ {
+ return _loaderCompliance;
+ }
+
+
//----------------------------------------
// unpackWars property
@@ -365,11 +390,7 @@
WebApplicationContext app=
new JBossWebApplicationContext(this, contextPath,
descriptorParser, wa, _parser,
- fixedWarUrl,
- getHttpSessionStorageStrategy(),
- getHttpSessionSnapshotFrequency(),
- getHttpSessionSnapshotNotificationPolicy(),
- getSubjectAttributeName());
+ fixedWarUrl);
// configure whether the context is to flatten the classes in
1.52 +40 -2 contrib/jetty/src/main/org/jboss/jetty/JettyService.java
Index: JettyService.java
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/JettyService.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- JettyService.java 21 Feb 2002 02:03:57 -0000 1.51
+++ JettyService.java 24 Feb 2002 05:08:29 -0000 1.52
@@ -5,7 +5,7 @@
* See terms of license at gnu.org.
*/
-// $Id: JettyService.java,v 1.51 2002/02/21 02:03:57 jules_gosnell Exp $
+// $Id: JettyService.java,v 1.52 2002/02/24 05:08:29 janb Exp $
//------------------------------------------------------------------------------
@@ -38,7 +38,7 @@
* A service to launch jetty from JMX.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Julian Gosnell</a>
- * @version $Revision: 1.51 $
+ * @version $Revision: 1.52 $
*/
public class JettyService
@@ -140,6 +140,7 @@
Jetty tmp = new Jetty(this);
tmp.setWebDefault(getWebDefault());
tmp.setUnpackWars(getUnpackWars());
+ tmp.setJava2ClassLoadingCompliance(getJava2ClassLoadingCompliance());
tmp.setHttpSessionStorageStrategy(getHttpSessionStorageStrategy());
tmp.setHttpSessionSnapshotFrequency(getHttpSessionSnapshotFrequency());
tmp.setHttpSessionSnapshotNotificationPolicy(getHttpSessionSnapshotNotificationPolicy());
@@ -349,6 +350,43 @@
_publishMBeans=publishMBeans;
}
+
+
+
+
+
+ //----------------------------------------
+ // class loader delegation policy property
+ //----------------------------------------
+ boolean _loaderCompliance = true;
+ /**
+ * @param loaderCompliance if true, Jetty delegates class loading
+ *to parent class loader first, false implies servlet spec 2.3 compliance
+ */
+ public void setJava2ClassLoadingCompliance (boolean loaderCompliance)
+ {
+
+ _log.info("set Java2 class loader compliance to "+ loaderCompliance);
+
+ if (isInitialised())
+ _jetty.setJava2ClassLoadingCompliance(loaderCompliance);
+ else
+ _loaderCompliance = loaderCompliance;
+ }
+
+ /**
+ * @return true if Java2 style class loading delegation, false if
+ *servlet2.3 spec compliance
+ */
+ public boolean getJava2ClassLoadingCompliance()
+ {
+ if (isInitialised())
+ return _jetty.getJava2ClassLoadingCompliance();
+ else
+ return _loaderCompliance;
+ }
+
+
//----------------------------------------------------------------------------
protected boolean _unpackWars=false;
1.17 +7 -2 contrib/jetty/src/main/org/jboss/jetty/JettyServiceMBean.java
Index: JettyServiceMBean.java
===================================================================
RCS file:
/cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/JettyServiceMBean.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- JettyServiceMBean.java 20 Feb 2002 05:37:24 -0000 1.16
+++ JettyServiceMBean.java 24 Feb 2002 05:08:29 -0000 1.17
@@ -19,7 +19,7 @@
* ???
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
- * @version $Revision: 1.16 $
+ * @version $Revision: 1.17 $
*/
public interface JettyServiceMBean
extends org.jboss.web.AbstractWebContainerMBean
@@ -49,5 +49,10 @@
String getSubjectAttributeName();
- void setSubjectAttributeName(String subjectAttributeName);
+ void setSubjectAttributeName(String subjectAttributeName);
+
+ boolean getJava2ClassLoadingCompliance ();
+
+ void setJava2ClassLoadingCompliance(boolean compliance);
+
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development