This is the network sensor supervising system example accompanying
with the OnJava article.

Here are the directory structures:
+ ant-dist -- Ant bindary
+ etc/META-INF -- configuration xml files
+ lib -- library for JBossCacheAop
+ src -- the source for this example

You can run the example either through Ant or using BeanShell.

0. do "build.bat compile"

1. To run it under Ant, do "build.bat run.aop.example" will produce
the output illustrated in the article.

2. To run BeanShell in two separate windows (say, W1 and W2),
a) runShellDemo.bat (this will open a BeanShell window each)

b) In the BeanShell window W1, do "sourceRelative("aop.bsh");". 
You can examine aop.bsh and play around with example under the 
BeanShell. Remeber to click File/Capture System in/out/err to 
pipe the output to the Console window.

For example, you can do printStatus("Modified state", pm); to output
the contents of PropagationManager

c) In window W2, do "sourceRelative("aop2.bsh");. This will
retrieve pm on W2.

You can use printStatus("N2", pm); to print the replicated contents.

You can also do 
pm.stateChange("Japan.Tokyo.RainSensor1", 1002, 1041);
on W2 window, and then do printStatus on W1 again to notice that the
state on Tokyo.RainSensor1.power supply has state changed from 1040
to 1041!

Finally, you can also do
  pm.addNode("Japan.Tokyo", "VibrationSensor1"); 
  pm.addStateItem("Japan.Tokyo.VibrationSensor1", 1004, 
    "power supply", 1040); // power supply
to add a new node and notice that W1 has been updated as well!

