swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with ProbeMap and java and subclass?


From: Steve Brophy
Subject: Re: problem with ProbeMap and java and subclass?
Date: Fri, 14 Apr 2000 12:33:17 -0400

Thanks for the quick fix.  That took care of my "getCompleteVarMapFor"
problem, but I think that a different bug is showing up now:

When adding a VarProbe to an EmptyProbeMap, I had been using a hard-coded
class reference such as "MyClass.class" in these two calls.  After the fixed
.dll files were installed, this now gave an error.  I found that the error
was avoided if I changed all "MyClass.class" references to instead be
"getClass()" references, PLUS removed all other "MyClass.class" references
from the code?

The following example gives an error with the new .dll files, but works with
the original 2.1.1 dlls (on an NT system).  Or alternately it will work with
the new dlls if the noted line is commented out:

--------------

import swarm.Globals;
import swarm.defobj.Zone;
import swarm.objectbase.EmptyProbeMapImpl;
import swarm.objectbase.ProbeMap;
import swarm.objectbase.SwarmObjectImpl;

public class TestProbe extends SwarmObjectImpl {
    public int myint;

    public TestProbe(Zone aZone) {
        super(aZone);
    }

    public void addaprobe () {
        ProbeMap pmapA;
        pmapA = new EmptyProbeMapImpl(Globals.env.globalZone, getClass());
        pmapA.addProbe(Globals.env.probeLibrary.getProbeForVariable$inClass(
                                "myint", getClass()));
        Class c = TestProbe.class;  // take out this line to avoid bug
    }

    public static void main(String[] args) {
        Globals.env.initSwarm("tst4", "00", "smb", args);
        TestProbe ap = new TestProbe(Globals.env.globalZone);
        ap.addaprobe();
        System.out.println("Got it.");
    };
}
//////////////////

thanks,
Steve

Steve Brophy,  address@hidden
ERIM, Ann Arbor MI



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]