Class AdvertiseListenerImpl
java.lang.Object
org.jboss.modcluster.advertise.impl.AdvertiseListenerImpl
- All Implemented Interfaces:
AutoCloseable,AdvertiseListener
Listens for advertise messages sent by mod_cluster reverse proxy.
- Author:
- Mladen Turk, Radoslav Husar
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAdvertiseListenerImpl(MCMPHandler commHandler, AdvertiseConfiguration config, DatagramChannelFactory channelFactory) Constructors a new AdvertiseListenerImpl -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearBuffer(Buffer buffer) JDK-compatible clear operating onBufferinstead ofByteBuffer.voidclose()Stops the advertise listener.static voidflipBuffer(Buffer buffer) JDK-compatible flip operating onBufferinstead ofByteBuffer.Get AdvertiseServer server.booleanReturnstrueif listener is accepting the advertise messages; false if the listener was stopped or is experiencing network problems.
-
Field Details
-
DEFAULT_ENCODING
- See Also:
-
RFC_822_FMT
- See Also:
-
-
Constructor Details
-
AdvertiseListenerImpl
public AdvertiseListenerImpl(MCMPHandler commHandler, AdvertiseConfiguration config, DatagramChannelFactory channelFactory) throws IOException Constructors a new AdvertiseListenerImpl- Parameters:
commHandler- event handler that will be used for status and new server notificationsconfig- advertise configurationchannelFactory- a multicast channel factory- Throws:
IOException
-
-
Method Details
-
getServer
Get AdvertiseServer server.- Parameters:
name- Server name to get.
-
close
Stops the advertise listener.- Specified by:
closein interfaceAdvertiseListener- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- If an I/O error occurs while closing the underlying channel.- See Also:
-
isListening
public boolean isListening()Description copied from interface:AdvertiseListenerReturnstrueif listener is accepting the advertise messages; false if the listener was stopped or is experiencing network problems.- Specified by:
isListeningin interfaceAdvertiseListener
-
flipBuffer
JDK-compatible flip operating onBufferinstead ofByteBuffer. See MODCLUSTER-743.- Parameters:
buffer- a buffer to flip
-
clearBuffer
JDK-compatible clear operating onBufferinstead ofByteBuffer. See MODCLUSTER-743.- Parameters:
buffer- a buffer to clear
-