commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject [IO] Tailer API
Date Thu, 30 Sep 2010 01:46:55 GMT
Just wondering if the Tailer API could be simplified by performing the
thread start within the class?
Is it ever going to be useful to have direct access to tailer thread?
I suspect not, as the Listener should provide sufficient access.

It's not safe to start a thread in the constructor (unless the ctor is
final), but one could use static factory methods instead.

So instead of:

  TailerListener listener = ...
  Tailer tailer = new Tailer(file, listener, delay);
  Thread thread = new Thread(tailer);

one would do something like:

  TailerListener listener = ...
  Tailer tailer = Tailer.createTailer(file, listener, delay);

This simplifies the API, and allows the class to force the thread to
be a daemon thread. It also stops the caller from messing with the


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message