Its a slightly tricky one this. I think the start() method on a broker should start it up & block until its complete.
However in the case of a slave, its considered started when it gets to the 'waiting for the lock' step. So it'd be nice if the slave's start() method blocks until everything-but-the-lock is started (so most validation kicks in) and then at the point at which the lock is attempted to be acquired, the caller thread returns by default. (Or this could be optionally sync/async). So rather than making the entire start thread async v async; am wondering if the concept of 'acquire exclusive lock' should be put into BrokerService (along with the logic that the transport connectors only start after that lock is acquired). So maybe the acquire exclusive lock should always be async; and the start() method just has an option to wait for it or not etc? On 6/14/07, eta <[EMAIL PROTECTED]> wrote:
So, are you saying that AMQ-1273 should be withdrawn? You're right that the user could choose some way to call the broker start() method asynchronously. In fact that's what I suggested to the user who was struggling with this problem in a web application with an embedded (slave) broker. I was actually going to follow on to my proposal with a suggestion to make the broker "Observable" and allow any number of Observers to be notified about broker status changes. Going from Master->Slave or Slave->Master would be just one such event. Using such a facility, an embedded broker could be kicked off "in the background" either by a user thread or by calling a startAsych() method on the broker, and the user app could be notified as interesting things happened to the broker. Bear with me as I'm new to the codebase, but I don't think there's any such facility now. Eric I think I would rather keep code like that out of the broker. If you want do do async operations with the broker, the end user could always just use an executor and a FutureTask. See: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Future.html -- View this message in context: http://www.nabble.com/AMQ-1273-tf3917378s2354.html#a11112793 Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
-- James ------- http://macstrac.blogspot.com/
