Robert Burrell Donkin ha scritto:
On Sat, Apr 5, 2008 at 10:19 AM, Robert Burrell Donkin
<[EMAIL PROTECTED]> wrote:
been staring hard at some of the handler framework
from AbstractJamesHandler:
<snip>
#3 > } catch (RuntimeException e) {
#4 > StringBuffer exceptionBuffer =
#4 > new StringBuffer(256)
#4 > .append("Unexpected exception opening from ")
#4 > .append(remoteHost)
#4 > .append(" (")
#4 > .append(remoteIP)
#4 > .append("): ")
#4 > .append(e.getMessage());
#4 > String exceptionString = exceptionBuffer.toString();
#4 > getLogger().error(exceptionString, e);
#7 > throw e;
<snip>
#7 when an exception is caught, it is immediately rethrown. in this
case, are the streams ever closed? do they need to be?
when called from handleConnection(Socket), it will be closed on
handleClean but it's a protected method and so could (potentially) be
called from subclasses. wonder whether subclasses should really be
overriding this method.
- robert
I think I did the last changes to that code, but it was 2 years ago and
my memory can't even remember what I ate yesterday ;-)
For sure we didn't any "private=>protected" change because of user
requests, so we can change it if we are not the users of that protected
method.
From a fast code read I would say that a "try {} finally {
cleanHandler(); }" should wrap the initHandler call, but I don't
remember where we call the handlerConnection and how we handle errors.
I can't find the protected handleClean method you refer to. I only see
cleanHandler and it is private.
Stefano
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]