Author: remy.maucherat(a)jboss.com
Date: 2012-08-29 12:44:25 -0400 (Wed, 29 Aug 2012)
New Revision: 2074
Removed:
trunk/src/main/java/org/apache/catalina/connector/LocalStrings.properties
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_es.properties
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_fr.properties
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_ja.properties
Modified:
trunk/src/main/java/org/apache/catalina/connector/Connector.java
trunk/src/main/java/org/apache/catalina/connector/CoyoteAdapter.java
trunk/src/main/java/org/apache/catalina/connector/HttpEventImpl.java
trunk/src/main/java/org/apache/catalina/connector/InputBuffer.java
trunk/src/main/java/org/apache/catalina/connector/Request.java
trunk/src/main/java/org/apache/catalina/connector/RequestFacade.java
trunk/src/main/java/org/apache/catalina/connector/Response.java
trunk/src/main/java/org/apache/catalina/connector/ResponseFacade.java
trunk/src/main/java/org/jboss/web/CatalinaLogger.java
trunk/src/main/java/org/jboss/web/CatalinaMessages.java
Log:
New i18n for the connector package.
Modified: trunk/src/main/java/org/apache/catalina/connector/Connector.java
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/Connector.java 2012-08-29 08:36:47
UTC (rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/Connector.java 2012-08-29 16:44:25
UTC (rev 2074)
@@ -18,6 +18,8 @@
package org.apache.catalina.connector;
+import static org.jboss.web.CatalinaMessages.MESSAGES;
+
import java.util.HashMap;
import java.util.Set;
@@ -33,12 +35,11 @@
import org.apache.catalina.Service;
import org.apache.catalina.core.AprLifecycleListener;
import org.apache.catalina.util.LifecycleSupport;
-import org.apache.catalina.util.StringManager;
import org.apache.coyote.Adapter;
import org.apache.coyote.ProtocolHandler;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.modeler.Registry;
-import org.jboss.logging.Logger;
+import org.jboss.web.CatalinaLogger;
/**
@@ -53,9 +54,7 @@
public class Connector
implements Lifecycle, MBeanRegistration
{
- private static Logger log = Logger.getLogger(Connector.class);
-
/**
* Alternate flag to enable recycling of facades.
*/
@@ -86,9 +85,7 @@
Class<?> clazz = Class.forName(protocolHandlerClassName);
this.protocolHandler = (ProtocolHandler) clazz.newInstance();
} catch (Exception e) {
- throw new IllegalArgumentException
- (sm.getString
- ("coyoteConnector.protocolHandlerInstantiationFailed", e));
+ throw MESSAGES.protocolHandlerInstantiationFailed(e);
}
}
@@ -184,13 +181,6 @@
/**
- * The string manager for this package.
- */
- protected StringManager sm =
- StringManager.getManager(Constants.Package);
-
-
- /**
* Maximum size of a POST which will be automatically parsed by the
* container. 2MB by default.
*/
@@ -946,9 +936,8 @@
throws LifecycleException
{
if (initialized) {
- if(log.isInfoEnabled())
- log.info(sm.getString("coyoteConnector.alreadyInitialized"));
- return;
+ CatalinaLogger.CONNECTOR_LOGGER.connectorAlreadyInitialized();
+ return;
}
this.initialized = true;
@@ -962,10 +951,8 @@
.registerComponent(this, oname, null);
controller=oname;
} catch (Exception e) {
- log.error( "Error registering connector ", e);
+ CatalinaLogger.CONNECTOR_LOGGER.failedConnectorJmxRegistration(oname,
e);
}
- if(log.isDebugEnabled())
- log.debug("Creating name for connector " + oname);
}
}
@@ -979,9 +966,7 @@
try {
protocolHandler.init();
} catch (Exception e) {
- throw new LifecycleException
- (sm.getString
- ("coyoteConnector.protocolHandlerInitializationFailed", e));
+ throw new LifecycleException(MESSAGES.protocolHandlerInitFailed(e));
}
}
@@ -994,8 +979,7 @@
try {
protocolHandler.pause();
} catch (Exception e) {
- log.error(sm.getString
- ("coyoteConnector.protocolHandlerPauseFailed"), e);
+ CatalinaLogger.CONNECTOR_LOGGER.protocolHandlerPauseFailed(e);
}
}
@@ -1008,8 +992,7 @@
try {
protocolHandler.resume();
} catch (Exception e) {
- log.error(sm.getString
- ("coyoteConnector.protocolHandlerResumeFailed"), e);
+ CatalinaLogger.CONNECTOR_LOGGER.protocolHandlerResumeFailed(e);
}
}
@@ -1025,8 +1008,7 @@
// Validate and update our current state
if (started ) {
- if(log.isInfoEnabled())
- log.info(sm.getString("coyoteConnector.alreadyStarted"));
+ CatalinaLogger.CONNECTOR_LOGGER.connectorAlreadyStarted();
return;
}
lifecycle.fireLifecycleEvent(START_EVENT, null);
@@ -1041,27 +1023,18 @@
Registry.getRegistry(null, null).registerComponent
(protocolHandler,
createObjectName(this.domain,"ProtocolHandler"), null);
} catch (Exception ex) {
- log.error(sm.getString
- ("coyoteConnector.protocolRegistrationFailed"),
ex);
+ CatalinaLogger.CONNECTOR_LOGGER.failedProtocolJmxRegistration(oname,
ex);
}
} else {
- if(log.isInfoEnabled())
- log.info(sm.getString
- ("coyoteConnector.cannotRegisterProtocol"));
+ CatalinaLogger.CONNECTOR_LOGGER.failedProtocolJmxRegistration();
}
}
try {
protocolHandler.start();
} catch (Exception e) {
- String errPrefix = "";
- if(this.service != null) {
- errPrefix += "service.getName(): \"" +
this.service.getName() + "\"; ";
- }
-
throw new LifecycleException
- (errPrefix + " " + sm.getString
- ("coyoteConnector.protocolHandlerStartFailed", e));
+ (MESSAGES.protocolHandlerStartFailed(e));
}
}
@@ -1076,7 +1049,7 @@
// Validate and update our current state
if (!started) {
- log.error(sm.getString("coyoteConnector.notStarted"));
+ CatalinaLogger.CONNECTOR_LOGGER.connectorNotStarted();
return;
}
@@ -1088,16 +1061,13 @@
Registry.getRegistry(null, null).unregisterComponent
(createObjectName(this.domain,"ProtocolHandler"));
} catch (MalformedObjectNameException e) {
- log.error( sm.getString
- ("coyoteConnector.protocolUnregistrationFailed"), e);
+ CatalinaLogger.CONNECTOR_LOGGER.failedProtocolJmxUnregistration(oname,
e);
}
}
try {
protocolHandler.destroy();
} catch (Exception e) {
- throw new LifecycleException
- (sm.getString
- ("coyoteConnector.protocolHandlerDestroyFailed", e));
+ throw new LifecycleException(MESSAGES.protocolHandlerDestroyFailed(e));
}
}
@@ -1145,15 +1115,13 @@
stop();
}
} catch( Throwable t ) {
- log.error( "Unregistering - can't stop", t);
+ CatalinaLogger.CONNECTOR_LOGGER.connectorStopFailed(t);
}
}
public void destroy() throws Exception {
if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
if( oname!=null && controller==oname ) {
- if(log.isDebugEnabled())
- log.debug("Unregister itself " + oname );
Registry.getRegistry(null, null).unregisterComponent(oname);
}
}
Modified: trunk/src/main/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/CoyoteAdapter.java 2012-08-29
08:36:47 UTC (rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/CoyoteAdapter.java 2012-08-29
16:44:25 UTC (rev 2074)
@@ -54,13 +54,11 @@
import javax.servlet.SessionTrackingMode;
import org.apache.catalina.Context;
-import org.apache.catalina.Globals;
import org.apache.catalina.Host;
import org.apache.catalina.Manager;
import org.apache.catalina.Session;
import org.apache.catalina.Wrapper;
import org.apache.catalina.connector.Request.AsyncListenerRegistration;
-import org.apache.catalina.util.StringManager;
import org.apache.catalina.util.URLEncoder;
import org.apache.coyote.ActionCode;
import org.apache.coyote.Adapter;
@@ -71,8 +69,8 @@
import org.apache.tomcat.util.http.Cookies;
import org.apache.tomcat.util.http.ServerCookie;
import org.apache.tomcat.util.net.SocketStatus;
-import org.jboss.logging.Logger;
import org.jboss.servlet.http.HttpEvent;
+import org.jboss.web.CatalinaLogger;
/**
@@ -87,7 +85,6 @@
public class CoyoteAdapter
implements Adapter
{
- private static Logger log = Logger.getLogger(CoyoteAdapter.class);
// -------------------------------------------------------------- Constants
@@ -129,13 +126,6 @@
/**
- * The string manager for this package.
- */
- protected StringManager sm =
- StringManager.getManager(Constants.Package);
-
-
- /**
* Encoder for the Location URL in HTTP redirects.
*/
protected static URLEncoder urlEncoder;
@@ -277,7 +267,7 @@
if (!error && read && request.ready()) {
// 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"));
+ CatalinaLogger.CONNECTOR_LOGGER.servletDidNotReadAvailableData();
request.getEvent().setType(HttpEvent.EventType.ERROR);
error = true;
connector.getContainer().getPipeline().getFirst().event(request,
response, request.getEvent());
@@ -297,7 +287,7 @@
return (!error);
} catch (Throwable t) {
if (!(t instanceof IOException)) {
- log.error(sm.getString("coyoteAdapter.service"), t);
+ CatalinaLogger.CONNECTOR_LOGGER.exceptionDuringService(t);
}
error = true;
return false;
@@ -390,7 +380,7 @@
try {
asyncListener.onComplete(asyncEvent);
} catch (Throwable t) {
- log.error(sm.getString("coyoteAdapter.complete",
asyncListener.getClass()), t);
+
CatalinaLogger.CONNECTOR_LOGGER.exceptionDuringComplete(asyncListener.getClass().getName(),
t);
}
}
}
@@ -405,7 +395,7 @@
} catch (IOException e) {
;
} catch (Throwable t) {
- log.error(sm.getString("coyoteAdapter.service"), t);
+ CatalinaLogger.CONNECTOR_LOGGER.exceptionDuringService(t);
} finally {
req.getRequestProcessor().setWorkerThreadName(null);
// Recycle the wrapper request and response
@@ -749,7 +739,7 @@
}
} catch (Exception e) {
// Ignore
- log.error("Invalid URI encoding; using HTTP default");
+ CatalinaLogger.CONNECTOR_LOGGER.invalidEncodingUseHttpDefault(e);
connector.setURIEncoding(null);
}
if (conv != null) {
@@ -759,7 +749,7 @@
cc.getLength());
return;
} catch (IOException e) {
- log.error("Invalid URI character encoding; trying ascii");
+ CatalinaLogger.CONNECTOR_LOGGER.invalidEncoding(e);
cc.recycle();
}
}
Modified: trunk/src/main/java/org/apache/catalina/connector/HttpEventImpl.java
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/HttpEventImpl.java 2012-08-29
08:36:47 UTC (rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/HttpEventImpl.java 2012-08-29
16:44:25 UTC (rev 2074)
@@ -23,18 +23,10 @@
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;
Modified: trunk/src/main/java/org/apache/catalina/connector/InputBuffer.java
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/InputBuffer.java 2012-08-29 08:36:47
UTC (rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/InputBuffer.java 2012-08-29 16:44:25
UTC (rev 2074)
@@ -17,6 +17,8 @@
package org.apache.catalina.connector;
+import static org.jboss.web.CatalinaMessages.MESSAGES;
+
import java.io.IOException;
import java.io.Reader;
import java.security.AccessController;
@@ -26,7 +28,6 @@
import java.util.Locale;
import org.apache.catalina.security.SecurityUtil;
-import org.apache.catalina.util.StringManager;
import org.apache.coyote.ActionCode;
import org.apache.coyote.Request;
import org.apache.tomcat.util.buf.B2CConverter;
@@ -49,13 +50,6 @@
// -------------------------------------------------------------- Constants
- /**
- * The string manager for this package.
- */
- protected static StringManager sm =
- StringManager.getManager(Constants.Package);
-
-
public static final String DEFAULT_ENCODING =
org.apache.coyote.Constants.DEFAULT_CHARACTER_ENCODING;
public static final int DEFAULT_BUFFER_SIZE = 8*1024;
@@ -364,7 +358,7 @@
throws IOException {
if (closed)
- throw new IOException(sm.getString("inputBuffer.streamClosed"));
+ throw MESSAGES.streamClosed();
return bb.substract();
}
@@ -374,7 +368,7 @@
throws IOException {
if (closed)
- throw new IOException(sm.getString("inputBuffer.streamClosed"));
+ throw MESSAGES.streamClosed();
return bb.substract(b, off, len);
}
@@ -426,7 +420,7 @@
throws IOException {
if (closed)
- throw new IOException(sm.getString("inputBuffer.streamClosed"));
+ throw MESSAGES.streamClosed();
return cb.substract();
}
@@ -442,7 +436,7 @@
throws IOException {
if (closed)
- throw new IOException(sm.getString("inputBuffer.streamClosed"));
+ throw MESSAGES.streamClosed();
return cb.substract(cbuf, off, len);
}
@@ -452,7 +446,7 @@
throws IOException {
if (closed)
- throw new IOException(sm.getString("inputBuffer.streamClosed"));
+ throw MESSAGES.streamClosed();
if (n < 0) {
throw new IllegalArgumentException();
@@ -487,7 +481,7 @@
throws IOException {
if (closed)
- throw new IOException(sm.getString("inputBuffer.streamClosed"));
+ throw MESSAGES.streamClosed();
return (available() > 0);
}
@@ -502,7 +496,7 @@
throws IOException {
if (closed)
- throw new IOException(sm.getString("inputBuffer.streamClosed"));
+ throw MESSAGES.streamClosed();
if (cb.getLength() <= 0) {
cb.setOffset(0);
@@ -527,7 +521,7 @@
throws IOException {
if (closed)
- throw new IOException(sm.getString("inputBuffer.streamClosed"));
+ throw MESSAGES.streamClosed();
if (state == CHAR_STATE) {
if (markPos < 0) {
Deleted: trunk/src/main/java/org/apache/catalina/connector/LocalStrings.properties
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/LocalStrings.properties 2012-08-29
08:36:47 UTC (rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/LocalStrings.properties 2012-08-29
16:44:25 UTC (rev 2074)
@@ -1,89 +0,0 @@
-
-#
-# CoyoteConnector
-#
-
-coyoteConnector.alreadyInitialized=The connector has already been initialized
-coyoteConnector.alreadyStarted=The connector has already been started
-coyoteConnector.cannotRegisterProtocol=Cannot register MBean for the Protocol
-coyoteConnector.notStarted=Coyote connector has not been started
-coyoteConnector.protocolHandlerDestroyFailed=Protocol handler destroy failed: {0}
-coyoteConnector.protocolHandlerInitializationFailed=Protocol handler initialization
failed: {0}
-coyoteConnector.protocolHandlerInstantiationFailed=Protocol handler instantiation failed:
{0}
-coyoteConnector.protocolHandlerStartFailed=Protocol handler start failed: {0}
-coyoteConnector.protocolRegistrationFailed=Protocol JMX registration failed
-coyoteConnector.protocolHandlerPauseFailed=Protocol handler pause failed
-coyoteConnector.protocolHandlerResumeFailed=Protocol handler resume failed
-coyoteConnector.MapperRegistration=register Mapper: {0}
-coyoteConnector.protocolUnregistrationFailed=Protocol handler stop failed
-
-
-#
-# CoyoteAdapter
-#
-
-coyoteAdapter.service=An exception or error occurred in the container during the request
processing
-coyoteAdapter.read=The servlet did not read all available bytes during the processing of
the read event
-coyoteAdapter.complete=The AsyncLisnener {0} onComplete threw an exception, which will be
ignored
-
-#
-# CoyoteResponse
-#
-
-coyoteResponse.getOutputStream.ise=getWriter() has already been called for this response
-coyoteResponse.getWriter.ise=getOutputStream() has already been called for this response
-coyoteResponse.resetBuffer.ise=Cannot reset buffer after response has been committed
-coyoteResponse.sendError.ise=Cannot call sendError() after the response has been
committed
-coyoteResponse.sendRedirect.ise=Cannot call sendRedirect() after the response has been
committed
-coyoteResponse.setBufferSize.ise=Cannot change buffer size after data has been written
-coyoteResponse.sendFile.ise=Cannot call sendFile() after the response has been committed
-coyoteResponse.sendFile.no=Sendfile is disabled
-coyoteResponse.sendFile.path=Invalid path
-coyoteResponse.upgrade.ise=Cannot call sendUpgrade() after the response has been
committed
-coyoteResponse.upgrade.noEvents=Cannot upgrade from HTTP/1.1 without IO events
-coyoteResponse.upgrade.noHttpEventServlet=Cannot upgrade from HTTP/1.1 is not using an
HttpEventServlet
-
-#
-# CoyoteRequest
-#
-
-coyoteRequest.getInputStream.ise=getReader() has already been called for this request
-coyoteRequest.getReader.ise=getInputStream() has already been called for this request
-coyoteRequest.sessionCreateCommitted=Cannot create a session after the response has been
committed
-coyoteRequest.setAttribute.namenull=Cannot call setAttribute with a null name
-coyoteRequest.listenerStart=Exception sending context initialized event to listener
instance of class {0}
-coyoteRequest.listenerStop=Exception sending context destroyed event to listener instance
of class {0}
-coyoteRequest.attributeEvent=Exception thrown by attributes event listener
-coyoteRequest.parseMultipart=Exception thrown whilst processing multipart
-coyoteRequest.notMultipart=The request is not multipart content
-coyoteRequest.parseParameters=Exception thrown whilst processing POSTed parameters
-coyoteRequest.postTooLarge=Parameters were not parsed because the size of the posted data
was too big. Use the maxPostSize attribute of the connector to resolve this if the
application should accept large POSTs.
-coyoteRequest.noAuthenticator=No authenticator available for programmatic login
-coyoteRequest.authFailed=Failed to authenticate a principal
-coyoteRequest.noAsync=The servlet or filters that are being used by this request do not
support async operation
-coyoteRequest.servletStack=Current Servlet stack for thread {0}
-coyoteRequest.closed=Response has been closed already
-coyoteRequest.logoutfail=Exception logging out user
-coyoteRequest.cannotStartAsync=Cannot start async
-coyoteRequest.onStartAsyncError=Error invoking onStartAsync on listener of class {0}
-coyoteRequest.dispatchNoServletContext=Could not determine or access context for server
absolute path [{0}]
-coyoteRequest.createListener=Failed to instantiate class {0}
-
-#
-# MapperListener
-#
-mapperListener.unknownDefaultHost=Unknown default host: {0}
-mapperListener.registerHost=Register host {0} at domain {1}
-mapperListener.unregisterHost=Unregister host {0} at domain {1}
-mapperListener.registerContext=Register Context {0}
-mapperListener.unregisterContext=Unregister Context {0}
-mapperListener.registerWrapper=Register Wrapper {0} in Context {1}
-
-#
-# Others
-#
-
-requestFacade.nullRequest=The request object has been recycled and is no longer
associated with this facade
-responseFacade.nullResponse=The response object has been recycled and is no longer
associated with this facade
-cometEvent.nullRequest=The event object has been recycled and is no longer associated
with a request
-inputBuffer.streamClosed=Stream closed
Deleted: trunk/src/main/java/org/apache/catalina/connector/LocalStrings_es.properties
===================================================================
---
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_es.properties 2012-08-29
08:36:47 UTC (rev 2073)
+++
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_es.properties 2012-08-29
16:44:25 UTC (rev 2074)
@@ -1,64 +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.
-#
-# CoyoteConnector
-coyoteConnector.alreadyInitialized = Ya ha sido inicializado el conector
-coyoteConnector.alreadyStarted = Ya ha sido arrancado el conector
-coyoteConnector.cannotRegisterProtocol = No puedo registrar MBean para el Protocolo
-coyoteConnector.notStarted = El conector Coyote no ha sido arrancado
-coyoteConnector.protocolHandlerDestroyFailed = Fall\u00F3 la destrucci\u00F3n del
manejador de protocolo\: {0}
-coyoteConnector.protocolHandlerInitializationFailed = Fall\u00F3 la inicializaci\u00F3n
del manejador de protocolo\: {0}
-coyoteConnector.protocolHandlerInstantiationFailed = Fall\u00F3 la instanciaci\u00F3n del
manejador de protocolo\: {0}
-coyoteConnector.protocolHandlerStartFailed = Fall\u00F3 el arranque del manejador de
protocolo\: {0}
-coyoteConnector.protocolRegistrationFailed = Fall\u00F3 el registro de JMX
-coyoteConnector.protocolHandlerPauseFailed = Ha fallado la pausa del manejador de
protocolo
-coyoteConnector.protocolHandlerResumeFailed = Ha fallado el rearranque del manejador de
protocolo
-coyoteConnector.MapperRegistration = Mapeador de registro\: {0}
-coyoteConnector.protocolUnregistrationFailed = Ha fallado la parada del manejador de
protocolo
-#
-# CoyoteAdapter
-coyoteAdapter.service = Ha tenido lugar una excepci\u00F3n o error en el contenedor
durante el procesamiento del requerimiento
-coyoteAdapter.read = El servlet no ley\u00F3 todos los bytes disponibles durante el
procesamiento del evento de lectura
-#
-# CoyoteResponse
-coyoteResponse.getOutputStream.ise = getWriter() ya ha sido llamado para esta respuesta
-coyoteResponse.getWriter.ise = getOutputStream() ya ha sido llamado para esta respuesta
-coyoteResponse.resetBuffer.ise = No puedo limpiar el b\u00FAfer despu\u00E9s de que la
repuesta ha sido llevada a cabo
-coyoteResponse.sendError.ise = No puedo llamar a sendError() tras llevar a cabo la
respuesta
-coyoteResponse.sendRedirect.ise = No puedo llamar a sendRedirect() tras llevar a cabo la
respuesta
-coyoteResponse.setBufferSize.ise = No puedo cambiar la medida del b\u00FAfer tras
escribir los datos
-#
-# CoyoteRequest
-coyoteRequest.getInputStream.ise = getReader() ya ha sido llamado para este
requerimiento
-coyoteRequest.getReader.ise = getInputStream() ya ha sido llamado para este
requerimiento
-coyoteRequest.sessionCreateCommitted = No puedo crear una sesi\u00F3n despu\u00E9s de
llevar a cabo la respueta
-coyoteRequest.setAttribute.namenull = No pudeo llamar a setAttribute con un nombre nulo
-coyoteRequest.listenerStart = Excepci\u00F3n enviando evento inicializado de contexto a
instancia de escuchador de clase {0}
-coyoteRequest.listenerStop = Excepci\u00F3n enviando evento destru\u00EDdo de contexto a
instancia de escuchador de clase {0}
-coyoteRequest.attributeEvent = Excepci\u00F3n lanzada mediante el escuchador de eventos
de atributos
-coyoteRequest.parseParameters = Excepci\u00F3n lanzada al procesar par\u00E1metros POST
-coyoteRequest.postTooLarge = No se analizaron los par\u00E1metros porque la medida de los
datos enviados era demasiado grande. Usa el atributo maxPostSize del conector para
resolver esto en caso de que la aplicaci\u00F3n debiera de aceptar POSTs m\u00E1s
grandes.
-requestFacade.nullRequest = El objeto de requerimiento ha sido reciclado y ya no
est\u00E1 asociado con esta fachada
-responseFacade.nullResponse = El objeto de respuesta ha sido reciclado y ya no est\u00E1
asociado con esta fachada
-cometEvent.nullRequest = El objeto de evento ha sido reciclado y ya no est\u00E1 asociado
con este requerimiento
-mapperListener.unknownDefaultHost = M\u00E1quina por defecto desconocida\: {0}
-mapperListener.registerHost = Registrar m\u00E1quina {0} en dominio {1}
-mapperListener.unregisterHost = Desregistrar m\u00E1quina {0} en dominio {1}
-#
-# MapperListener
-mapperListener.registerContext = Registrar Contexto {0}
-mapperListener.unregisterContext = Desregistrar Contexto {0}
-mapperListener.registerWrapper = Registrar Arropador (Wrapper) {0} en Contexto {1}
-inputBuffer.streamClosed = Flujo cerrado
Deleted: trunk/src/main/java/org/apache/catalina/connector/LocalStrings_fr.properties
===================================================================
---
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_fr.properties 2012-08-29
08:36:47 UTC (rev 2073)
+++
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_fr.properties 2012-08-29
16:44:25 UTC (rev 2074)
@@ -1,58 +0,0 @@
-
-#
-# CoyoteConnector
-#
-
-coyoteConnector.alreadyInitialized=Le connecteur a d�j� �t� initialis�
-coyoteConnector.alreadyStarted=Le connecteur a d�j� �t� d�marr�
-coyoteConnector.cannotRegisterProtocol=Impossible d''enregistrer le MBean pour le
Protocol
-coyoteConnector.notStarted=Le connecteur Coyote n''a pas �t� d�marr�
-coyoteConnector.protocolHandlerDestroyFailed=La destruction du gestionnaire de protocole
a �chou�e: {0}
-coyoteConnector.protocolHandlerInitializationFailed=L''initialisation du
gestionnaire de protocole a �chou�: {0}
-coyoteConnector.protocolHandlerInstantiationFailed=L''instantiation du
gestionnaire de protocole a �chou�: {0}
-coyoteConnector.protocolHandlerStartFailed=Le d�marrage du gestionnaire de protocole a
�chou�: {0}
-coyoteConnector.protocolRegistrationFailed=L''enregistrement du protocol JMX a
�chou�
-coyoteConnector.protocolHandlerPauseFailed=La suspension du gestionnaire de protocole a
�chou�e
-coyoteConnector.protocolHandlerResumeFailed=Le red�marrage du gestionnaire de protocole a
�chou�
-
-#
-# CoyoteAdapter
-#
-
-coyoteAdapter.service=Une exception ou une erreur s''est produite dans le
conteneur durant le traitement de la requ�te
-
-#
-# CoyoteResponse
-#
-
-coyoteResponse.getOutputStream.ise="getWriter()" a d�j� �t� appel� pour cette
r�ponse
-coyoteResponse.getWriter.ise="getOutputStream()" a d�j� �t� appel� pour cette
r�ponse
-coyoteResponse.resetBuffer.ise=Impossible de remettre � z�ro le tampon apr�s que la
r�ponse ait �t� envoy�e
-coyoteResponse.sendError.ise=Impossible d''appeler "sendError()" apr�s
que la r�ponse ait �t� envoy�e
-coyoteResponse.sendRedirect.ise=Impossible d''appeler "sendRedirect()"
apr�s que la r�ponse ait �t� envoy�e
-coyoteResponse.setBufferSize.ise=Impossible de changer la taille du tampon apr�s que les
donn�es aient �t� �crites
-
-#
-# CoyoteRequest
-#
-
-coyoteRequest.getInputStream.ise="getReader()" a d�j� �t� appel� pour cette
requ�te
-coyoteRequest.getReader.ise="getInputStream()" a d�j� �t� appel� pour cette
requ�te
-coyoteRequest.sessionCreateCommitted=Impossible de cr�er une sessionapr�s que la r�ponse
ait �t� envoy�e
-coyoteRequest.setAttribute.namenull=Impossible d''appeler
"setAttribute" avec un nom nul
-coyoteRequest.listenerStart=Une exception s''est produite lors de
l''envoi de l''�v�nement contexte initialis� � l''instance de
classe d''�coute {0}
-coyoteRequest.listenerStop=Une exception s''est produite lors de l''envoi
de l''�v�nement contexte d�truit � l''instance de classe d''�coute
{0}
-coyoteRequest.attributeEvent=Une exception a �t� lanc�e par l''instance
d''�coute pour l''�v�nement attributs (attributes)
-coyoteRequest.postTooLarge=Les param�tres n''ont pas �t� �valu� car la taille des
donn�es post�es est trop important. Utilisez l''attribut maxPostSize du connecteur
pour corriger ce probl�me si votre application doit accepter des POSTs importants.
-
-
-#
-# MapperListener
-#
-
-mapperListener.registerContext=Enregistrement du contexte {0}
-mapperListener.unregisterContext=D�senregistrement du contexte {0}
-mapperListener.registerWrapper=Enregistrement de l''enrobeur (wrapper) {0} dans
le contexte {1}
-
-
-
Deleted: trunk/src/main/java/org/apache/catalina/connector/LocalStrings_ja.properties
===================================================================
---
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_ja.properties 2012-08-29
08:36:47 UTC (rev 2073)
+++
trunk/src/main/java/org/apache/catalina/connector/LocalStrings_ja.properties 2012-08-29
16:44:25 UTC (rev 2074)
@@ -1,58 +0,0 @@
-
-#
-# CoyoteConnector
-#
-
-coyoteConnector.alreadyInitialized=\u30b3\u30cd\u30af\u30bf\u306f\u65e2\u306b\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u307e\u3059
-coyoteConnector.alreadyStarted=\u30b3\u30cd\u30af\u30bf\u306f\u65e2\u306b\u8d77\u52d5\u3055\u308c\u3066\u3044\u307e\u3059
-coyoteConnector.cannotRegisterProtocol=\u305d\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306bMBean\u3092\u767b\u9332\u3067\u304d\u307e\u305b\u3093
-coyoteConnector.notStarted=Coyote\u30b3\u30cd\u30af\u30bf\u306f\u8d77\u52d5\u3055\u308c\u3066\u3044\u307e\u305b\u3093
-coyoteConnector.protocolHandlerDestroyFailed=\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u306e\u5ec3\u68c4\u306b\u5931\u6557\u3057\u307e\u3057\u305f:
{0}
-coyoteConnector.protocolHandlerInitializationFailed=\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u306e\u521d\u671f\u5316\u306b\u5931\u6557\u3057\u307e\u3057\u305f:
{0}
-coyoteConnector.protocolHandlerInstantiationFailed=\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u306b\u5931\u6557\u3057\u307e\u3057\u305f:
{0}
-coyoteConnector.protocolHandlerStartFailed=\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u306e\u8d77\u52d5\u306b\u5931\u6557\u3057\u307e\u3057\u305f:
{0}
-coyoteConnector.protocolRegistrationFailed=\u30d7\u30ed\u30c8\u30b3\u30ebJMX\u306e\u767b\u9332\u306b\u5931\u6557\u3057\u307e\u3057\u305f
-coyoteConnector.protocolHandlerPauseFailed=\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u306e\u4e00\u6642\u505c\u6b62\u306b\u5931\u6557\u3057\u307e\u3057\u305f
-coyoteConnector.protocolHandlerResumeFailed=\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u306e\u518d\u958b\u306b\u5931\u6557\u3057\u307e\u3057\u305f
-
-#
-# CoyoteAdapter
-#
-
-coyoteAdapter.service=\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u51e6\u7406\u4e2d\u306b\u30b3\u30cd\u30af\u30bf\u3067\u4f8b\u5916\u307e\u305f\u306f\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
-
-#
-# CoyoteResponse
-#
-
-coyoteResponse.getOutputStream.ise=getWriter()\u306f\u3053\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u5bfe\u3057\u3066\u65e2\u306b\u547c\u3073\u51fa\u3055\u308c\u3066\u3044\u307e\u3059
-coyoteResponse.getWriter.ise=getOutputStream()\u306f\u3053\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u5bfe\u3057\u3066\u65e2\u306b\u547c\u3073\u51fa\u3055\u308c\u3066\u3044\u307e\u3059
-coyoteResponse.resetBuffer.ise=\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u5f8c\u3067\u30d0\u30c3\u30d5\u30a1\u3092\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093
-coyoteResponse.sendError.ise=\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u5f8c\u3067sendError()\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093
-coyoteResponse.sendRedirect.ise=\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u5f8c\u3067sendRedirect()\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093
-coyoteResponse.setBufferSize.ise=\u30c7\u30fc\u30bf\u304c\u65e2\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305f\u5f8c\u3067\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093
-
-#
-# CoyoteRequest
-#
-
-coyoteRequest.getInputStream.ise=getReader()\u306f\u3053\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3057\u3066\u65e2\u306b\u547c\u3073\u51fa\u3055\u308c\u3066\u3044\u307e\u3059
-coyoteRequest.getReader.ise=getInputStream()\u306f\u3053\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3057\u3066\u65e2\u306b\u547c\u3073\u51fa\u3055\u308c\u3066\u3044\u307e\u3059
-coyoteRequest.sessionCreateCommitted=\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u30b3\u30df\u30c3\u30c8\u3057\u305f\u5f8c\u3067\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093
-coyoteRequest.setAttribute.namenull=setAttribute\u3092\u540d\u524d\u3092\u6307\u5b9a\u305b\u305a\u306b\u547c\u3073\u51fa\u3059\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093
-coyoteRequest.listenerStart=\u30af\u30e9\u30b9 {0}
\u306e\u30ea\u30b9\u30ca\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u521d\u671f\u5316\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u4fe1\u4e2d\u306b\u4f8b\u5916\u304c\u6295\u3052\u3089\u308c\u307e\u3057\u305f
-coyoteRequest.listenerStop=\u30af\u30e9\u30b9 {0}
\u306e\u30ea\u30b9\u30ca\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u5ec3\u68c4\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u4fe1\u4e2d\u306b\u4f8b\u5916\u304c\u6295\u3052\u3089\u308c\u307e\u3057\u305f
-coyoteRequest.attributeEvent=\u5c5e\u6027\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u306b\u3088\u3063\u3066\u4f8b\u5916\u304c\u6295\u3052\u3089\u308c\u307e\u3057\u305f
-coyoteRequest.postTooLarge=POST\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u5927\u304d\u3059\u304e\u305f\u306e\u3067\u3001\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u69cb\u6587\u89e3\u6790\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u305d\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u5de8\u5927\u306aPOST\u3092\u53d7\u3051\u4ed8\u3051\u306d\u3070\u306a\u3089\u306a\u3044\u5834\u5408\u306b\u306f\u3001\u3053\u308c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u30b3\u30cd\u30af\u30bf\u306emaxPostSize\u5c5e\u6027\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002
-
-
-#
-# MapperListener
-#
-
-mapperListener.registerContext=\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8
{0}\u3000\u3092\u767b\u9332\u3057\u307e\u3059
-mapperListener.unregisterContext=\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8 {0}
\u306e\u767b\u9332\u3092\u62b9\u6d88\u3057\u307e\u3059
-mapperListener.registerWrapper=\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8 {1}
\u306b\u30e9\u30c3\u30d1 {0} \u3092\u767b\u9332\u3057\u307e\u3059
-
-
-
Modified: trunk/src/main/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/Request.java 2012-08-29 08:36:47 UTC
(rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/Request.java 2012-08-29 16:44:25 UTC
(rev 2074)
@@ -47,6 +47,8 @@
package org.apache.catalina.connector;
+import static org.jboss.web.CatalinaMessages.MESSAGES;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
@@ -106,7 +108,6 @@
import org.apache.catalina.realm.GenericPrincipal;
import org.apache.catalina.util.Enumerator;
import org.apache.catalina.util.ParameterMap;
-import org.apache.catalina.util.StringManager;
import org.apache.catalina.util.StringParser;
import org.apache.coyote.ActionCode;
import org.apache.tomcat.util.buf.B2CConverter;
@@ -125,6 +126,7 @@
import org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory;
import org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload;
import org.apache.tomcat.util.http.mapper.MappingData;
+import org.jboss.web.CatalinaLogger;
/**
@@ -217,13 +219,6 @@
/**
- * The string manager for this package.
- */
- protected static StringManager sm =
- StringManager.getManager(Constants.Package);
-
-
- /**
* The set of cookies associated with this Request.
*/
protected Cookie[] cookies = null;
@@ -1218,8 +1213,7 @@
public ServletInputStream getInputStream() throws IOException {
if (usingReader)
- throw new IllegalStateException
- (sm.getString("coyoteRequest.getInputStream.ise"));
+ throw MESSAGES.readerAlreadyUsed();
if (applicationInputStream != null) {
return applicationInputStream;
@@ -1373,8 +1367,7 @@
public BufferedReader getReader() throws IOException {
if (usingInputStream)
- throw new IllegalStateException
- (sm.getString("coyoteRequest.getReader.ise"));
+ throw MESSAGES.inputStreamAlreadyUsed();
if (applicationReader != null) {
return applicationReader;
@@ -1631,7 +1624,7 @@
try {
listener.attributeRemoved(event);
} catch (Throwable t) {
-
context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
+ context.getLogger().error(MESSAGES.attributesEventListenerException(),
t);
// Error valve will pick this execption up and display it to user
attributes.put(RequestDispatcher.ERROR_EXCEPTION, t);
}
@@ -1649,8 +1642,7 @@
// Name cannot be null
if (name == null)
- throw new IllegalArgumentException
- (sm.getString("coyoteRequest.setAttribute.namenull"));
+ throw MESSAGES.attributeNameNotSpecified();
// Null value is the same as removeAttribute()
if (value == null) {
@@ -1715,7 +1707,7 @@
listener.attributeAdded(event);
}
} catch (Throwable t) {
-
context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
+ context.getLogger().error(MESSAGES.attributesEventListenerException(),
t);
// Error valve will pick this execption up and display it to user
attributes.put(RequestDispatcher.ERROR_EXCEPTION, t);
}
@@ -2633,8 +2625,7 @@
if ((response != null) &&
context.getCookies() &&
response.getResponse().isCommitted()) {
- throw new IllegalStateException
- (sm.getString("coyoteRequest.sessionCreateCommitted"));
+ throw MESSAGES.cannotCreateSession();
}
// Verify that the submitted session id exists in one of the host's web
applications
@@ -2831,10 +2822,7 @@
try {
parseMultipart();
} catch (Exception e) {
- if (context.getLogger().isDebugEnabled()) {
- context.getLogger().debug(
- sm.getString("coyoteRequest.parseMultipart"),
e);
- }
+ CatalinaLogger.CONNECTOR_LOGGER.exceptionProcessingMultipart(e);
}
}
return;
@@ -2845,10 +2833,7 @@
if (len > 0) {
int maxPostSize = connector.getMaxPostSize();
if ((maxPostSize > 0) && (len > maxPostSize)) {
- if (context.getLogger().isDebugEnabled()) {
- context.getLogger().debug(
- sm.getString("coyoteRequest.postTooLarge"));
- }
+ CatalinaLogger.CONNECTOR_LOGGER.postDataTooLarge();
return;
}
byte[] formData = null;
@@ -2865,10 +2850,7 @@
}
} catch (IOException e) {
// Client disconnect
- if (context.getLogger().isDebugEnabled()) {
- context.getLogger().debug(
- sm.getString("coyoteRequest.parseParameters"), e);
- }
+ CatalinaLogger.CONNECTOR_LOGGER.exceptionProcessingParameters(e);
return;
}
parameters.processParameters(formData, 0, len);
@@ -2879,10 +2861,7 @@
formData = readChunkedPostBody();
} catch (IOException e) {
// Client disconnect
- if (context.getLogger().isDebugEnabled()) {
- context.getLogger().debug(
- sm.getString("coyoteRequest.parseParameters"), e);
- }
+ CatalinaLogger.CONNECTOR_LOGGER.exceptionProcessingParameters(e);
return;
}
if (formData != null) {
@@ -2907,8 +2886,7 @@
if (connector.getMaxPostSize() > 0 &&
(body.getLength() + len) > connector.getMaxPostSize()) {
// Too much data
- throw new IllegalArgumentException(
- sm.getString("coyoteRequest.postTooLarge"));
+ throw MESSAGES.postDataTooLarge();
}
if (len > 0) {
body.append(buffer, 0, len);
@@ -2960,7 +2938,7 @@
contentType = contentType.trim();
}
if (!("multipart/form-data".equals(contentType)))
- throw new
ServletException(sm.getString("coyoteRequest.notMultipart"));
+ throw new ServletException(MESSAGES.notMultipart());
File location = null;
if (config.getLocation() == null || config.getLocation().length() == 0) {
@@ -2995,11 +2973,11 @@
parts.put(fileItem.getFieldName(), new StandardPart(fileItem, config));
}
} catch(FileSizeLimitExceededException e) {
- throw new
IllegalStateException(sm.getString("coyoteRequest.parseMultipart"), e);
+ throw MESSAGES.multipartProcessingFailed(e);
} catch(SizeLimitExceededException e) {
- throw new
IllegalStateException(sm.getString("coyoteRequest.parseMultipart"), e);
+ throw MESSAGES.multipartProcessingFailed(e);
} catch (FileUploadException e) {
- throw new IOException(sm.getString("coyoteRequest.parseMultipart"),
e);
+ throw MESSAGES.multipartIoProcessingFailed(e);
}
}
@@ -3200,17 +3178,17 @@
public AsyncContext startAsync(ServletRequest servletRequest,
ServletResponse servletResponse) throws IllegalStateException {
if (CHECK_ASYNC && !isAsyncSupported()) {
- throw new
IllegalStateException(sm.getString("coyoteRequest.noAsync"));
+ throw MESSAGES.noAsync();
}
// ISE if response is closed
if (response.isClosed() || context == null) {
- throw new
IllegalStateException(sm.getString("coyoteRequest.closed"));
+ throw MESSAGES.asyncClose();
}
// ISE if this method is called again without any asynchronous dispatch
// ISE if called outside of the subsequent dispatch
// ISE if called again within the scope of the same dispatch
if (!canStartAsync) {
- throw new
IllegalStateException(sm.getString("coyoteRequest.cannotStartAsync"));
+ throw MESSAGES.cannotStartAsync();
}
LinkedHashMap<AsyncListener, AsyncListenerRegistration> localAsyncListeners
= asyncListeners;
asyncListeners = new LinkedHashMap<AsyncListener,
AsyncListenerRegistration>();
@@ -3220,8 +3198,7 @@
try {
asyncListener.onStartAsync(asyncEvent);
} catch (IOException e) {
- throw new
IllegalStateException(sm.getString("coyoteRequest.onStartAsyncError",
- asyncListener.getClass().getName()), e);
+ throw MESSAGES.errorStartingAsync(asyncListener.getClass().getName(),
e);
}
}
canStartAsync = false;
@@ -3240,21 +3217,21 @@
if (context != null && context.getAuthenticator() != null) {
return context.getAuthenticator().authenticate(this, response);
} else {
- throw new
ServletException(sm.getString("coyoteRequest.noAuthenticator"));
+ throw new ServletException(MESSAGES.noAuthenticator());
}
}
public void login(String username, String password) throws ServletException {
if (userPrincipal != null) {
- throw new
ServletException(sm.getString("coyoteRequest.authFailed"));
+ throw new ServletException(MESSAGES.authenticationFailure());
}
if (context != null && context.getAuthenticator() != null) {
context.getAuthenticator().login(this, username, password);
} else {
- throw new
ServletException(sm.getString("coyoteRequest.noAuthenticator"));
+ throw new ServletException(MESSAGES.noAuthenticator());
}
if (userPrincipal == null) {
- throw new
ServletException(sm.getString("coyoteRequest.authFailed"));
+ throw new ServletException(MESSAGES.authenticationFailure());
}
}
@@ -3271,7 +3248,7 @@
try {
gp.logout();
} catch (Exception e) {
- throw new
ServletException(sm.getString("coyoteRequest.logoutfail"), e);
+ throw new ServletException(MESSAGES.logoutFailure(), e);
}
}
}
@@ -3318,7 +3295,7 @@
public String toString() {
StringBuilder buf = new StringBuilder();
- buf.append(sm.getString("coyoteRequest.servletStack",
Thread.currentThread().getName()));
+ buf.append("Current Servlet stack for thread
").append(Thread.currentThread().getName());
if (eventMode) {
buf.append(" [event]");
}
@@ -3390,7 +3367,7 @@
if (servletContext != null) {
path =
requestURI.substring(servletContext.getContextPath().length());
} else {
- throw new
IllegalStateException(sm.getString("coyoteRequest.dispatchNoServletContext",
requestURI));
+ throw MESSAGES.cannotFindDispatchContext(requestURI);
}
}
resume();
@@ -3506,7 +3483,7 @@
try {
listenerInstance = (T) context.getInstanceManager().newInstance(clazz);
} catch (Exception e) {
- throw new
ServletException(sm.getString("coyoteRequest.createListener", clazz.getName()),
e);
+ throw new
ServletException(MESSAGES.listenerCreationFailed(clazz.getName()), e);
}
return listenerInstance;
}
Modified: trunk/src/main/java/org/apache/catalina/connector/RequestFacade.java
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/RequestFacade.java 2012-08-29
08:36:47 UTC (rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/RequestFacade.java 2012-08-29
16:44:25 UTC (rev 2074)
@@ -18,6 +18,8 @@
package org.apache.catalina.connector;
+import static org.jboss.web.CatalinaMessages.MESSAGES;
+
import java.io.BufferedReader;
import java.io.IOException;
import java.security.AccessController;
@@ -44,7 +46,6 @@
import org.apache.catalina.Globals;
import org.apache.catalina.core.ApplicationFilterChain;
import org.apache.catalina.security.SecurityUtil;
-import org.apache.catalina.util.StringManager;
/**
* Facade class that wraps a Coyote request object.
@@ -231,13 +232,6 @@
protected Request request = null;
- /**
- * The string manager for this package.
- */
- protected static StringManager sm =
- StringManager.getManager(Constants.Package);
-
-
// --------------------------------------------------------- Public Methods
@@ -264,8 +258,7 @@
public Object getAttribute(String name) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getAttribute(name);
@@ -275,8 +268,7 @@
public Enumeration getAttributeNames() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -291,8 +283,7 @@
public String getCharacterEncoding() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -308,8 +299,7 @@
throws java.io.UnsupportedEncodingException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
request.setCharacterEncoding(env);
@@ -319,8 +309,7 @@
public int getContentLength() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getContentLength();
@@ -330,8 +319,7 @@
public String getContentType() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getContentType();
@@ -341,8 +329,7 @@
public ServletInputStream getInputStream() throws IOException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getInputStream();
@@ -352,8 +339,7 @@
public String getParameter(String name) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -368,8 +354,7 @@
public Enumeration getParameterNames() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -384,8 +369,7 @@
public String[] getParameterValues(String name) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
String[] ret = null;
@@ -411,8 +395,7 @@
public Map getParameterMap() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -427,8 +410,7 @@
public String getProtocol() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getProtocol();
@@ -438,8 +420,7 @@
public String getScheme() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getScheme();
@@ -449,8 +430,7 @@
public String getServerName() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getServerName();
@@ -460,8 +440,7 @@
public int getServerPort() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getServerPort();
@@ -471,8 +450,7 @@
public BufferedReader getReader() throws IOException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getReader();
@@ -482,8 +460,7 @@
public String getRemoteAddr() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getRemoteAddr();
@@ -493,8 +470,7 @@
public String getRemoteHost() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getRemoteHost();
@@ -504,8 +480,7 @@
public void setAttribute(String name, Object o) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
request.setAttribute(name, o);
@@ -515,8 +490,7 @@
public void removeAttribute(String name) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
request.removeAttribute(name);
@@ -526,8 +500,7 @@
public Locale getLocale() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -542,8 +515,7 @@
public Enumeration getLocales() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -558,8 +530,7 @@
public boolean isSecure() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.isSecure();
@@ -569,8 +540,7 @@
public RequestDispatcher getRequestDispatcher(String path) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -584,8 +554,7 @@
public String getRealPath(String path) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getRealPath(path);
@@ -595,8 +564,7 @@
public String getAuthType() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getAuthType();
@@ -606,8 +574,7 @@
public Cookie[] getCookies() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
Cookie[] ret = null;
@@ -633,8 +600,7 @@
public long getDateHeader(String name) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getDateHeader(name);
@@ -644,8 +610,7 @@
public String getHeader(String name) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getHeader(name);
@@ -655,8 +620,7 @@
public Enumeration getHeaders(String name) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -671,8 +635,7 @@
public Enumeration getHeaderNames() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (Globals.IS_SECURITY_ENABLED){
@@ -687,8 +650,7 @@
public int getIntHeader(String name) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getIntHeader(name);
@@ -698,8 +660,7 @@
public String getMethod() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getMethod();
@@ -709,8 +670,7 @@
public String getPathInfo() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getPathInfo();
@@ -720,8 +680,7 @@
public String getPathTranslated() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getPathTranslated();
@@ -731,8 +690,7 @@
public String getContextPath() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getContextPath();
@@ -742,8 +700,7 @@
public String getQueryString() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getQueryString();
@@ -753,8 +710,7 @@
public String getRemoteUser() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getRemoteUser();
@@ -764,8 +720,7 @@
public boolean isUserInRole(String role) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.isUserInRole(role);
@@ -775,8 +730,7 @@
public java.security.Principal getUserPrincipal() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getUserPrincipal();
@@ -786,8 +740,7 @@
public String getRequestedSessionId() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getRequestedSessionId();
@@ -797,8 +750,7 @@
public String getRequestURI() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getRequestURI();
@@ -808,8 +760,7 @@
public StringBuffer getRequestURL() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getRequestURL();
@@ -819,8 +770,7 @@
public String getServletPath() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getServletPath();
@@ -830,8 +780,7 @@
public HttpSession getSession(boolean create) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
if (SecurityUtil.isPackageProtectionEnabled()){
@@ -845,8 +794,7 @@
public HttpSession getSession() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return getSession(true);
@@ -856,8 +804,7 @@
public boolean isRequestedSessionIdValid() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.isRequestedSessionIdValid();
@@ -867,8 +814,7 @@
public boolean isRequestedSessionIdFromCookie() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.isRequestedSessionIdFromCookie();
@@ -878,8 +824,7 @@
public boolean isRequestedSessionIdFromURL() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.isRequestedSessionIdFromURL();
@@ -889,8 +834,7 @@
public boolean isRequestedSessionIdFromUrl() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.isRequestedSessionIdFromURL();
@@ -900,8 +844,7 @@
public String getLocalAddr() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getLocalAddr();
@@ -911,8 +854,7 @@
public String getLocalName() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getLocalName();
@@ -922,8 +864,7 @@
public int getLocalPort() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getLocalPort();
@@ -933,8 +874,7 @@
public int getRemotePort() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getRemotePort();
@@ -943,8 +883,7 @@
public AsyncContext getAsyncContext() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getAsyncContext();
@@ -953,8 +892,7 @@
public ServletContext getServletContext() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getServletContext();
@@ -963,8 +901,7 @@
public boolean isAsyncStarted() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.isAsyncStarted();
@@ -973,8 +910,7 @@
public boolean isAsyncSupported() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.isAsyncSupported();
@@ -983,8 +919,7 @@
public AsyncContext startAsync() throws IllegalStateException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.startAsync();
@@ -994,8 +929,7 @@
public AsyncContext startAsync(ServletRequest servletRequest,
ServletResponse servletResponse) throws IllegalStateException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.startAsync(servletRequest, servletResponse);
@@ -1004,8 +938,7 @@
public DispatcherType getDispatcherType() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getDispatcherType();
@@ -1017,8 +950,7 @@
*/
public ApplicationFilterChain getFilterChain() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getFilterChain();
}
@@ -1031,8 +963,7 @@
*/
public void setFilterChain(ApplicationFilterChain filterChain) {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
request.setFilterChain(filterChain);
}
@@ -1043,8 +974,7 @@
*/
public void nextFilterChain() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
request.nextFilterChain();
}
@@ -1055,8 +985,7 @@
*/
public void releaseFilterChain() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
request.releaseFilterChain();
}
@@ -1065,8 +994,7 @@
public boolean authenticate(HttpServletResponse response) throws IOException,
ServletException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.authenticate(response);
@@ -1075,8 +1003,7 @@
public void login(String username, String password) throws ServletException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
request.login(username, password);
@@ -1085,8 +1012,7 @@
public void logout() throws ServletException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
request.logout();
@@ -1095,8 +1021,7 @@
public Part getPart(String name) throws IOException, ServletException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getPart(name);
@@ -1105,8 +1030,7 @@
public Collection<Part> getParts() throws IOException, ServletException {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.getParts();
@@ -1114,8 +1038,7 @@
public boolean hasSendfile() {
if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ throw MESSAGES.nullRequestFacade();
}
return request.hasSendfile();
Modified: trunk/src/main/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/Response.java 2012-08-29 08:36:47
UTC (rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/Response.java 2012-08-29 16:44:25
UTC (rev 2074)
@@ -19,6 +19,8 @@
package org.apache.catalina.connector;
+import static org.jboss.web.CatalinaMessages.MESSAGES;
+
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
@@ -46,7 +48,6 @@
import org.apache.catalina.security.SecurityUtil;
import org.apache.catalina.util.CharsetMapper;
import org.apache.catalina.util.DateTool;
-import org.apache.catalina.util.StringManager;
import org.apache.coyote.ActionCode;
import org.apache.naming.resources.CacheEntry;
import org.apache.naming.resources.ProxyDirContext;
@@ -91,13 +92,6 @@
"org.apache.coyote.tomcat5.CoyoteResponse/1.0";
- /**
- * The string manager for this package.
- */
- protected static StringManager sm =
- StringManager.getManager(Constants.Package);
-
-
// ----------------------------------------------------- Instance Variables
/**
@@ -572,8 +566,7 @@
throws IOException {
if (usingWriter)
- throw new IllegalStateException
- (sm.getString("coyoteResponse.getOutputStream.ise"));
+ throw MESSAGES.writerAlreadyUsed();
if (applicationOutputStream != null) {
return applicationOutputStream;
@@ -612,8 +605,7 @@
throws IOException {
if (usingOutputStream)
- throw new IllegalStateException
- (sm.getString("coyoteResponse.getWriter.ise"));
+ throw MESSAGES.outputStreamAlreadyUsed();
if (applicationWriter != null) {
return applicationWriter;
@@ -686,8 +678,7 @@
public void resetBuffer() {
if (isCommitted())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.resetBuffer.ise"));
+ throw MESSAGES.cannotResetBuffer();
outputBuffer.reset();
@@ -729,8 +720,7 @@
public void setBufferSize(int size) {
if (isCommitted() || !outputBuffer.isNew())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.setBufferSize.ise"));
+ throw MESSAGES.cannotChangeBufferSize();
outputBuffer.setBufferSize(size);
@@ -1278,8 +1268,7 @@
throws IOException {
if (isCommitted())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.sendError.ise"));
+ throw MESSAGES.cannotSendError();
// Ignore any call from an included servlet
if (included)
@@ -1317,8 +1306,7 @@
throws IOException {
if (isCommitted())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.sendRedirect.ise"));
+ throw MESSAGES.cannotSendRedirect();
// Ignore any call from an included servlet
if (included)
@@ -1345,16 +1333,13 @@
public void startUpgrade() {
if (isCommitted())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.upgrade.ise"));
+ throw MESSAGES.cannotSendUpgrade();
if (!connector.hasIoEvents())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.upgrade.noEvents"));
+ throw MESSAGES.cannotUpgradeWithoutEvents();
if (!request.isEventMode() || request.getAsyncContext() != null)
- throw new IllegalStateException
- (sm.getString("coyoteResponse.upgrade.noHttpEventServlet"));
+ throw MESSAGES.cannotUpgradeWithoutEventServlet();
// Ignore any call from an included servlet
if (included)
@@ -1369,16 +1354,13 @@
throws IOException {
if (isCommitted())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.upgrade.ise"));
+ throw MESSAGES.cannotSendUpgrade();
if (!connector.hasIoEvents())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.upgrade.noEvents"));
+ throw MESSAGES.cannotUpgradeWithoutEvents();
if (!request.isEventMode() || request.getAsyncContext() != null)
- throw new IllegalStateException
- (sm.getString("coyoteResponse.upgrade.noHttpEventServlet"));
+ throw MESSAGES.cannotUpgradeWithoutEventServlet();
// Ignore any call from an included servlet
if (included)
@@ -1397,15 +1379,14 @@
public void sendFile(String path, String absolutePath, long start, long end) {
if (isCommitted())
- throw new IllegalStateException
- (sm.getString("coyoteResponse.sendFile.ise"));
+ throw MESSAGES.cannotSendFile();
// Ignore any call from an included servlet
if (included)
return;
if (!request.hasSendfile())
- throw new
IllegalStateException(sm.getString("coyoteResponse.sendFile.no"));
+ throw MESSAGES.noSendFile();
if (Globals.IS_SECURITY_ENABLED) {
if (path != null) {
@@ -1422,7 +1403,7 @@
try {
canonicalPath = new File(absolutePath).getCanonicalPath();
} catch (IOException e) {
- throw new
IllegalArgumentException(sm.getString("coyoteResponse.sendFile.path"));
+ throw MESSAGES.invalidSendFilePath(absolutePath);
}
System.getSecurityManager().checkRead(canonicalPath);
coyoteResponse.setSendfilePath(absolutePath);
Modified: trunk/src/main/java/org/apache/catalina/connector/ResponseFacade.java
===================================================================
--- trunk/src/main/java/org/apache/catalina/connector/ResponseFacade.java 2012-08-29
08:36:47 UTC (rev 2073)
+++ trunk/src/main/java/org/apache/catalina/connector/ResponseFacade.java 2012-08-29
16:44:25 UTC (rev 2074)
@@ -18,6 +18,8 @@
package org.apache.catalina.connector;
+import static org.jboss.web.CatalinaMessages.MESSAGES;
+
import java.io.IOException;
import java.io.PrintWriter;
import java.security.AccessController;
@@ -33,7 +35,6 @@
import org.apache.catalina.Globals;
import org.apache.catalina.security.SecurityUtil;
-import org.apache.catalina.util.StringManager;
import org.jboss.servlet.http.UpgradableHttpServletResponse;
/**
@@ -107,13 +108,6 @@
/**
- * The string manager for this package.
- */
- protected static StringManager sm =
- StringManager.getManager(Constants.Package);
-
-
- /**
* The wrapped response.
*/
protected Response response = null;
@@ -142,8 +136,7 @@
public void finish() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
response.setSuspended(true);
@@ -153,8 +146,7 @@
public boolean isFinished() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.isSuspended();
@@ -167,8 +159,7 @@
public String getCharacterEncoding() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.getCharacterEncoding();
@@ -242,8 +233,7 @@
public int getBufferSize() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.getBufferSize();
@@ -298,8 +288,7 @@
public boolean isCommitted() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return (response.isAppCommitted());
@@ -329,8 +318,7 @@
public Locale getLocale() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.getLocale();
@@ -350,8 +338,7 @@
public boolean containsHeader(String name) {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.containsHeader(name);
@@ -361,8 +348,7 @@
public String encodeURL(String url) {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.encodeURL(url);
@@ -372,8 +358,7 @@
public String encodeRedirectURL(String url) {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.encodeRedirectURL(url);
@@ -383,8 +368,7 @@
public String encodeUrl(String url) {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.encodeURL(url);
@@ -394,8 +378,7 @@
public String encodeRedirectUrl(String url) {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.encodeRedirectURL(url);
@@ -570,8 +553,7 @@
public String getContentType() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.getContentType();
@@ -581,8 +563,7 @@
public void setCharacterEncoding(String arg0) {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
response.setCharacterEncoding(arg0);
@@ -591,8 +572,7 @@
public String getHeader(String name) {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.getHeader(name);
@@ -601,8 +581,7 @@
public Collection<String> getHeaderNames() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.getHeaderNames();
@@ -611,8 +590,7 @@
public Collection<String> getHeaders(String name) {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.getHeaders(name);
@@ -621,8 +599,7 @@
public int getStatus() {
if (response == null) {
- throw new IllegalStateException(
- sm.getString("responseFacade.nullResponse"));
+ throw MESSAGES.nullResponseFacade();
}
return response.getStatus();
Modified: trunk/src/main/java/org/jboss/web/CatalinaLogger.java
===================================================================
--- trunk/src/main/java/org/jboss/web/CatalinaLogger.java 2012-08-29 08:36:47 UTC (rev
2073)
+++ trunk/src/main/java/org/jboss/web/CatalinaLogger.java 2012-08-29 16:44:25 UTC (rev
2074)
@@ -25,6 +25,7 @@
import static org.jboss.logging.Logger.Level.ERROR;
import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;
+import static org.jboss.logging.Logger.Level.DEBUG;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Cause;
@@ -60,6 +61,11 @@
*/
CatalinaLogger REALM_LOGGER = Logger.getMessageLogger(CatalinaLogger.class,
"org.apache.catalina.realm");
+ /**
+ * A logger with the category of the package name.
+ */
+ CatalinaLogger CONNECTOR_LOGGER = Logger.getMessageLogger(CatalinaLogger.class,
"org.apache.catalina.connector");
+
@LogMessage(level = WARN)
@Message(id = 1000, value = "A valid entry has been removed from client nonce
cache to make room for new entries. A replay attack is now possible. To prevent the
possibility of replay attacks, reduce nonceValidity or increase cnonceCacheSize. Further
warnings of this type will be suppressed for 5 minutes.")
void digestCacheRemove();
@@ -88,4 +94,80 @@
@Message(id = 1006, value = "Missing parent [%s].")
void missingParentJmxRegistration(Object objectName, @Cause Throwable t);
+ @LogMessage(level = INFO)
+ @Message(id = 1007, value = "The connector has already been initialized")
+ void connectorAlreadyInitialized();
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1008, value = "Failed connector [%s] JMX registration.")
+ void failedConnectorJmxRegistration(Object objectName, @Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1009, value = "Failed connector [%s] JMX unregistration.")
+ void failedConnectorJmxUnregistration(Object objectName, @Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1010, value = "Protocol handler pause failed")
+ void protocolHandlerPauseFailed(@Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1011, value = "Protocol handler resume failed")
+ void protocolHandlerResumeFailed(@Cause Throwable t);
+
+ @LogMessage(level = INFO)
+ @Message(id = 1012, value = "The connector has already been started")
+ void connectorAlreadyStarted();
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1012, value = "Failed protocol handler [%s] JMX
registration.")
+ void failedProtocolJmxRegistration(Object objectName, @Cause Throwable t);
+
+ @LogMessage(level = INFO)
+ @Message(id = 1013, value = "Cannot proceed with protocol handler JMX
registration.")
+ void failedProtocolJmxRegistration();
+
+ @LogMessage(level = INFO)
+ @Message(id = 1014, value = "The connector has not been started")
+ void connectorNotStarted();
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1015, value = "Failed protocol handler [%s] JMX
unregistration.")
+ void failedProtocolJmxUnregistration(Object objectName, @Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1016, value = "Connector stop failure")
+ void connectorStopFailed(@Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1017, value = "The Servlet did not read all available bytes during
the processing of the read event")
+ void servletDidNotReadAvailableData();
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1018, value = "An exception or error occurred in the container
during the request processing")
+ void exceptionDuringService(@Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1019, value = "The AsyncLisnener %s onComplete threw an exception,
which will be ignored")
+ void exceptionDuringComplete(String className, @Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1020, value = "Invalid URI encoding, will use HTTP default")
+ void invalidEncodingUseHttpDefault(@Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 1021, value = "Invalid URI encoding, will use straight
conversion")
+ void invalidEncoding(@Cause Throwable t);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 1022, value = "Exception thrown whilst processing
multipart")
+ void exceptionProcessingMultipart(@Cause Throwable t);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 1023, value = "Parameters were not parsed because the size of the
posted data was too big. Use the maxPostSize attribute of the connector to resolve this if
the application should accept large POSTs.")
+ void postDataTooLarge();
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 1024, value = "Exception thrown whilst processing POSTed
parameters")
+ void exceptionProcessingParameters(@Cause Throwable t);
+
}
Modified: trunk/src/main/java/org/jboss/web/CatalinaMessages.java
===================================================================
--- trunk/src/main/java/org/jboss/web/CatalinaMessages.java 2012-08-29 08:36:47 UTC (rev
2073)
+++ trunk/src/main/java/org/jboss/web/CatalinaMessages.java 2012-08-29 16:44:25 UTC (rev
2074)
@@ -22,6 +22,7 @@
package org.jboss.web;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
@@ -105,9 +106,120 @@
@Message(id = 21, value = "Illegal digest encoding %s")
IllegalArgumentException illegalDigestEncoding(String digest, @Cause
UnsupportedEncodingException e);
- @Message(id = 21, value = "Missing MD5 digest")
+ @Message(id = 22, value = "Missing MD5 digest")
IllegalArgumentException noMD5Digest(@Cause NoSuchAlgorithmException e);
+ @Message(id = 23, value = "Protocol handler initialization failed")
+ String protocolHandlerInitFailed(@Cause Throwable t);
+
+ @Message(id = 24, value = "Protocol handler start failed")
+ String protocolHandlerStartFailed(@Cause Throwable t);
+
+ @Message(id = 25, value = "Protocol handler destroy failed")
+ String protocolHandlerDestroyFailed(@Cause Throwable t);
+
+ @Message(id = 26, value = "Failed to instatiate protocol handler")
+ IllegalArgumentException protocolHandlerInstantiationFailed(@Cause Throwable t);
+
+ @Message(id = 27, value = "getWriter() has already been called for this
response")
+ IllegalStateException writerAlreadyUsed();
+
+ @Message(id = 28, value = "getOutputStream() has already been called for this
response")
+ IllegalStateException outputStreamAlreadyUsed();
+
+ @Message(id = 29, value = "Cannot reset buffer after response has been
committed")
+ IllegalStateException cannotResetBuffer();
+
+ @Message(id = 30, value = "Cannot change buffer size after data has been
written")
+ IllegalStateException cannotChangeBufferSize();
+
+ @Message(id = 31, value = "Cannot call sendError() after the response has been
committed")
+ IllegalStateException cannotSendError();
+
+ @Message(id = 32, value = "Cannot call sendRedirect() after the response has
been committed")
+ IllegalStateException cannotSendRedirect();
+
+ @Message(id = 33, value = "Cannot call sendUpgrade() after the response has been
committed")
+ IllegalStateException cannotSendUpgrade();
+
+ @Message(id = 34, value = "Cannot upgrade from HTTP/1.1 without IO
events")
+ IllegalStateException cannotUpgradeWithoutEvents();
+
+ @Message(id = 35, value = "Cannot upgrade from HTTP/1.1 is not using an
HttpEventServlet")
+ IllegalStateException cannotUpgradeWithoutEventServlet();
+
+ @Message(id = 36, value = "Cannot call sendFile() after the response has been
committed")
+ IllegalStateException cannotSendFile();
+
+ @Message(id = 37, value = "Sendfile is disabled")
+ IllegalStateException noSendFile();
+
+ @Message(id = 38, value = "Invalid path for sendfile %s")
+ IllegalStateException invalidSendFilePath(String path);
+
+ @Message(id = 39, value = "getReader() has already been called for this
request")
+ IllegalStateException readerAlreadyUsed();
+
+ @Message(id = 40, value = "getInputStream() has already been called for this
request")
+ IllegalStateException inputStreamAlreadyUsed();
+
+ @Message(id = 41, value = "Exception thrown by attributes event listener")
+ String attributesEventListenerException();
+
+ @Message(id = 42, value = "Cannot call setAttribute with a null name")
+ IllegalStateException attributeNameNotSpecified();
+
+ @Message(id = 43, value = "Cannot create a session after the response has been
committed")
+ IllegalStateException cannotCreateSession();
+
+ @Message(id = 44, value = "Parameters were not parsed because the size of the
posted data was too big. Use the maxPostSize attribute of the connector to resolve this if
the application should accept large POSTs.")
+ IllegalStateException postDataTooLarge();
+
+ @Message(id = 45, value = "The request is not multipart content")
+ String notMultipart();
+
+ @Message(id = 46, value = "Exception thrown whilst processing multipart")
+ IllegalStateException multipartProcessingFailed(@Cause Throwable t);
+
+ @Message(id = 47, value = "Exception thrown whilst processing multipart")
+ IOException multipartIoProcessingFailed(@Cause Throwable t);
+
+ @Message(id = 48, value = "The servlet or filters that are being used by this
request do not support async operation")
+ IllegalStateException noAsync();
+
+ @Message(id = 49, value = "Response has been closed already")
+ IllegalStateException asyncClose();
+
+ @Message(id = 50, value = "Cannot start async")
+ IllegalStateException cannotStartAsync();
+
+ @Message(id = 51, value = "Error invoking onStartAsync on listener of class
{0}")
+ IllegalStateException errorStartingAsync(String listenerClassName, @Cause Throwable
t);
+
+ @Message(id = 52, value = "No authenticator available for programmatic
login")
+ String noAuthenticator();
+
+ @Message(id = 53, value = "Failed to authenticate a principal")
+ String authenticationFailure();
+
+ @Message(id = 54, value = "Exception logging out user")
+ String logoutFailure();
+
+ @Message(id = 55, value = "Could not determine or access context for server
absolute URI %s")
+ IllegalStateException cannotFindDispatchContext(String uri);
+
+ @Message(id = 56, value = "Failed to instantiate class %s")
+ String listenerCreationFailed(String className);
+
+ @Message(id = 57, value = "The request object has been recycled and is no longer
associated with this facade")
+ IllegalStateException nullRequestFacade();
+
+ @Message(id = 58, value = "The response object has been recycled and is no
longer associated with this facade")
+ IllegalStateException nullResponseFacade();
+
+ @Message(id = 60, value = "Stream closed")
+ IOException streamClosed();
+
@Message(id = 64, value = "Error report")
String errorReport();