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

Re: ANTS question



> Hi,Timothy 
> 
> >The evaluate() method can execute arbitrary java code, 
>  
> I think you have made a mistake by saying that.

well, yeah, arbitrary byte codes, not arbitrary access to
builtin libraries.

> In my AA, to read the local file,I  modified the=
>  edu.utah.janos.nodeos.FlowClassSpec.Java file by adding some=
>  classes to the defaultJavaClasses array,for=
>  example,java.io.File. Otherwise,the ANTS will prompt 
> "Error starting new mid in Flow[name=3D...]
>  java.lang.NoClassFoundError:java/io/File
>  ...
> 
> "
> 
> right?

right

> >so it will wait as long as you want.  
> 
> I thinked so. But the truth was, if the capsule waited for more=
>  than 5 second before the meaningful information appear,
> its evaluate() would not be executed on the next node. The ANTS=
>  reported no error and there was no promption, either. I used=
>  Tcpdump to see if the capsule have arrived node.To my=
>  surprise,there was a packet heading the listening port 8004,but=
>  the evaluate() didnot work.By contrast, if the capsule wait for=
>  no more than 5 second,everything was OK. 

> I don't know why this happened.Do you have any idea?

There are a limited number of threads available to handle incoming
capsules.  So, if you receive a bunch of capsules and block in these
threads the flow will eventually run out of threads that can handle new
capsules.  You should look into using a NodeCache.EventHandler to take
care of the polling.  Simply create an object that extends this class and
add it to the NodeCache.  When the timeout is reached the NodeCache will
call a method on this object (collected()) and you can do the poll there.  
Then, if the poll succeeds you have the method return 0 to remove the
object from the NodeCache, otherwise you return the number of seconds to
delay until the method should be called again.

> thanks a lot
> 
> Jianfeng Liu

tim stack




[ Janos ] [ OSKit ] [ Network Testbed ] [ Flick ] [ Fluke ]
Flux Research Group / Department of Computer Science / University of Utah