On 27/03/2020 16:13, Rémy Maucherat wrote:
> On Fri, Mar 27, 2020 at 4:54 PM Mark Thomas <ma...@apache.org
> <mailto:ma...@apache.org>> wrote:
> 
>     On 25/03/2020 13:43, Rémy Maucherat wrote:
>     > On Mon, Mar 23, 2020 at 11:11 AM Mark Thomas <ma...@apache.org
>     <mailto:ma...@apache.org>
>     > <mailto:ma...@apache.org <mailto:ma...@apache.org>>> wrote:
>     >
>     >     > - Reduce instances of setters and getters for the same property
>     >     existing
>     >     > on an object and its parent. This may require new objects to be
>     >     exposed
>     >     > via JMX.
>     >     > Fixed enough ?
>     >
>     >     From memory, this was primarily on the Connectors. That is
>     certainly a
>     >     lot better. I'd like to review things before closing this one out.
>     >
>     >
>     > There's indeed a problem on Connector, but I don't see how to fix it.
>     >
>     > Ex:
>     >     public void setMaxPostSize(int maxPostSize) {
>     >         this.maxPostSize = maxPostSize;
>     >         setProperty("maxPostSize", String.valueOf(maxPostSize));
>     >     }
>     >
>     > Both Catalina and Coyote need to access the value. The alternative
>     would
>     > be to have the Catalina code use getProperty, which would be both
>     uglier
>     > and slower.
> 
>     I don't see any use of that particular property in Coyote. I think the
>     setProperty() call can be removed.
> 
> 
> :D
> Grep confirms that we can remove the setProperty. Ok, that was a
> horrible example, but a few others in Connector are useful in both (like
> maxSavePostSize, which is one I looked at, then I wrote the post talking
> about maxPostSize).

The ones we need to keep are (I think):

asyncTimeout
maxSavePostSize
port
portOffset
localPort
secure

In terms of simplification, we could leave them as is or:
- Add them to ProtocolHandler
- Refactor Connector to pass the getter/setter calls to the
  ProtocolHandler instance.

I'm currently running a set of unit tests with the other setProperty()
calls removed to confirm I haven't missed anything.

I haven't looked elsewhere yet.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to