/** * This sends a message broadcasting our that the host and port is no longer available. * <p> * It uses the vmid as the requesterID * <p> * @param host host * @param port port * @param cacheNames names of the cache regions * @throws IOException on error */ public void removeBroadcast( String host, int port, ArrayList<String> cacheNames ) throws IOException { removeBroadcast( host, port, cacheNames, CacheInfo.listenerId ); }
/** * This sends a message broadcasting our that the host and port is no longer available. * <p> * It uses the vmid as the requesterID * <p> * @param host host * @param port port * @param cacheNames names of the cache regions * @throws IOException on error */ public void removeBroadcast( String host, int port, ArrayList<String> cacheNames ) throws IOException { removeBroadcast( host, port, cacheNames, CacheInfo.listenerId ); }
sender.removeBroadcast( attributes.getServiceAddress(), attributes.getServicePort(), cacheNames );
sender.removeBroadcast( attributes.getServiceAddress(), attributes.getServicePort(), cacheNames );
/** * Test sending a remove broadcast. * <p> * @throws Exception on error */ public void testRemoveBroadcast() throws Exception { // SETUP ArrayList<String> cacheNames = new ArrayList<String>(); // DO WORK sender.removeBroadcast( SENDING_HOST, SENDING_PORT, cacheNames, 1L ); // VERIFY // grab the sent message Object obj = receiver.waitForMessage(); assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; // disabled test because of JCS-89 // assertEquals( "wrong host", SENDING_HOST, msg.getHost() ); assertEquals( "wrong port", SENDING_PORT, msg.getPort() ); assertEquals( "wrong message type", BroadcastType.REMOVE, msg.getMessageType() ); }
/** * Test sending a remove broadcast. * <p> * @throws Exception on error */ public void testRemoveBroadcast() throws Exception { // SETUP ArrayList<String> cacheNames = new ArrayList<String>(); // DO WORK sender.removeBroadcast( SENDING_HOST, SENDING_PORT, cacheNames, 1L ); // VERIFY // grab the sent message Object obj = receiver.waitForMessage(); assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; // disabled test because of JCS-89 // assertEquals( "wrong host", SENDING_HOST, msg.getHost() ); assertEquals( "wrong port", SENDING_PORT, msg.getPort() ); assertEquals( "wrong message type", BroadcastType.REMOVE, msg.getMessageType() ); }