There is a tree traverser that knows how to search for all objects of a certain type. So, that provides a very convenient way to find all the ThreadListeners.
-Mike On Thu, 2005-07-21 at 16:44 +0100, sebb wrote: > Oops, that's my fault - I implemented it over a year ago, and promptly > forgot about it ... > > Obviously I thought it was useful at the time, but I did not consider > the effect on test startup/shutdown. > > Looking at it again now, I suppose the cloneTree method could check > for the appropriate interface and save the appropriate objects in a > collection associated with the thread, and use that collection to > invoke the threadStarted/Finished methods. > > Simply changing the existing code to check if the interface was > implemented before calling the method would probably just increase the > work done. > > S. > On 21/07/05, Michael Stover <[EMAIL PROTECTED]> wrote: > > Well, I was a little surprised to discover this method is a part of > > every TestElement. That seems like overkill, and maybe it would be more > > appropriate for it to be a separate interface that any element can > > implement. If every Test Element object instance in a test has to have > > it's "threadFinished()" method called, I can see that slowing down test > > shutdown on large tests. > > > > -Mike > > > > On Thu, 2005-07-21 at 15:44 +0100, sebb wrote: > > > That's a lot simpler - don't know how I managed to miss that one. > > > > > > S. > > > On 21/07/05, Michael Stover <[EMAIL PROTECTED]> wrote: > > > > On Thu, 2005-07-21 at 15:17 +0100, sebb wrote: > > > > > On 21/07/05, Michael Stover <[EMAIL PROTECTED]> wrote: > > > > > > JMeter has a global namespace and thread-specific namespaces. > > > > > > Seems to > > > > > > me you would want to store your socket in the thread-specific > > > > > > namespace, > > > > > > and any TCP Sampler can retrieve it from there. Each one should > > > > > > also be > > > > > > able to create a new one if it does not yet exist, and at test end, > > > > > > the > > > > > > sampler should make sure to clean it out (implement TestListener). > > > > > > > > > > If I recall correctly, the TestListener testEnded() method is called > > > > > from a single, different thread - and only one instance is called. The > > > > > existing TCP sampler uses a private static Set to keep track of these. > > > > > > > > That's a good point. Instead, each element can override the > > > > threadFinished() method of TestElement to do this sort of cleanup. > > > > > > > > -Mike > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

