JBossWeb SVN: r702 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-04 05:47:10 -0400 (Fri, 04 Jul 2008)
New Revision: 702
Modified:
trunk/build.xml
trunk/webapps/docs/changelog.xml
Log:
- Packaging fix and typo.
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-07-04 08:39:35 UTC (rev 701)
+++ trunk/build.xml 2008-07-04 09:47:10 UTC (rev 702)
@@ -578,6 +578,7 @@
<include name="org/apache/tomcat/util/**" />
<include name="org/apache/jasper/**" />
<include name="org/apache/el/**" />
+ <include name="org/jboss/servlet/**" />
<include name="org/jboss/web/**" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-04 08:39:35 UTC (rev 701)
+++ trunk/webapps/docs/changelog.xml 2008-07-04 09:47:10 UTC (rev 702)
@@ -93,7 +93,7 @@
control stopping the connectors. (remm)
</fix>
<fix>
- <jboss-jira>JBAS-5671</jboss-jira>: Check child the right child is passed when removing it. (remm)
+ <jboss-jira>JBAS-5671</jboss-jira>: Check the right child is passed when removing it. (remm)
</fix>
<fix>
Extract the query string before normalization when getting a request dispatcher. (remm)
16 years, 6 months
JBossWeb SVN: r701 - trunk/webapps/docs.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-04 04:39:35 -0400 (Fri, 04 Jul 2008)
New Revision: 701
Modified:
trunk/webapps/docs/ssl-howto.xml
Log:
- Port patch: typos.
Modified: trunk/webapps/docs/ssl-howto.xml
===================================================================
--- trunk/webapps/docs/ssl-howto.xml 2008-07-04 08:37:56 UTC (rev 700)
+++ trunk/webapps/docs/ssl-howto.xml 2008-07-04 08:39:35 UTC (rev 701)
@@ -187,13 +187,13 @@
keystore implmentations treat alaises in a case insensitive manner, case
sensitive implementations are available. The <code>PKCS11</code> specification,
for example, requires that aliases are case sensitive. To avoid issues related
-to the case sensitivity of aliaises, it is not recommended to use aliases that
+to the case sensitivity of aliases, it is not recommended to use aliases that
differ only in case.
</p>
<p>To import an existing certificate into a JKS keystore, please read the
documentation (in your JDK documentation package) about <code>keytool</code>.
-Note that openssl often adds a readable comments before the key, <code>keytool</code>does not support that, so remove the openssl comments if they exist before importing the key using <code>keytool</code>.
+Note that OpenSSL often adds a readable comments before the key, <code>keytool</code>does not support that, so remove the OpenSSL comments if they exist before importing the key using <code>keytool</code>.
</p>
<p>To import an existing certificate signed by your own CA into a PKCS12
keystore using OpenSSL you would execute a command like:
@@ -202,7 +202,7 @@
-caname root -chain
</source>
For more advanced cases, consult the <a href="http://www.openssl.org/">OpenSSL
-documententation</a>.
+documentation</a>.
</p>
<p>To create a new keystore from scratch, containing a single self-signed
Certificate, execute the following from a terminal command line:</p>
16 years, 6 months
JBossWeb SVN: r700 - trunk.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-04 04:37:56 -0400 (Fri, 04 Jul 2008)
New Revision: 700
Modified:
trunk/dist.xml
Log:
- Apparently should use osfamily.
Modified: trunk/dist.xml
===================================================================
--- trunk/dist.xml 2008-07-04 08:36:15 UTC (rev 699)
+++ trunk/dist.xml 2008-07-04 08:37:56 UTC (rev 700)
@@ -235,7 +235,7 @@
<filter token="VERSION_NUMBER" value="${version.number}"/>
<copy file="res/jboss-web.nsi" tofile="${tomcat.dist}/jboss-web.nsi" filtering="true" overwrite="true"/>
- <exec dir="${tomcat.dist}" executable="${nsis.exe}" os="windows">
+ <exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
<arg value="/DNSISDIR=${nsis.home}" />
<arg value="jboss-web.nsi" />
</exec>
16 years, 6 months
JBossWeb SVN: r699 - in trunk: java/org/apache/catalina and 6 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-04 04:36:15 -0400 (Fri, 04 Jul 2008)
New Revision: 699
Added:
trunk/java/org/apache/catalina/connector/HttpEventImpl.java
Removed:
trunk/java/org/apache/catalina/connector/CometEventImpl.java
trunk/java/org/jboss/web/comet/
Modified:
trunk/build.xml
trunk/java/org/apache/catalina/Valve.java
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java
trunk/java/org/apache/catalina/core/StandardContextValve.java
trunk/java/org/apache/catalina/core/StandardEngineValve.java
trunk/java/org/apache/catalina/core/StandardHostValve.java
trunk/java/org/apache/catalina/core/StandardWrapperValve.java
trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java
trunk/java/org/apache/catalina/valves/ValveBase.java
trunk/java/org/jboss/servlet/http/HttpEvent.java
trunk/webapps/docs/aio.xml
trunk/webapps/docs/changelog.xml
Log:
- Rename Comet API to be more clear that it is a separate Servlet type (which could use a few direct
hooks in the core HttpServlet API, but this is not doable at the moment).
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/build.xml 2008-07-04 08:36:15 UTC (rev 699)
@@ -208,8 +208,8 @@
<fileset dir="${tomcat.classes}">
<include name="org/apache/*" />
<include name="org/apache/catalina/**" />
- <include name="org/apache/comet/**" />
<include name="org/apache/naming/**" />
+ <include name="org/jboss/servlet/http/**" />
<include name="org/jboss/web/**" />
<!-- Javadoc and i18n exclusions -->
<exclude name="org/jboss/web/php/**" />
Modified: trunk/java/org/apache/catalina/Valve.java
===================================================================
--- trunk/java/org/apache/catalina/Valve.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/Valve.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -20,11 +20,12 @@
import java.io.IOException;
+
import javax.servlet.ServletException;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
-import org.jboss.web.comet.CometEvent;
+import org.jboss.servlet.http.HttpEvent;
/**
@@ -142,7 +143,7 @@
* @exception ServletException if a servlet error occurs, or is thrown
* by a subsequently invoked Valve, Filter, or Servlet
*/
- public void event(Request request, Response response, CometEvent event)
+ public void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException;
Deleted: trunk/java/org/apache/catalina/connector/CometEventImpl.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CometEventImpl.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/connector/CometEventImpl.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.catalina.connector;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.catalina.util.StringManager;
-import org.jboss.web.comet.CometEvent;
-
-public class CometEventImpl implements CometEvent {
-
- /**
- * The string manager for this package.
- */
- protected static StringManager sm =
- StringManager.getManager(Constants.Package);
-
-
- public CometEventImpl(Request request, Response response) {
- this.request = request;
- this.response = response;
- }
-
-
- // ----------------------------------------------------- Instance Variables
-
-
- /**
- * Associated request.
- */
- protected Request request = null;
-
-
- /**
- * Associated response.
- */
- protected Response response = null;
-
-
- /**
- * Event type.
- */
- protected EventType eventType = EventType.BEGIN;
-
-
- // --------------------------------------------------------- Public Methods
-
- /**
- * Clear the event.
- */
- public void clear() {
- request = null;
- response = null;
- }
-
- public void setType(EventType eventType) {
- this.eventType = eventType;
- }
-
- public void close() throws IOException {
- request.setComet(false);
- request.resume();
- }
-
- public EventType getType() {
- return eventType;
- }
-
- public HttpServletRequest getHttpServletRequest() {
- return request.getRequest();
- }
-
- public HttpServletResponse getHttpServletResponse() {
- return response.getResponse();
- }
-
- public void setTimeout(int timeout) {
- request.setTimeout(timeout);
- }
-
- public boolean ready() {
- return response.isWriteable();
- }
-
- public void resume() {
- request.resume();
- }
-
- public void suspend() {
- request.suspend();
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer("CometEventImpl[");
- buf.append(super.toString());
- buf.append("] Event:");
- buf.append(getType());
- return buf.toString();
- }
-
-}
Modified: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -35,7 +35,7 @@
import org.apache.tomcat.util.http.ServerCookie;
import org.apache.tomcat.util.net.SocketStatus;
import org.jboss.logging.Logger;
-import org.jboss.web.comet.CometEvent;
+import org.jboss.servlet.http.HttpEvent;
/**
@@ -147,7 +147,7 @@
if (response.isClosed()) {
// The response IO has been closed asynchronously, so call end
// in most cases
- request.getEvent().setType(CometEvent.EventType.END);
+ request.getEvent().setType(HttpEvent.EventType.END);
request.setComet(false);
close = true;
}
@@ -155,7 +155,7 @@
if (!request.isComet()) {
// The event has been closed asynchronously, so call end instead of
// read to cleanup the pipeline
- request.getEvent().setType(CometEvent.EventType.END);
+ request.getEvent().setType(HttpEvent.EventType.END);
close = true;
} else {
try {
@@ -170,11 +170,11 @@
error = true;
}
if (read) {
- request.getEvent().setType(CometEvent.EventType.READ);
+ request.getEvent().setType(HttpEvent.EventType.READ);
} else if (error) {
- request.getEvent().setType(CometEvent.EventType.ERROR);
+ request.getEvent().setType(HttpEvent.EventType.ERROR);
} else if (eof) {
- request.getEvent().setType(CometEvent.EventType.EOF);
+ request.getEvent().setType(HttpEvent.EventType.EOF);
} else {
// Data was present on the socket, but it did not translate into actual
// entity body bytes
@@ -185,10 +185,10 @@
if (!request.isComet()) {
// The event has been closed asynchronously, so call end instead of
// read to cleanup the pipeline
- request.getEvent().setType(CometEvent.EventType.END);
+ request.getEvent().setType(HttpEvent.EventType.END);
close = true;
} else {
- request.getEvent().setType(CometEvent.EventType.WRITE);
+ request.getEvent().setType(HttpEvent.EventType.WRITE);
}
} else if (status == SocketStatus.OPEN_CALLBACK) {
if (!request.isComet()) {
@@ -196,28 +196,28 @@
// read to cleanup the pipeline
// In nearly all cases, the close does a resume which will end up
// here
- request.getEvent().setType(CometEvent.EventType.END);
+ request.getEvent().setType(HttpEvent.EventType.END);
close = true;
} else {
- request.getEvent().setType(CometEvent.EventType.EVENT);
+ request.getEvent().setType(HttpEvent.EventType.EVENT);
}
} else if (status == SocketStatus.DISCONNECT) {
- request.getEvent().setType(CometEvent.EventType.ERROR);
+ request.getEvent().setType(HttpEvent.EventType.ERROR);
error = true;
} else if (status == SocketStatus.ERROR) {
- request.getEvent().setType(CometEvent.EventType.ERROR);
+ request.getEvent().setType(HttpEvent.EventType.ERROR);
error = true;
} else if (status == SocketStatus.STOP) {
- request.getEvent().setType(CometEvent.EventType.END);
+ request.getEvent().setType(HttpEvent.EventType.END);
close = true;
} else if (status == SocketStatus.TIMEOUT) {
if (!request.isComet()) {
// The event has been closed asynchronously, so call end instead of
// read to cleanup the pipeline
- request.getEvent().setType(CometEvent.EventType.END);
+ request.getEvent().setType(HttpEvent.EventType.END);
close = true;
} else {
- request.getEvent().setType(CometEvent.EventType.TIMEOUT);
+ request.getEvent().setType(HttpEvent.EventType.TIMEOUT);
}
}
@@ -229,7 +229,7 @@
if (!error && (request.getAttribute(Globals.EXCEPTION_ATTR) != null)) {
// An unexpected exception occurred while processing the event, so
// error should be called
- request.getEvent().setType(CometEvent.EventType.ERROR);
+ request.getEvent().setType(HttpEvent.EventType.ERROR);
error = true;
connector.getContainer().getPipeline().getFirst().event(request, response, request.getEvent());
}
@@ -237,13 +237,13 @@
// If this was a read and not all bytes have been read, or if no data
// was read from the connector, then it is an error
log.error(sm.getString("coyoteAdapter.read"));
- request.getEvent().setType(CometEvent.EventType.ERROR);
+ request.getEvent().setType(HttpEvent.EventType.ERROR);
error = true;
connector.getContainer().getPipeline().getFirst().event(request, response, request.getEvent());
}
if (!error && !eof && (status == SocketStatus.OPEN_READ) && request.isEof()) {
// Send an EOF event
- request.getEvent().setType(CometEvent.EventType.EOF);
+ request.getEvent().setType(HttpEvent.EventType.EOF);
eof = true;
connector.getContainer().getPipeline().getFirst().event(request, response, request.getEvent());
}
Copied: trunk/java/org/apache/catalina/connector/HttpEventImpl.java (from rev 695, trunk/java/org/apache/catalina/connector/CometEventImpl.java)
===================================================================
--- trunk/java/org/apache/catalina/connector/HttpEventImpl.java (rev 0)
+++ trunk/java/org/apache/catalina/connector/HttpEventImpl.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.catalina.connector;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.catalina.util.StringManager;
+import org.jboss.servlet.http.HttpEvent;
+
+public class HttpEventImpl implements HttpEvent {
+
+ /**
+ * The string manager for this package.
+ */
+ protected static StringManager sm =
+ StringManager.getManager(Constants.Package);
+
+
+ public HttpEventImpl(Request request, Response response) {
+ this.request = request;
+ this.response = response;
+ }
+
+
+ // ----------------------------------------------------- Instance Variables
+
+
+ /**
+ * Associated request.
+ */
+ protected Request request = null;
+
+
+ /**
+ * Associated response.
+ */
+ protected Response response = null;
+
+
+ /**
+ * Event type.
+ */
+ protected EventType eventType = EventType.BEGIN;
+
+
+ // --------------------------------------------------------- Public Methods
+
+ /**
+ * Clear the event.
+ */
+ public void clear() {
+ request = null;
+ response = null;
+ }
+
+ public void setType(EventType eventType) {
+ this.eventType = eventType;
+ }
+
+ public void close() throws IOException {
+ request.setComet(false);
+ request.resume();
+ }
+
+ public EventType getType() {
+ return eventType;
+ }
+
+ public HttpServletRequest getHttpServletRequest() {
+ return request.getRequest();
+ }
+
+ public HttpServletResponse getHttpServletResponse() {
+ return response.getResponse();
+ }
+
+ public void setTimeout(int timeout) {
+ request.setTimeout(timeout);
+ }
+
+ public boolean isReadReady() {
+ return request.isReadable();
+ }
+
+ public boolean isWriteReady() {
+ return response.isWriteable();
+ }
+
+ public void resume() {
+ request.resume();
+ }
+
+ public void suspend() {
+ request.suspend();
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer("CometEventImpl[");
+ buf.append(super.toString());
+ buf.append("] Event:");
+ buf.append(getType());
+ return buf.toString();
+ }
+
+}
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/connector/Request.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -205,7 +205,7 @@
/**
* Associated event.
*/
- protected CometEventImpl event = null;
+ protected HttpEventImpl event = null;
/**
@@ -481,6 +481,14 @@
}
+ /**
+ * Return true if bytes are available.
+ */
+ public boolean isReadable() {
+ return (inputBuffer.available() > 0);
+ }
+
+
// -------------------------------------------------------- Request Methods
@@ -2239,9 +2247,9 @@
* Get the event associated with the request.
* @return
*/
- public CometEventImpl getEvent() {
+ public HttpEventImpl getEvent() {
if (event == null) {
- event = new CometEventImpl(this, response);
+ event = new HttpEventImpl(this, response);
}
return event;
}
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterChain.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterChain.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -37,10 +37,10 @@
import org.apache.catalina.security.SecurityUtil;
import org.apache.catalina.util.InstanceSupport;
import org.apache.catalina.util.StringManager;
-import org.jboss.web.comet.CometEvent;
-import org.jboss.web.comet.CometFilter;
-import org.jboss.web.comet.CometFilterChain;
-import org.jboss.web.comet.CometProcessor;
+import org.jboss.servlet.http.HttpEvent;
+import org.jboss.servlet.http.HttpEventFilter;
+import org.jboss.servlet.http.HttpEventFilterChain;
+import org.jboss.servlet.http.HttpEventServlet;
/**
* Implementation of <code>javax.servlet.FilterChain</code> used to manage
@@ -53,7 +53,7 @@
* @version $Revision$ $Date$
*/
-final class ApplicationFilterChain implements FilterChain, CometFilterChain {
+final class ApplicationFilterChain implements FilterChain, HttpEventFilterChain {
// Used to enforce requirements of SRV.8.2 / SRV.14.2.5.1
private final static ThreadLocal lastServicedRequest;
@@ -152,14 +152,14 @@
* <code>doFilterEvent</code> is invoked.
*/
private static Class[] cometClassType =
- new Class[]{ CometEvent.class, CometFilterChain.class};
+ new Class[]{ HttpEvent.class, HttpEventFilterChain.class};
/**
* Static class array used when the SecurityManager is turned on and
* <code>event</code> is invoked.
*/
private static Class[] classTypeUsedInEvent =
- new Class[] { CometEvent.class };
+ new Class[] { HttpEvent.class };
// ---------------------------------------------------- FilterChain Methods
@@ -333,11 +333,11 @@
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception occurs
*/
- public void doFilterEvent(CometEvent event)
+ public void doFilterEvent(HttpEvent event)
throws IOException, ServletException {
if( Globals.IS_SECURITY_ENABLED ) {
- final CometEvent ev = event;
+ final HttpEvent ev = event;
try {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedExceptionAction() {
@@ -387,15 +387,15 @@
}
- private void internalDoFilterEvent(CometEvent event)
+ private void internalDoFilterEvent(HttpEvent event)
throws IOException, ServletException {
// Call the next filter if there is one
if (pos < n) {
ApplicationFilterConfig filterConfig = filters[pos++];
- CometFilter filter = null;
+ HttpEventFilter filter = null;
try {
- filter = (CometFilter) filterConfig.getFilter();
+ filter = (HttpEventFilter) filterConfig.getFilter();
// FIXME: No instance listener processing for events for now
/*
support.fireInstanceEvent(InstanceEvent.BEFORE_FILTER_EVENT,
@@ -403,7 +403,7 @@
*/
if( Globals.IS_SECURITY_ENABLED ) {
- final CometEvent ev = event;
+ final HttpEvent ev = event;
Principal principal =
ev.getHttpServletRequest().getUserPrincipal();
@@ -456,7 +456,7 @@
servlet, request, response);
*/
if( Globals.IS_SECURITY_ENABLED ) {
- final CometEvent ev = event;
+ final HttpEvent ev = event;
Principal principal =
ev.getHttpServletRequest().getUserPrincipal();
Object[] args = new Object[]{ ev };
@@ -467,7 +467,7 @@
principal);
args = null;
} else {
- ((CometProcessor) servlet).event(event);
+ ((HttpEventServlet) servlet).event(event);
}
/*
support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -27,7 +27,7 @@
import org.apache.catalina.Wrapper;
import org.apache.catalina.connector.Request;
import org.apache.catalina.deploy.FilterMap;
-import org.jboss.web.comet.CometFilter;
+import org.jboss.servlet.http.HttpEventFilter;
/**
* Factory for the creation and caching of Filters and creationg
@@ -174,7 +174,7 @@
boolean isCometFilter = false;
if (comet) {
try {
- isCometFilter = filterConfig.getFilter() instanceof CometFilter;
+ isCometFilter = filterConfig.getFilter() instanceof HttpEventFilter;
} catch (Exception e) {
// Note: The try catch is there because getFilter has a lot of
// declared exceptions. However, the filter is allocated much
@@ -204,7 +204,7 @@
boolean isCometFilter = false;
if (comet) {
try {
- isCometFilter = filterConfig.getFilter() instanceof CometFilter;
+ isCometFilter = filterConfig.getFilter() instanceof HttpEventFilter;
} catch (Exception e) {
// Note: The try catch is there because getFilter has a lot of
// declared exceptions. However, the filter is allocated much
Modified: trunk/java/org/apache/catalina/core/StandardContextValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContextValve.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/core/StandardContextValve.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -35,7 +35,7 @@
import org.apache.catalina.util.StringManager;
import org.apache.catalina.valves.ValveBase;
import org.apache.tomcat.util.buf.MessageBytes;
-import org.jboss.web.comet.CometEvent;
+import org.jboss.servlet.http.HttpEvent;
/**
* Valve that implements the default basic behavior for the
@@ -226,7 +226,7 @@
* @exception IOException if an input/output error occurred
* @exception ServletException if a servlet error occurred
*/
- public final void event(Request request, Response response, CometEvent event)
+ public final void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Select the Wrapper to be used for this Request
Modified: trunk/java/org/apache/catalina/core/StandardEngineValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardEngineValve.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/core/StandardEngineValve.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -29,7 +29,7 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.StringManager;
import org.apache.catalina.valves.ValveBase;
-import org.jboss.web.comet.CometEvent;
+import org.jboss.servlet.http.HttpEvent;
/**
@@ -121,7 +121,7 @@
* @exception IOException if an input/output error occurred
* @exception ServletException if a servlet error occurred
*/
- public final void event(Request request, Response response, CometEvent event)
+ public final void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Ask this Host to process this request
Modified: trunk/java/org/apache/catalina/core/StandardHostValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardHostValve.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/core/StandardHostValve.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -37,7 +37,7 @@
import org.apache.catalina.util.StringManager;
import org.apache.catalina.valves.ValveBase;
import org.jboss.logging.Logger;
-import org.jboss.web.comet.CometEvent;
+import org.jboss.servlet.http.HttpEvent;
/**
@@ -160,7 +160,7 @@
* @exception IOException if an input/output error occurred
* @exception ServletException if a servlet error occurred
*/
- public final void event(Request request, Response response, CometEvent event)
+ public final void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Select the Context to be used for this Request
Modified: trunk/java/org/apache/catalina/core/StandardWrapperValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapperValve.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/core/StandardWrapperValve.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -37,8 +37,8 @@
import org.apache.catalina.valves.ValveBase;
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.log.SystemLogHandler;
-import org.jboss.web.comet.CometEvent;
-import org.jboss.web.comet.CometProcessor;
+import org.jboss.servlet.http.HttpEvent;
+import org.jboss.servlet.http.HttpEventServlet;
/**
* Valve that implements the default basic behavior for the
@@ -159,7 +159,7 @@
// Identify if the request is Comet related now that the servlet has been allocated
boolean comet = false;
- if (servlet instanceof CometProcessor
+ if (servlet instanceof HttpEventServlet
&& request.getAttribute("org.apache.tomcat.comet.support") == Boolean.TRUE) {
comet = true;
request.setComet(true);
@@ -349,7 +349,7 @@
* @exception ServletException if a servlet error occurs, or is thrown
* by a subsequently invoked Valve, Filter, or Servlet
*/
- public void event(Request request, Response response, CometEvent event)
+ public void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Initialize local variables we may need
Modified: trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java
===================================================================
--- trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -35,13 +35,13 @@
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.connector.CometEventImpl;
+import org.apache.catalina.connector.HttpEventImpl;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
-import org.jboss.web.comet.CometEvent;
-import org.jboss.web.comet.CometProcessor;
+import org.jboss.servlet.http.HttpEvent;
+import org.jboss.servlet.http.HttpEventServlet;
/**
@@ -205,8 +205,8 @@
}
// Close the comet connection
try {
- CometEventImpl cometEvent = request.getEvent();
- cometEvent.setType(CometEvent.EventType.END);
+ HttpEventImpl cometEvent = request.getEvent();
+ cometEvent.setType(HttpEvent.EventType.END);
getNext().event(request, request.getResponse(), cometEvent);
cometEvent.close();
} catch (Exception e) {
@@ -286,7 +286,7 @@
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet error occurs
*/
- public void event(Request request, Response response, CometEvent event)
+ public void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Perform the request
@@ -296,8 +296,8 @@
ok = true;
} finally {
if (!ok || response.isClosed()
- || (event.getType() == CometEvent.EventType.END)
- || (event.getType() == CometEvent.EventType.ERROR)) {
+ || (event.getType() == HttpEvent.EventType.END)
+ || (event.getType() == HttpEvent.EventType.ERROR)) {
// Remove the connection from webapp reload tracking
cometRequests.remove(request);
@@ -353,9 +353,9 @@
for (int i = 0; i < reqs.length; i++) {
Request req = reqs[i];
try {
- CometEventImpl event = req.getEvent();
- event.setType(CometEvent.EventType.END);
- ((CometProcessor) req.getWrapper().getServlet()).event(event);
+ HttpEventImpl event = req.getEvent();
+ event.setType(HttpEvent.EventType.END);
+ ((HttpEventServlet) req.getWrapper().getServlet()).event(event);
event.close();
} catch (Exception e) {
req.getWrapper().getParent().getLogger().warn(sm.getString(
Modified: trunk/java/org/apache/catalina/valves/ValveBase.java
===================================================================
--- trunk/java/org/apache/catalina/valves/ValveBase.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/apache/catalina/valves/ValveBase.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -40,7 +40,7 @@
import org.apache.catalina.core.ContainerBase;
import org.apache.catalina.util.StringManager;
import org.jboss.logging.Logger;
-import org.jboss.web.comet.CometEvent;
+import org.jboss.servlet.http.HttpEvent;
/**
@@ -193,7 +193,7 @@
* @exception ServletException if a servlet error occurs, or is thrown
* by a subsequently invoked Valve, Filter, or Servlet
*/
- public void event(Request request, Response response, CometEvent event)
+ public void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Perform the request
getNext().event(request, response, event);
Modified: trunk/java/org/jboss/servlet/http/HttpEvent.java
===================================================================
--- trunk/java/org/jboss/servlet/http/HttpEvent.java 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/java/org/jboss/servlet/http/HttpEvent.java 2008-07-04 08:36:15 UTC (rev 699)
@@ -133,7 +133,7 @@
* Returns true when data may be read from the connection (the flag becomes false if no data
* is available to read). When the flag becomes false, the Servlet can attempt to read additional
* data, but it will block until data is available. This method is equivalent to
- * (Reader.ready() > 0) and InputStream.available().
+ * Reader.ready() and (InputStream.available() > 0).
*
* @return boolean true if data can be read without blocking
*/
Modified: trunk/webapps/docs/aio.xml
===================================================================
--- trunk/webapps/docs/aio.xml 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/webapps/docs/aio.xml 2008-07-04 08:36:15 UTC (rev 699)
@@ -39,10 +39,10 @@
other source).
</p>
- <subsection name="CometEvent">
+ <subsection name="HttpEvent">
<p>
- Servlets which implement the <code>org.jboss.web.comet.CometProcessor</code>
+ Servlets which implement the <code>org.jboss.servlet.http.HttpEventServlet</code>
interface will have their event method invoked rather than the usual service
method, according to the event which occurred. The event object gives
access to the usual request and response objects, which may be used in the
@@ -81,7 +81,7 @@
objects will be recycled and used to process other requests. In particular,
this event will be called if the HTTP session associated with the connection
times out, if the web application is reloaded, if the server is shutdown, or
- if the Comet connection was closed asynchronously.</li>
+ if the connection was closed asynchronously.</li>
<li>EventType.EOF - The end of file of the input has been reached, and no further data is
available. This event is sent because it can be difficult to detect otherwise.
Following the processing of this event and the processing of any subsequent
@@ -94,7 +94,7 @@
<li>EventType.TIMEOUT - the connection timed out, but the connection will not be closed unless
the servlet uses the close method of the event</li>
<li>EventType.EVENT - Event will be called by the container after the resume() method is called,
- during which any operations can be performed, including closing the Comet connection
+ during which any operations can be performed, including closing the connection
using the close() method.</li>
<li>EventType.WRITE - Write is sent if the servlet is using the ready method. This means that
the connection is ready to receive data to be written out. This event will never
@@ -103,13 +103,13 @@
</ul>
<p>
- As described above, the typical lifecycle of a Comet request will consist in a series of
+ As described above, the typical lifecycle of a request will consist in a series of
events such as: BEGIN -> READ -> READ -> READ -> TIMEOUT. At any time, the servlet
may end processing of the request by using the close method of the event object.
</p>
<p>
- The close() method ends the request, which marks the end of the comet session. This will send
+ The close() method ends the request, which marks the end of the processing. This will send
back to the client a notice that the server has no more data to send
as part of this request. An END event will be sent to the servlet.
</p>
@@ -122,7 +122,15 @@
</p>
<p>
- The ready() method returns true when data may be written to the connection (the flag becomes false
+ The isReadReady() method returns true when data may be read from the connection (the flag becomes false if no data
+ is available to read). When the flag becomes false, the Servlet can attempt to read additional
+ data, but it will block until data is available. This method is equivalent to
+ Reader.ready() and (InputStream.available() > 0).
+
+ </p>
+
+ <p>
+ The isWriteReady() method returns true when data may be written to the connection (the flag becomes false
when the client is unable to accept data fast enough). When the flag becomes false,
the servlet must stop writing data. If there's an attempt to flush additional data
to the client and data still cannot be written immediately, an IOException will be
@@ -152,15 +160,15 @@
</subsection>
- <subsection name="CometFilter">
+ <subsection name="HttpEventFilter">
<p>
- Similar to regular filters, a filter chain is invoked when comet events are processed.
- These filters should implement the CometFilter interface (which works in the same way as
+ Similar to regular filters, a filter chain is invoked when events are processed.
+ These filters should implement the HttpEventFilter interface (which works in the same way as
the regular Filter interface), and should be declared and mapped in the deployment
descriptor in the same way as a regular filter. The filter chain when processing an event
will only include filters which match all the usual mapping rules, and also implement
- the CometFiler interface.
+ the HttpEventFiler interface.
</p>
</subsection>
@@ -174,7 +182,7 @@
<source>
public class ChatServlet
- extends HttpServlet implements CometProcessor {
+ extends HttpServlet implements HttpEventServlet {
protected ArrayList<HttpServletResponse> connections =
new ArrayList<HttpServletResponse>();
@@ -195,13 +203,13 @@
}
/**
- * Process the given Comet event.
+ * Process the given event.
*
- * @param event The Comet event that will be processed
+ * @param event The event that will be processed
* @throws IOException
* @throws ServletException
*/
- public void event(CometEvent event)
+ public void event(HttpEvent event)
throws IOException, ServletException {
HttpServletRequest request = event.getHttpServletRequest();
HttpServletResponse response = event.getHttpServletResponse();
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-04 07:48:40 UTC (rev 698)
+++ trunk/webapps/docs/changelog.xml 2008-07-04 08:36:15 UTC (rev 699)
@@ -98,6 +98,9 @@
<fix>
Extract the query string before normalization when getting a request dispatcher. (remm)
</fix>
+ <update>
+ Update the Comet API names to org.jboss.servlet.http. (remm)
+ </update>
</changelog>
</subsection>
<subsection name="Coyote">
16 years, 6 months
JBossWeb SVN: r698 - in trunk: java/org/apache/coyote and 3 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-04 03:48:40 -0400 (Fri, 04 Jul 2008)
New Revision: 698
Modified:
trunk/java/org/apache/catalina/core/ApplicationContext.java
trunk/java/org/apache/catalina/core/StandardContextValve.java
trunk/java/org/apache/coyote/Constants.java
trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
trunk/java/org/apache/coyote/ajp/AjpProcessor.java
trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
trunk/java/org/apache/coyote/http11/InternalOutputBuffer.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/sysprops.xml
Log:
- Port two Tomcat patches.
- No message in headers.
- Query string fix in the RD.
Modified: trunk/java/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContext.java 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/java/org/apache/catalina/core/ApplicationContext.java 2008-07-04 07:48:40 UTC (rev 698)
@@ -369,10 +369,21 @@
throw new IllegalArgumentException
(sm.getString
("applicationContext.requestDispatcher.iae", path));
+
+ // Get query string
+ String queryString = null;
+ int pos = path.indexOf('?');
+ if (pos >= 0) {
+ queryString = path.substring(pos + 1);
+ path = path.substring(0, pos);
+ }
+
path = normalize(path);
if (path == null)
return (null);
+ pos = path.length();
+
// Use the thread local URI and mapping data
DispatchData dd = dispatchData.get();
if (dd == null) {
@@ -383,15 +394,6 @@
MessageBytes uriMB = dd.uriMB;
uriMB.recycle();
- // Get query string
- String queryString = null;
- int pos = path.indexOf('?');
- if (pos >= 0) {
- queryString = path.substring(pos + 1);
- } else {
- pos = path.length();
- }
-
// Use the thread local mapping data
MappingData mappingData = dd.mappingData;
Modified: trunk/java/org/apache/catalina/core/StandardContextValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContextValve.java 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/java/org/apache/catalina/core/StandardContextValve.java 2008-07-04 07:48:40 UTC (rev 698)
@@ -120,8 +120,7 @@
|| (requestPathMB.equalsIgnoreCase("/META-INF"))
|| (requestPathMB.startsWithIgnoreCase("/WEB-INF/", 0))
|| (requestPathMB.equalsIgnoreCase("/WEB-INF"))) {
- String requestURI = request.getDecodedRequestURI();
- notFound(requestURI, response);
+ notFound(response);
return;
}
@@ -148,15 +147,13 @@
// Select the Wrapper to be used for this Request
Wrapper wrapper = request.getWrapper();
if (wrapper == null) {
- String requestURI = request.getDecodedRequestURI();
- notFound(requestURI, response);
+ notFound(response);
return;
} else if (!wrapper.isStarted()) {
// May be as a result of a reload, try and find the new wrapper
wrapper = (Wrapper) container.findChild(wrapper.getName());
if (wrapper == null) {
- String requestURI = request.getDecodedRequestURI();
- notFound(requestURI, response);
+ notFound(response);
return;
}
}
@@ -308,10 +305,10 @@
* @param requestURI The request URI for the requested resource
* @param response The response we are creating
*/
- private void notFound(String requestURI, HttpServletResponse response) {
+ protected void notFound(HttpServletResponse response) {
try {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, requestURI);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
} catch (IllegalStateException e) {
;
} catch (IOException e) {
Modified: trunk/java/org/apache/coyote/Constants.java
===================================================================
--- trunk/java/org/apache/coyote/Constants.java 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/java/org/apache/coyote/Constants.java 2008-07-04 07:48:40 UTC (rev 698)
@@ -60,5 +60,12 @@
(System.getSecurityManager() != null);
+ /**
+ * If true, custom HTTP status messages will be used in headers.
+ */
+ public static final boolean USE_CUSTOM_STATUS_MSG_IN_HEADER =
+ Boolean.valueOf(System.getProperty(
+ "org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER",
+ "false")).booleanValue();
}
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 2008-07-04 07:48:40 UTC (rev 698)
@@ -915,7 +915,10 @@
// HTTP header contents
responseHeaderMessage.appendInt(response.getStatus());
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null){
message = HttpMessages.getMessage(response.getStatus());
} else {
Modified: trunk/java/org/apache/coyote/ajp/AjpProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpProcessor.java 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/java/org/apache/coyote/ajp/AjpProcessor.java 2008-07-04 07:48:40 UTC (rev 698)
@@ -921,7 +921,10 @@
// HTTP header contents
responseHeaderMessage.appendInt(response.getStatus());
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null){
message = HttpMessages.getMessage(response.getStatus());
} else {
Modified: trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-07-04 07:48:40 UTC (rev 698)
@@ -430,11 +430,14 @@
buf[pos++] = Constants.SP;
// Write message
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null) {
write(HttpMessages.getMessage(status));
} else {
- write(message);
+ write(message.replace('\n', ' ').replace('\r', ' '));
}
// End the response status line
Modified: trunk/java/org/apache/coyote/http11/InternalOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalOutputBuffer.java 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/java/org/apache/coyote/http11/InternalOutputBuffer.java 2008-07-04 07:48:40 UTC (rev 698)
@@ -422,11 +422,14 @@
buf[pos++] = Constants.SP;
// Write message
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null) {
write(getMessage(status));
} else {
- write(message);
+ write(message.replace('\n', ' ').replace('\r', ' '));
}
// End the response status line
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/webapps/docs/changelog.xml 2008-07-04 07:48:40 UTC (rev 698)
@@ -95,6 +95,9 @@
<fix>
<jboss-jira>JBAS-5671</jboss-jira>: Check child the right child is passed when removing it. (remm)
</fix>
+ <fix>
+ Extract the query string before normalization when getting a request dispatcher. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -118,6 +121,9 @@
<bug>45272</bug>: IE is not fully compliant, and the redone cookies could cause issues with
quoted paths. (fhanik)
</fix>
+ <fix>
+ Do not use custom messages in headers by default. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
Modified: trunk/webapps/docs/sysprops.xml
===================================================================
--- trunk/webapps/docs/sysprops.xml 2008-07-03 14:22:35 UTC (rev 697)
+++ trunk/webapps/docs/sysprops.xml 2008-07-04 07:48:40 UTC (rev 698)
@@ -110,11 +110,34 @@
with that id.</p>
</property>
+ <property
+ name="org.apache.coyote. USE_CUSTOM_STATUS_MSG_IN_HEADER">
+ <p>If this is <code>true</code> custom HTTP status messages will be used
+ within HTTP headers. Users must ensure that any such message is
+ ISO-8859-1 encoded, particularly if user provided input is included in
+ the message, to prevent a possible XSS vulnerability. If not specified
+ the default value of <code>false</code> will be used.</p>
+ </property>
+
</properties>
</section>
+<section name="EL">
+ <properties>
+
+ <property name="org.apache.el.parser.COERCE_TO_ZERO">
+ <p>If <code>true</code>, when coercing expressions to numbers
+ <code>""</code> and <code>null</code> will be coerced to zero as required
+ by the specification. If not specified, the default value of
+ <code>true</code> will be used.</p>
+ </property>
+
+ </properties>
+</section>
+
+
<section name="JSP">
<properties>
@@ -130,6 +153,13 @@
be used.</p>
</property>
+ <property name="org.apache.jasper.compiler. Parser.STRICT_QUOTE_ESCAPING">
+ <p>If <code>false</code> the requirements for escpaing quotes in JSP
+ attributes will be relaxed so that a missing required quote will not
+ cause an error. If not specified, the specification compliant default of
+ <code>true</code> will be used.</p>
+ </property>
+
<!--
<property name="org.apache.jasper.runtime. BodyContentImpl.LIMIT_BUFFER">
<p>If <code>true</code>, any tag buffer that expands beyond
16 years, 6 months
JBossWeb SVN: r697 - trunk/java/org/apache/catalina/core.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-03 10:22:35 -0400 (Thu, 03 Jul 2008)
New Revision: 697
Modified:
trunk/java/org/apache/catalina/core/StandardWrapper.java
Log:
- Revert after diffing to check, as it is not useful. For non STM servlets, the number of "allocations"
is not tracked.
Modified: trunk/java/org/apache/catalina/core/StandardWrapper.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapper.java 2008-07-03 14:14:44 UTC (rev 696)
+++ trunk/java/org/apache/catalina/core/StandardWrapper.java 2008-07-03 14:22:35 UTC (rev 697)
@@ -763,8 +763,6 @@
throw new ServletException
(sm.getString("standardWrapper.unloading", getName()));
- boolean newInstance = false;
-
// If not SingleThreadedModel, return the same instance every time
if (!singleThreadModel) {
@@ -777,12 +775,6 @@
log.debug("Allocating non-STM instance");
instance = loadServlet();
- // For non-STM, increment here to prevent a race
- // condition with unload. Bug 43683, test case #3
- if (!singleThreadModel) {
- newInstance = true;
- countAllocated++;
- }
} catch (ServletException e) {
throw e;
} catch (Throwable e) {
@@ -796,11 +788,6 @@
if (!singleThreadModel) {
if (log.isTraceEnabled())
log.trace(" Returning non-STM instance");
- // For new instances, count will have been incremented at the
- // time of creation
- if (!newInstance) {
- countAllocated++;
- }
return (instance);
}
16 years, 6 months
JBossWeb SVN: r696 - trunk/java/org/apache/catalina/core.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-03 10:14:44 -0400 (Thu, 03 Jul 2008)
New Revision: 696
Modified:
trunk/java/org/apache/catalina/core/StandardWrapper.java
Log:
- Port latest patch to cleanup possible problems when a reload is going on.
Modified: trunk/java/org/apache/catalina/core/StandardWrapper.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapper.java 2008-07-02 12:35:10 UTC (rev 695)
+++ trunk/java/org/apache/catalina/core/StandardWrapper.java 2008-07-03 14:14:44 UTC (rev 696)
@@ -763,6 +763,8 @@
throw new ServletException
(sm.getString("standardWrapper.unloading", getName()));
+ boolean newInstance = false;
+
// If not SingleThreadedModel, return the same instance every time
if (!singleThreadModel) {
@@ -775,6 +777,12 @@
log.debug("Allocating non-STM instance");
instance = loadServlet();
+ // For non-STM, increment here to prevent a race
+ // condition with unload. Bug 43683, test case #3
+ if (!singleThreadModel) {
+ newInstance = true;
+ countAllocated++;
+ }
} catch (ServletException e) {
throw e;
} catch (Throwable e) {
@@ -788,6 +796,11 @@
if (!singleThreadModel) {
if (log.isTraceEnabled())
log.trace(" Returning non-STM instance");
+ // For new instances, count will have been incremented at the
+ // time of creation
+ if (!newInstance) {
+ countAllocated++;
+ }
return (instance);
}
16 years, 6 months
JBossWeb SVN: r695 - trunk/java/org/jboss/web/cluster.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-02 08:35:10 -0400 (Wed, 02 Jul 2008)
New Revision: 695
Modified:
trunk/java/org/jboss/web/cluster/ClusterListener.java
Log:
Make sure that only one sendRequest() is a called at a time.
Modified: trunk/java/org/jboss/web/cluster/ClusterListener.java
===================================================================
--- trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-07-01 17:01:58 UTC (rev 694)
+++ trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-07-02 12:35:10 UTC (rev 695)
@@ -1239,7 +1239,7 @@
sendRequest(command, wildcard, parameters, -1);
}
- protected String sendRequest(String command, boolean wildcard, HashMap<String, String> parameters, int pos) {
+ protected synchronized String sendRequest(String command, boolean wildcard, HashMap<String, String> parameters, int pos) {
BufferedReader reader = null;
BufferedWriter writer = null;
16 years, 6 months
JBossWeb SVN: r694 - in trunk/java/org/jboss: servlet and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-01 13:01:58 -0400 (Tue, 01 Jul 2008)
New Revision: 694
Added:
trunk/java/org/jboss/servlet/
trunk/java/org/jboss/servlet/http/
trunk/java/org/jboss/servlet/http/HttpEvent.java
trunk/java/org/jboss/servlet/http/HttpEventFilter.java
trunk/java/org/jboss/servlet/http/HttpEventFilterChain.java
trunk/java/org/jboss/servlet/http/HttpEventServlet.java
Log:
- Add "new" Comet API matching the proposal to the Servlet API (which will not be accepted).
Added: trunk/java/org/jboss/servlet/http/HttpEvent.java
===================================================================
--- trunk/java/org/jboss/servlet/http/HttpEvent.java (rev 0)
+++ trunk/java/org/jboss/servlet/http/HttpEvent.java 2008-07-01 17:01:58 UTC (rev 694)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.servlet.http;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * The HttpEvent interface, which indicates the type of the event that is
+ * being processed, as well as provides useful callbacks and utility objects.
+ */
+public interface HttpEvent {
+
+ /**
+ * Enumeration describing the major events that the container can invoke
+ * the EventHttpServlet event() method with:
+ * <ul>
+ * <li>BEGIN - will be called at the beginning
+ * of the processing of the connection. It can be used to initialize any relevant
+ * fields using the request and response objects. Between the end of the processing
+ * of this event, and the beginning of the processing of the end or error events,
+ * it is possible to use the response object to write data on the open connection.
+ * Note that the response object and dependent OutputStream and Writer are
+ * not synchronized, so when they are accessed by multiple threads adequate
+ * synchronization is needed. After processing the initial event, the request
+ * is considered to be committed.</li>
+ * <li>EOF - The end of file of the input has been reached, and no further data is
+ * available. This event is sent because it can be difficult to detect otherwise.
+ * Following the processing of this event and the processing of any subsequent
+ * event, the event will be suspended.</li>
+ * <li>END - End may be called to end the processing of the request. Fields that have
+ * been initialized in the begin method should be reset. After this event has
+ * been processed, the request and response objects, as well as all their dependent
+ * objects will be recycled and used to process other requests. In particular,
+ * this event will be called if the HTTP session associated with the connection
+ * times out, if the web application is reloaded, if the server is shutdown, or
+ * if the connection was closed asynchronously.</li>
+ * <li>ERROR - Error will be called by the container in the case where an IO exception
+ * or a similar unrecoverable error occurs on the connection. Fields that have
+ * been initialized in the begin method should be reset. After this event has
+ * been processed, the request and response objects, as well as all their dependent
+ * objects will be recycled and used to process other requests.</li>
+ * <li>EVENT - Event will be called by the container after the resume() method is called,
+ * during which any operations can be performed, including closing the connection
+ * using the close() method.</li>
+ * <li>READ - This indicates that input data is available, and that at least one
+ * read can be made without blocking. The available and ready methods of the InputStream or
+ * Reader may be used to determine if there is a risk of blocking: the Servlet
+ * must continue reading while data is reported available. When encountering a read error,
+ * the Servlet should report it by propagating the exception properly. Throwing
+ * an exception will cause the error event to be invoked, and the connection
+ * will be closed.
+ * Alternately, it is also possible to catch any exception, perform clean up
+ * on any data structure the Servlet may be using, and using the close method
+ * of the event. It is not allowed to attempt reading data from the request
+ * object outside of the processing of this event, unless the suspend() method
+ * has been used.</li>
+ * <li>TIMEOUT - the connection timed out, but the connection will not be closed unless
+ * the servlet uses the close method of the event</li>
+ * <li>WRITE - Write is sent if the Servlet is using the ready method. This means that
+ * the connection is ready to receive data to be written out. This event will never
+ * be received if the Servlet is not using the ready() method, or if the ready()
+ * method always returns true.</li>
+ * </ul>
+ */
+ public enum EventType { BEGIN, END, ERROR, EVENT, READ, EOF, TIMEOUT, WRITE }
+
+
+ /**
+ * Returns the HttpServletRequest.
+ *
+ * @return HttpServletRequest
+ */
+ public HttpServletRequest getHttpServletRequest();
+
+ /**
+ * Returns the HttpServletResponse.
+ *
+ * @return HttpServletResponse
+ */
+ public HttpServletResponse getHttpServletResponse();
+
+ /**
+ * Returns the event type.
+ *
+ * @return EventType
+ * @see #EventType
+ */
+ public EventType getType();
+
+ /**
+ * Ends the request, which marks the end of the event stream. This will send
+ * back to the client a notice that the server has no more data to send
+ * as part of this request. An END event will be sent to the Servlet.
+ *
+ * @throws IOException if an IO exception occurs
+ */
+ public void close() throws IOException;
+
+ /**
+ * This method sets the timeout in milliseconds of idle time on the connection.
+ * The timeout is reset every time data is received from the connection. If a timeout occurs, the
+ * Servlet will receive an TIMEOUT event which will not result in automatically closing
+ * the event (the event may be closed using the close() method).
+ *
+ * @param timeout The timeout in milliseconds for this connection, must be a positive value, larger than 0
+ */
+ public void setTimeout(int timeout);
+
+ /**
+ * Returns true when data may be read from the connection (the flag becomes false if no data
+ * is available to read). When the flag becomes false, the Servlet can attempt to read additional
+ * data, but it will block until data is available. This method is equivalent to
+ * (Reader.ready() > 0) and InputStream.available().
+ *
+ * @return boolean true if data can be read without blocking
+ */
+ public boolean isReadReady();
+
+ /**
+ * Returns true when data may be written to the connection (the flag becomes false
+ * when the client is unable to accept data fast enough). When the flag becomes false,
+ * the Servlet must stop writing data. If there's an attempt to flush additional data
+ * to the client and data still cannot be written immediately, an IOException will be
+ * thrown. If calling this method returns false, it will also
+ * request notification when the connection becomes available for writing again, and the
+ * Servlet will receive a write event.
+ * <br>
+ * Note: If the Servlet is not using isWriteReady, and is writing its output inside the
+ * container threads (inside the event() method processing, for example), using this method
+ * is not mandatory, and writes will block until all bytes are written.
+ *
+ * @return boolean true if data can be written without blocking
+ */
+ public boolean isWriteReady();
+
+ /**
+ * Suspend processing of the connection until the configured timeout occurs,
+ * or resume() is called. In practice, this means the servlet will no longer
+ * receive read events. Reading should always be performed synchronously in
+ * the Tomcat threads unless the connection has been suspended.
+ */
+ public void suspend();
+
+ /**
+ * Resume will cause the Servlet container to send a generic event
+ * to the Servlet, where the request can be processed synchronously
+ * (for example, it is possible to use this to complete the request after
+ * some asynchronous processing is done). This also resumes read events
+ * if they have been disabled using suspend. It is then possible to call suspend
+ * again later. It is also possible to call resume without calling suspend before.
+ * This method must be called asynchronously.
+ */
+ public void resume();
+
+}
Added: trunk/java/org/jboss/servlet/http/HttpEventFilter.java
===================================================================
--- trunk/java/org/jboss/servlet/http/HttpEventFilter.java (rev 0)
+++ trunk/java/org/jboss/servlet/http/HttpEventFilter.java 2008-07-01 17:01:58 UTC (rev 694)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.servlet.http;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.ServletException;
+
+/**
+ * An event filter, similar to regular filters, performs filtering tasks on either
+ * the request to a resource (an event driven Servlet), or on the response from a resource, or both.
+ */
+public interface HttpEventFilter extends Filter {
+
+
+ /**
+ * The <code>doFilterEvent</code> method of the HttpEventFilter is called by the container
+ * each time a request/response pair is passed through the chain due
+ * to a client event for a resource at the end of the chain. The HttpEventFilterChain passed in to this
+ * method allows the Filter to pass on the event to the next entity in the
+ * chain.<p>
+ * A typical implementation of this method would follow the following pattern:- <br>
+ * 1. Examine the request<br>
+ * 2. Optionally wrap the request object contained in the event with a custom implementation to
+ * filter content or headers for input filtering and pass a HttpEvent instance containing
+ * the wrapped request to the next filter<br>
+ * 3. Optionally wrap the response object contained in the event with a custom implementation to
+ * filter content or headers for output filtering and pass a HttpEvent instance containing
+ * the wrapped request to the next filter<br>
+ * 4. a) <strong>Either</strong> invoke the next entity in the chain using the HttpEventFilterChain
+ * object (<code>chain.doFilterEvent()</code>), <br>
+ * 4. b) <strong>or</strong> not pass on the request/response pair to the next entity in the
+ * filter chain to block the event processing<br>
+ * 5. Directly set fields on the response after invocation of the next entity in the filter chain.
+ *
+ * @param event the event that is being processed. Another event may be passed along the chain.
+ * @param chain
+ * @throws IOException
+ * @throws ServletException
+ */
+ public void doFilterEvent(HttpEvent event, HttpEventFilterChain chain)
+ throws IOException, ServletException;
+
+
+}
Added: trunk/java/org/jboss/servlet/http/HttpEventFilterChain.java
===================================================================
--- trunk/java/org/jboss/servlet/http/HttpEventFilterChain.java (rev 0)
+++ trunk/java/org/jboss/servlet/http/HttpEventFilterChain.java 2008-07-01 17:01:58 UTC (rev 694)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.servlet.http;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+
+/**
+ * A HttpEventFilterChain is an object provided by the Servlet container to the developer
+ * giving a view into the invocation chain of a filtered event for a resource. Filters
+ * use the HttpEventFilterChain to invoke the next filter in the chain, or if the calling filter
+ * is the last filter in the chain, to invoke the resource at the end of the chain.
+ */
+public interface HttpEventFilterChain {
+
+
+ /**
+ * Causes the next filter in the chain to be invoked, or if the calling filter is the last filter
+ * in the chain, causes the resource at the end of the chain to be invoked.
+ *
+ * @param event the event to pass along the chain.
+ */
+ public void doFilterEvent(HttpEvent event) throws IOException, ServletException;
+
+
+}
Added: trunk/java/org/jboss/servlet/http/HttpEventServlet.java
===================================================================
--- trunk/java/org/jboss/servlet/http/HttpEventServlet.java (rev 0)
+++ trunk/java/org/jboss/servlet/http/HttpEventServlet.java 2008-07-01 17:01:58 UTC (rev 694)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.servlet.http;
+
+import java.io.IOException;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+
+/**
+ * This interface should be implemented by Servlets which would like to handle
+ * asynchronous IO, receiving events when data is available for reading, and
+ * being able to output data without the need for being invoked by the container.
+ * Note: When this interface is implemented, the service method of the Servlet will
+ * never be called, and will be replaced with a begin event.
+ */
+public interface HttpEventServlet extends Servlet
+{
+
+ /**
+ * Process the given IO event.
+ *
+ * @param event The event that will be processed
+ * @throws IOException
+ * @throws ServletException
+ */
+ public void event(HttpEvent event)
+ throws IOException, ServletException;
+
+}
16 years, 6 months
JBossWeb SVN: r693 - trunk/webapps/docs.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-01 12:19:20 -0400 (Tue, 01 Jul 2008)
New Revision: 693
Modified:
trunk/webapps/docs/ssl-howto.xml
Log:
typo
Modified: trunk/webapps/docs/ssl-howto.xml
===================================================================
--- trunk/webapps/docs/ssl-howto.xml 2008-07-01 14:33:20 UTC (rev 692)
+++ trunk/webapps/docs/ssl-howto.xml 2008-07-01 16:19:20 UTC (rev 693)
@@ -430,7 +430,7 @@
<p>The type of keystore file to be used for the server certificate.
If not specified, the default value is "<code>JKS</code>".
For example the *.p12 files from openssl can be used using
- <code>PKCS12</code></td></p>
+ <code>PKCS12</code></p>
</attribute>
<attribute name="sslProtocol" required="false">
16 years, 6 months