sav.z
Class Commutator

java.lang.Object
  extended bysav.z.Commutator

public class Commutator
extends java.lang.Object

Permits to interrupt a current Script execution.

The example stops printing that a few Sessions do contemporary.

  Commutator comm = new Commutator();
  for (int i = 0; i < 5; ++i) {
    CommutatorDemo ss = new CommutatorDemo(text, i);
    ss.setCommutator(comm);
    new Thread(ss).start();
  }
  Thread.sleep(1000);
  comm.setOff(true);
  ...
 

See Also:
Session.getCommutator(), Session.setCommutator(sav.z.Commutator)

Constructor Summary
Commutator()
          Constructs a Commutator object.
 
Method Summary
 boolean isOff()
          Returns true if Commutator is switched off.
 void setOff(boolean yes)
          Switches a Commutator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Commutator

public Commutator()
Constructs a Commutator object.

Method Detail

setOff

public void setOff(boolean yes)
Switches a Commutator.

Parameters:
yes - true if need switch off Commutator, false if need switch on

isOff

public boolean isOff()
Returns true if Commutator is switched off.