What you're doing is similar to what the JMeterVariables object provides you - a place to store values by thread. By implementing the ThreadListener interface, you are given access to the JMeterVariables. Currently, it only allows the storage of string variables, but there's no reason you could simply modify it to store objects as well.
Regarding samplers that can do more than one thing - I'd like to expand the sampler interface to allow one sampler to return multiple SampleResults (via a callback interface) and do mutliple things. I'd then like to make a scripted Sampler that allowed one to write some J/Python code into JMeter's gui that would then be run as the Sampler's sample() method. Is this kind of what you mean by allowing a single sampler to do more? -Mike On 17 Feb 2003 at 9:42, Bruno Dillenseger wrote: > I don't know if what I do is the cleanest way (it might be actually a dirty way), >but it is straightforward: > - the connect sampler fills a static hashtable object with its current thread as key >and your custom server reference object as value; > - the disconnect sampler retrieves the reference from the hashtable, using its >current thread as key. > > I even do some synchronization on this thread object (wait()/notify()) and I get >deadlocks in a couple of threads from time to time, without knowing if it is caused >by a bug in my code, or if it results from a conflict between by code and internal >synchronization of Jmeter's thread management (should have a look at the code...) > > From my point of view, I don't feel it convenient to proceed this way. I would feel >it more convenient to have a single sampler object with its own state, performing a >variety of operations during the test plan. > > If a Jmeter developper reads this, probably s/he can comment on my workaround ? > > Regards, > -- Bruno. > > Vjeran Marcinko wrote: > > Hi all. I'm developing samplers for my custom java server, and basically I have 2 >samplers - Connect and Disconnect request ... Thing is that Connect sampler >instantiates socket connection, and needs to pass that Socket object to Disconnect >sampler so I could send my custom disconnect object through that Socket instance. But I dunno still how to share objects between samplers ? I see few components in JMeter that seem to be able to do this (Configuration, Modifier...), but I ask this way if someone can suggest me the cleanest and simpliest way .... > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Michael Stover [EMAIL PROTECTED] Yahoo IM: mstover_ya ICQ: 152975688 AIM: mstover777 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

