From: markt Date: Wed, 8 Dec 2010 12:57:54 +0000 (+0000) Subject: Re-factoring in support of https://issues.apache.org/bugzilla/show_bug.cgi?id=50360 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f113100d0a662636fd315617d020b8879c7c55f7;p=tomcat7.0 Re-factoring in support of https://issues.apache.org/bugzilla/show_bug.cgi?id=50360 Pull up pause() and resume() methods git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1043395 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/AbstractProtocolHandler.java b/java/org/apache/coyote/AbstractProtocolHandler.java index 39c43154b..9c50e5368 100644 --- a/java/org/apache/coyote/AbstractProtocolHandler.java +++ b/java/org/apache/coyote/AbstractProtocolHandler.java @@ -342,19 +342,46 @@ public abstract class AbstractProtocolHandler implements ProtocolHandler, @Override public abstract void init() throws Exception; + @Override + public final void pause() throws Exception { + if(getLog().isInfoEnabled()) + getLog().info(sm.getString("abstractProtocolHandler.action", + "Pausing", getName())); + try { + endpoint.pause(); + } catch (Exception ex) { + getLog().error(sm.getString("abstractProtocolHandler.actionError", + "pause", getName()), ex); + throw ex; + } + } + + @Override + public final void resume() throws Exception { + if(getLog().isInfoEnabled()) + getLog().info(sm.getString("abstractProtocolHandler.action", + "Resuming", getName())); + try { + endpoint.resume(); + } catch (Exception ex) { + getLog().error(sm.getString("abstractProtocolHandler.actionError", + "resule", getName()), ex); + throw ex; + } + } + @Override public final void destroy() { if(getLog().isInfoEnabled()) { - getLog().info(sm.getString("abstractProtocolHandler.destroy", - getName())); + getLog().info(sm.getString("abstractProtocolHandler.action", + "Destroying", getName())); } try { endpoint.destroy(); } catch (Exception e) { - getLog().error(sm.getString( - "abstractProtocolHandler.endPointDestroyError", getName()), - e); + getLog().error(sm.getString("abstractProtocolHandler.actionError", + "destroy", getName()), e); } if( tpOname!=null ) diff --git a/java/org/apache/coyote/LocalStrings.properties b/java/org/apache/coyote/LocalStrings.properties index 32fe65e7d..7ba6011bf 100644 --- a/java/org/apache/coyote/LocalStrings.properties +++ b/java/org/apache/coyote/LocalStrings.properties @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +abstractProtocolHandler.action={0} ProtocolHandler [{1}] +abstractProtocolHandler.actionError=Failed to {0} end point associated with ProtocolHandler [{1}] abstractProtocolHandler.getAttribute=Get attribute [{0}] with value [{1}] abstractProtocolHandler.setAttribute=Set attribute [{0}] with value [{1}] -abstractProtocolHandler.endPointDestroyError=Failed to destroy end point associated with ProtocolHandler [{0}] -abstractProtocolHandler.destroy=Destroying ProtocolHandler [{0}] asyncStateMachine.invalidAsyncState=Calling [{0}] is not valid for a request with Async state [{1}] diff --git a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java index 3a7151790..225e7eeef 100644 --- a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java +++ b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java @@ -76,33 +76,6 @@ public abstract class AbstractAjpProtocol extends AbstractProtocolHandler { // ------------------------------------------------------- Lifecycle methods @Override - public void pause() throws Exception { - try { - endpoint.pause(); - } catch (Exception ex) { - getLog().error(sm.getString("ajpprotocol.endpoint.pauseerror"), ex); - throw ex; - } - if (getLog().isInfoEnabled()) - getLog().info(sm.getString("ajpprotocol.pause", getName())); - } - - - @Override - public void resume() throws Exception { - try { - endpoint.resume(); - } catch (Exception ex) { - getLog().error(sm.getString("ajpprotocol.endpoint.resumeerror"), - ex); - throw ex; - } - if (getLog().isInfoEnabled()) - getLog().info(sm.getString("ajpprotocol.resume", getName())); - } - - - @Override public void stop() throws Exception { try { endpoint.stop(); diff --git a/java/org/apache/coyote/ajp/LocalStrings.properties b/java/org/apache/coyote/ajp/LocalStrings.properties index edbefe117..ce4ad7430 100644 --- a/java/org/apache/coyote/ajp/LocalStrings.properties +++ b/java/org/apache/coyote/ajp/LocalStrings.properties @@ -30,10 +30,6 @@ ajpprotocol.init=Initializing Coyote AJP/1.3 on {0} ajpprotocol.proto.error=Error reading request, ignored ajpprotocol.start=Starting Coyote AJP/1.3 on {0} ajpprotocol.stop=Stopping Coyote AJP/1.3 on {0} -ajpprotocol.pause=Pausing Coyote AJP/1.3 on {0} -ajpprotocol.endpoint.pauseerror=Error pausing endpoint -ajpprotocol.resume=Resuming Coyote AJP/1.3 on {0} -ajpprotocol.endpoint.resumeerror=Error resuming endpoint ajpprotocol.failedread=Socket read failed ajpprotocol.failedwrite=Socket write failed ajpprotocol.request.register=Error registering request processor in JMX diff --git a/java/org/apache/coyote/ajp/LocalStrings_es.properties b/java/org/apache/coyote/ajp/LocalStrings_es.properties index 4c8e8cb6a..46256fcd0 100644 --- a/java/org/apache/coyote/ajp/LocalStrings_es.properties +++ b/java/org/apache/coyote/ajp/LocalStrings_es.properties @@ -19,10 +19,6 @@ ajpprotocol.init = Inicializando Coyote AJP/1.3 en {0} ajpprotocol.proto.error = Error leyendo requerimiento, ignorado ajpprotocol.start = Arrancando Coyote AJP/1.3 en {0} ajpprotocol.stop = Parando Coyote AJP/1.3 en {0} -ajpprotocol.pause = Pausando Coyote AJP/1.3 en {0} -ajpprotocol.endpoint.pauseerror = Error pausando punto final -ajpprotocol.resume = Retomando Coyote AJP/1.3 en {0} -ajpprotocol.endpoint.resumeerror = Error retomando punto final ajpprotocol.failedread = Fallo en lectura de Conector ajpprotocol.failedwrite = Fallo en escritura de Conector ajpprotocol.request.register = Error registrando procesador de requerimiento en JMX diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java index 84f232724..88ff9da98 100644 --- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java +++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java @@ -194,32 +194,6 @@ public abstract class AbstractHttp11Protocol extends AbstractProtocolHandler { // ------------------------------------------------------- Lifecycle methods @Override - public void pause() throws Exception { - try { - endpoint.pause(); - } catch (Exception ex) { - getLog().error(sm.getString("http11protocol.endpoint.pauseerror"), - ex); - throw ex; - } - if(getLog().isInfoEnabled()) - getLog().info(sm.getString("http11protocol.pause", getName())); - } - - @Override - public void resume() throws Exception { - try { - endpoint.resume(); - } catch (Exception ex) { - getLog().error(sm.getString("http11protocol.endpoint.resumeerror"), - ex); - throw ex; - } - if(getLog().isInfoEnabled()) - getLog().info(sm.getString("http11protocol.resume", getName())); - } - - @Override public void stop() throws Exception { try { endpoint.stop(); diff --git a/java/org/apache/coyote/http11/LocalStrings.properties b/java/org/apache/coyote/http11/LocalStrings.properties index a0a37d72c..e51345d68 100644 --- a/java/org/apache/coyote/http11/LocalStrings.properties +++ b/java/org/apache/coyote/http11/LocalStrings.properties @@ -26,10 +26,6 @@ http11protocol.proto.socketexception.info=SocketException reading request, ignor http11protocol.socketfactory.initerror=Error initializing socket factory http11protocol.start=Starting Coyote HTTP/1.1 on {0} http11protocol.stop=Stopping Coyote HTTP/1.1 on {0} -http11protocol.pause=Pausing Coyote HTTP/1.1 on {0} -http11protocol.endpoint.pauseerror=Error pausing endpoint -http11protocol.resume=Resuming Coyote HTTP/1.1 on {0} -http11protocol.endpoint.resumeerror=Error resuming endpoint http11processor.regexp.error=Error parsing regular expression {0} http11processor.filter.unknown=Unknown filter {0} diff --git a/java/org/apache/coyote/http11/LocalStrings_es.properties b/java/org/apache/coyote/http11/LocalStrings_es.properties index 5703dec5a..13258c442 100644 --- a/java/org/apache/coyote/http11/LocalStrings_es.properties +++ b/java/org/apache/coyote/http11/LocalStrings_es.properties @@ -24,10 +24,6 @@ http11protocol.proto.socketexception.info = SocketException leyendo requerimient http11protocol.socketfactory.initerror = Error inicializando f\u00E1brica de enchufes (sockets) http11protocol.start = Arrancando Coyote HTTP/1.1 en puerto {0} http11protocol.stop = Parando Coyote HTTP/1.1 en puerto {0} -http11protocol.pause = Pausando Coyote HTTP/1.1 en puerto {0} -http11protocol.endpoint.pauseerror = Error al pausar punto final -http11protocol.resume = Retomando Coyote HTTP/1.1 en {0} -http11protocol.endpoint.resumeerror = Error al retomar punto final http11processor.regexp.error = Error al analizar expresi\u00F3n regular {0} http11processor.filter.unknown = Filtro desconocido {0} diff --git a/java/org/apache/coyote/http11/LocalStrings_fr.properties b/java/org/apache/coyote/http11/LocalStrings_fr.properties index 37d5c11ef..ed98dec1f 100644 --- a/java/org/apache/coyote/http11/LocalStrings_fr.properties +++ b/java/org/apache/coyote/http11/LocalStrings_fr.properties @@ -24,8 +24,6 @@ http11protocol.proto.socketexception.info=Exception "Socket" (SocketException) \ http11protocol.socketfactory.initerror=Erreur \u00e0 l'initialisation du cr\u00e9ateur de socket (socket factory) http11protocol.start=D\u00e9marrage de Coyote HTTP/1.1 sur {0} http11protocol.stop=Arr\u00eat de Coyote HTTP/1.1 sur {0} -http11protocol.pause=Suspension de Coyote HTTP/1.1 sur {0} -http11protocol.resume=Red\u00e9marrage de Coyote HTTP/1.1 sur {0} iib.eof.error=Fin de flux (EOF) inattendue \u00e0 la lecture sur la socket iib.requestheadertoolarge.error=L'ent\u00eate de requ\u00eate est trop important diff --git a/java/org/apache/coyote/http11/LocalStrings_ja.properties b/java/org/apache/coyote/http11/LocalStrings_ja.properties index d16b6b139..a87cd9dec 100644 --- a/java/org/apache/coyote/http11/LocalStrings_ja.properties +++ b/java/org/apache/coyote/http11/LocalStrings_ja.properties @@ -24,10 +24,6 @@ http11protocol.proto.socketexception.info=\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u http11protocol.socketfactory.initerror=\u30bd\u30b1\u30c3\u30c8\u30d5\u30a1\u30af\u30c8\u30ea\u3092\u521d\u671f\u5316\u4e2d\u306e\u30a8\u30e9\u30fc\u3067\u3059 http11protocol.start=Coyote HTTP/1.1\u3092 {0} \u3067\u8d77\u52d5\u3057\u307e\u3059 http11protocol.stop=Coyote HTTP/1.1\u3092 {0} \u3067\u505c\u6b62\u3057\u307e\u3059 -http11protocol.pause=Coyote HTTP/1.1\u3092 {0} \u3067\u4e00\u6642\u505c\u6b62\u3057\u307e\u3059 -http11protocol.endpoint.pauseerror=\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306e\u4e00\u6642\u505c\u6b62\u4e2d\u306e\u30a8\u30e9\u30fc\u3067\u3059 -http11protocol.resume=Coyote HTTP/1.1\u3092 {0} \u3067\u518d\u958b\u3057\u307e\u3059 -http11protocol.endpoint.resumeerror=\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306e\u518d\u958b\u4e2d\u306e\u30a8\u30e9\u30fc\u3067\u3059 iib.eof.error=\u30bd\u30b1\u30c3\u30c8\u304b\u3089\u4e88\u671f\u3057\u306a\u3044EOF\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3057\u305f iib.requestheadertoolarge.error=\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u304c\u9577\u3059\u304e\u307e\u3059