I figured out how to pass the reference.
Declare a member variable (a reference to Sampler).

In the ConfigGui,
    public void configure(TestElement element)
    {
...
if(element instanceof org.apache.jmeter.protocol.corba.sampler.CorbaSampler)
{
 sampler = (org.apache.jmeter.protocol.corba.sampler.CorbaSampler) element;
}
   ...
}

Now I can call methods on Sampler that were not part of the TestElement or
other interfaces - it works!
Thanks,
Anil

-----Original Message-----
From: Anil Philip [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 27, 2004 10:05 AM
To: 'JMeter Developers List'
Subject: can a ConfigGui get the reference of its Sampler instance? (to pass
data back and forth)

Question: 
How can the CorbaConfigGui obtain the reference of the CorbaSampler
instance? Is there some way for the Sampler (the 'publisher' or the other
way round) to obtain a list of its subscribers and so it can iterate through
the list doing instanceOf() on each of them until it finds the
CorbaConfigGui?

Background: I am writing a CorbaSampler and CorbaConfigGui based upon the
TCPSampler and TCPConfigGui.

Apparently there does not seem to be direct linkages between components. A
component cannot store the reference of another ie. it has no direct
knowledge of another. Since it is a plugin, everything is by implementing
interfaces or abstract classes.

So when the input data file is chosen at the CorbaConfigGui, there does not
seem to be any facility for callbacks or notifications for the CorbaSampler
to then load the data and return the names of methods. When these names are
loaded in the combo box, and one is picked, the input data parameters for
that method is returned. Then the Sampler is stored until it is time to run
the test.

-
Thanks,
Anil Philip


---------------------------------------------------------------------
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]

Reply via email to