Пример #1
0
 @Override
 public void channelConnected(Channel channel) {
   // Validate view
   String localName = channel.getName();
   Address localAddress = channel.getAddress();
   for (Address address : channel.getView()) {
     String name = channel.getName(address);
     if ((name != null) && name.equals(localName) && !address.equals(localAddress)) {
       channel.close();
       throw JGroupsLogger.ROOT_LOGGER.duplicateNodeName(
           this.factory.getValue().getProtocolStackConfiguration().getEnvironment().getNodeName());
     }
   }
 }
Пример #2
0
 public int foo() {
   System.out.println("<< foo method invoked on " + ch.getName());
   return i;
 }