public class AdvertiseListenerImpl extends Object implements AdvertiseListener
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ENCODING |
static String |
RFC_822_FMT |
Constructor and Description |
---|
AdvertiseListenerImpl(MCMPHandler commHandler,
AdvertiseConfiguration config,
MulticastSocketFactory socketFactory)
Constructors a new AdvertiseListenerImpl
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Deallocate listener and close sockets.
|
AdvertisedServer |
getServer(String name)
Get AdvertiseServer server.
|
Collection<AdvertisedServer> |
getServers()
Get Collection of all AdvertisedServer instances.
|
void |
interruptDatagramReader() |
boolean |
isListening()
True if listener is accepting the advetise messages.
If false it means that listener is experiencing some network problems if running. |
void |
pause()
Pause the listener, which will make it stop accepting new advertise messages.
|
void |
removeServer(AdvertisedServer server)
Remove the AdvertisedServer from the collection.
|
void |
resume()
Resume the listener, which will make it start accepting new advertise messages again.
|
void |
start()
Start the Listener, creating listener thread.
|
void |
stop()
Stop the endpoint.
|
public static final String DEFAULT_ENCODING
public static final String RFC_822_FMT
public AdvertiseListenerImpl(MCMPHandler commHandler, AdvertiseConfiguration config, MulticastSocketFactory socketFactory) throws IOException
commHandler
- The event handler that will be used for status and new server notifications.config
- our configurationsocketFactory
- a multicast socket factoryIOException
public Collection<AdvertisedServer> getServers()
public AdvertisedServer getServer(String name)
name
- Server name to get.public void removeServer(AdvertisedServer server)
server
- Server to remove.public void start() throws IOException
AdvertiseListener
start
in interface AdvertiseListener
IOException
public void pause()
AdvertiseListener
pause
in interface AdvertiseListener
public void resume()
AdvertiseListener
resume
in interface AdvertiseListener
public void interruptDatagramReader()
public void stop()
AdvertiseListener
stop
in interface AdvertiseListener
public void destroy()
AdvertiseListener
destroy
in interface AdvertiseListener
public boolean isListening()
Copyright © 2023 JBoss by Red Hat. All rights reserved.