예제 #1
0
 private boolean viewContains(View view, JChannel... channels) {
   boolean b = true;
   for (JChannel ch : channels) {
     b = b && view.containsMember(ch.getAddress());
   }
   return b;
 }
예제 #2
0
  private static void createPartitions(JChannel... channels) throws Exception {
    for (JChannel ch : channels) {
      DISCARD discard = new DISCARD();
      discard.setDiscardAll(true);
      ch.getProtocolStack().insertProtocol(discard, ProtocolStack.Position.ABOVE, TP.class);
    }

    for (JChannel ch : channels) {
      View view = View.create(ch.getAddress(), 10, ch.getAddress());
      GMS gms = (GMS) ch.getProtocolStack().findProtocol(GMS.class);
      gms.installView(view);
    }
  }