db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik" <Dag.Wan...@Sun.COM>
Subject Re: [PATCH] (DERBY-205) Rename org.apache.derby.impl.drda.DB2jServerImpl to NetworkServerControlImpl
Date Tue, 17 May 2005 21:56:36 GMT

Hi Kathey,

>>>>> "KM" == Kathey Marsden <kmarsdenderby@sbcglobal.net> wrote:

KM> thing I noticed right away is that it would be nice to get rid of the
KM> NETWORKSERVER_PROP* values all together and not duplicate the ones in 
KM> org.apache.derby.iapi.reference.Property.

Back from extended week-end here! I have been looking into the string
constants in NetworkServerControlImpl:

  NETWORKSERVER_PROP_STREAM_ERROR_FIELD="derby.stream.error.field";
  NETWORKSERVER_PROP_STREAM_ERROR_METHOD="derby.stream.error.method";
  NETWORKSERVER_PROP_STREAM_ERROR_FILE="derby.stream.error.file";

I see these are being used to (redundantly) read the name of the log
file from the said properties, incidentally in a different order from what
SingleStream does as part of booting the service, in makeHPW(). Also,
SingleStream defaults the log to System.err in case of errors, something not
reflected in the code in NetworkServerControlImpl, so the code seems
not only redundant, but broken, too.

Anyway, the name deduced for the log by NetworkServerControlImpl ends
up in NetworkServerControlImpl's private field errorLogLocation, which
in turn is used *only* (as far as i can tell) by DRDAConnThread,
through getErrorLogLocation(), to make exception strings for the
client.

I did not find the *_PROP_* strings declared in
org.apache.derby.iapi.reference.Property, though. SingleStream has
them hard coded (an issue?). Presently, the name of the log
file/method/field is discarded by SingleStream when it constructs the
BasicHeaderPrintWriter.  I am considering saving the name in a field
in BasicHeaderPrintWriter and extend the HeaderPrintWriter interface
to allow NetworkServerControlImpl to access it:

	public void blockingStart(PrintWriter consoleWriter)
		throws Exception
	{
		startNetworkServer();
		setLogWriter(consoleWriter);
***>		errorLogLocation = Monitor.getStream().getName();
		cloudscapeLogWriter = Monitor.getStream().getPrintWriter();

thus getting rid of the offending code in
NetworkServerControlImpl.getPropertyInfo().  This would lead to
errorLogLocation being set *later* (not as now, by the constructor of
NetworkServerControlImpl), but it looks like it will still be set in
time (i.e. before any connections are opened).

What do you think? 

Dag

Mime
View raw message