MapDemopublic class MapDemo extends Object implements org.apache.catalina.tribes.ChannelListener, org.apache.catalina.tribes.MembershipListenerTitle:
Description:
Company: |
Fields Summary |
---|
protected org.apache.catalina.tribes.tipis.LazyReplicatedMap | map | protected SimpleTableDemo | table |
Constructors Summary |
---|
public MapDemo(org.apache.catalina.tribes.Channel channel, String mapName)
map = new LazyReplicatedMap(null,channel,5000, mapName,null);
table = SimpleTableDemo.createAndShowGUI(map,channel.getLocalMember(false).getName());
channel.addChannelListener(this);
channel.addMembershipListener(this);
// for ( int i=0; i<1000; i++ ) {
// map.put("MyKey-"+i,"My String Value-"+i);
// }
this.messageReceived(null,null);
|
Methods Summary |
---|
public boolean | accept(java.io.Serializable msg, org.apache.catalina.tribes.Member source)
table.dataModel.getValueAt(-1,-1);
return false;
| public static void | main(java.lang.String[] args)
long start = System.currentTimeMillis();
ManagedChannel channel = (ManagedChannel) ChannelCreator.createChannel(args);
String mapName = "MapDemo";
if ( args.length > 0 && (!args[args.length-1].startsWith("-"))) {
mapName = args[args.length-1];
}
channel.start(channel.DEFAULT);
Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
MapDemo demo = new MapDemo(channel,mapName);
System.out.println("System test complete, time to start="+(System.currentTimeMillis()-start)+" ms. Sleeping to let threads finish.");
Thread.sleep(60 * 1000 * 60);
| public void | memberAdded(org.apache.catalina.tribes.Member member)
| public void | memberDisappeared(org.apache.catalina.tribes.Member member)
table.dataModel.getValueAt(-1,-1);
| public void | messageReceived(java.io.Serializable msg, org.apache.catalina.tribes.Member source)
| public static void | usage()
System.out.println("Tribes MapDemo.");
System.out.println("Usage:\n\t" +
"java MapDemo [channel options] mapName\n\t" +
"\tChannel options:" +
ChannelCreator.usage());
|
|