Jordan, I wanted to chime in and say that we ended up writing a similar library for our application. For example we have a BreakableLock that implements java.util.concurrent.Lock but requires you to provide a BrokenLockListener implementation. Naming aside it looks pretty similar to your implementaion with the ClientClosingListener. We also have similar code for dealing with path creation, retry etc. In order to deal with watches we defined a Reconnectable interface that users can implement. These reconnectables are added to a client and called on session expiration or other catastrophic client failures. This gives users a clean way to reestablish their watches and reset internal state while centralizing all of the error handling.
When we get around to refactoring or expanding our code base we'll definitely take a look at using Curator. If nothing else it makes us feel good that someone else solved a lot of the same problems in a similar fashion. - will On Wed, Oct 12, 2011 at 8:17 PM, Jordan Zimmerman <[email protected]>wrote: > Nice! I'll update the code. > > On 10/12/11 5:12 PM, "Camille Fournier" <[email protected]> wrote: > > >Oh here's one thing you may find useful. I did find your TestingServer > >nice and tried it out today for some code I was hacking. I hit a bug > >though in my test teardowns, and solved it by adding this to stop > >(courtesy ClientBase) > > > > ZKDatabase zkDb = server.getZKDatabase(); > > try { > > zkDb.close(); > > } catch (IOException ie) { > > System.err.println("Error closing logs " + ie); > > } > > > >In case you hit the same error of being unable to delete the directories. > > > >C > > > >On Tue, Oct 11, 2011 at 10:53 PM, Jordan Zimmerman > ><[email protected]> wrote: > >> Good <3 ed. :) > >> > >> ==================== > >> Jordan Zimmerman > >> > >> On Oct 11, 2011, at 7:46 PM, "Ted Dunning" <[email protected]> > >>wrote: > >> > >>> Don't worry about being prickly. Camille and I can beat you any day > >>>on that > >>> account. > >>> > >>> Just be good hearted and serious about making things good while you are > >>> being prickly. > >>> > >>> On Wed, Oct 12, 2011 at 1:18 AM, Jordan Zimmerman > >>><[email protected]>wrote: > >>> > >>>> Sorry. I didn't mean to come across as prickly. > >>>> > >>>> ==================== > >>>> Jordan Zimmerman > >>>> > >>>> On Oct 11, 2011, at 4:52 PM, "Camille Fournier" <[email protected]> > >>>> wrote: > >>>> > >>>>> You asked for feedback, I gave it. > >>>> > >> > > > >
