/** * Adds a region to the list that is participating in discovery. * <p> * @param cacheName */ public void addParticipatingCacheName( String cacheName ) { cacheNames.add( cacheName ); sender.setCacheNames( getCacheNames() ); }
sender = new UDPDiscoverySenderThread( getUdpDiscoveryAttributes(), getCacheNames() );
/** * @param attributes */ public UDPDiscoveryService( UDPDiscoveryAttributes attributes) { udpDiscoveryAttributes = (UDPDiscoveryAttributes) attributes.clone(); try { // todo, you should be able to set this udpDiscoveryAttributes.setServiceAddress( HostNameUtil.getLocalHostAddress() ); } catch ( UnknownHostException e ) { log.error( "Couldn't get localhost address", e ); } try { // todo need some kind of recovery here. receiver = new UDPDiscoveryReceiver( this, getUdpDiscoveryAttributes().getUdpDiscoveryAddr(), getUdpDiscoveryAttributes().getUdpDiscoveryPort() ); } catch ( IOException e ) { log.error( "Problem creating UDPDiscoveryReceiver, address [" + getUdpDiscoveryAttributes().getUdpDiscoveryAddr() + "] port [" + getUdpDiscoveryAttributes().getUdpDiscoveryPort() + "] we won't be able to find any other caches", e ); } // create a sender thread sender = new UDPDiscoverySenderThread( getUdpDiscoveryAttributes(), getCacheNames() ); }
/** * Adds a region to the list that is participating in discovery. * <p> * @param cacheName */ public void addParticipatingCacheName( String cacheName ) { cacheNames.add( cacheName ); sender.setCacheNames( getCacheNames() ); }