fulmine.distribution.connection.tcp
Class TcpConnectionDiscoverer
java.lang.Object
fulmine.AbstractLifeCycle
fulmine.distribution.connection.AbstractConnectionDiscoverer
fulmine.distribution.connection.tcp.TcpConnectionDiscoverer
- All Implemented Interfaces:
- IConnectionDiscoverer, IHeartbeatMonitor, IDestroyable, ILifeCycle
public final class TcpConnectionDiscoverer
- extends AbstractConnectionDiscoverer
- implements IConnectionDiscoverer
A discoverer for remote contexts that use TCP/IP.
- Author:
- Ramon Servadei
| Fields inherited from class fulmine.distribution.connection.AbstractConnectionDiscoverer |
DEFAULT_DUPLICATE_PING_WINDOW, DEFAULT_UDP_DISCOVERY_NETWORK, DEFAULT_UDP_DISCOVERY_PORT, description, heartbeatGenerator, heartbeatGeneratorThread, heartbeatListener, heartbeatListenerThread, heartbeatProcessor, heartbeatProcessorThread, network, NETWORK_INTERFACE_NAME, pulse, socket, UDP_DISCOVERY_NETWORK, UDP_DISCOVERY_PORT |
| Methods inherited from class fulmine.distribution.connection.AbstractConnectionDiscoverer |
connectionDestroyed, disablePulsing, doDestroy, enablePulsing, getAllowableNetworkHeartbeatMissCount, getNetwork, getNetworkHeartbeatPeriod, getPort, getPulse, getSocket, isPulseFromContext, isPulsingEnabled, pulse, send, setAllowableNetworkHeartbeatMissCount, setNetworkHeartbeatPeriod, toString |
TcpConnectionDiscoverer
public TcpConnectionDiscoverer(IFrameworkContext context,
String hostAddress,
int tcpPort,
String udpNetwork,
int udpPort,
String udpNic)
- Constructs the discoverer with specific UDP binding parameters and
extracts the TCP connection details from the broker
- Parameters:
context - the local contexthostAddress - the host for the TCP connection the context exposestcpPort - the TCP port for the connection the context exposesudpNetwork - the UDP network for discovery operationsudpPort - the UDP port for discovery operationsudpNic - the network interface card name to bind to, null
for default
getLog
protected AsyncLog getLog()
- Description copied from class:
AbstractLifeCycle
- Get the log to use for the object hierarchy
- Overrides:
getLog in class AbstractConnectionDiscoverer
- Returns:
- the log to use for the object hierarchy
doStart
protected final void doStart()
- Description copied from class:
AbstractLifeCycle
- Overridden in subclasses to perform custom logic on activation. Any
exceptions should be thrown as a
RuntimeException or subclass
thereof. When this method is called, the AbstractLifeCycle.isActive() method will
return true.
- Overrides:
doStart in class AbstractConnectionDiscoverer
getConnectionParameters
protected IConnectionParameters getConnectionParameters(String data)
- Description copied from class:
AbstractConnectionDiscoverer
- Template method for sub-classes to provide the implementation of how to
handle the 'pulse' message received from a peer
IConnectionDiscoverer. This method inspects the data string and
creates an appropriate IConnectionParameters instance
representing it.
- Specified by:
getConnectionParameters in class AbstractConnectionDiscoverer
- Parameters:
data - the pulse message from a peer IConnectionDiscoverer
- Returns:
- the
IConnectionParameters extracted from the pulse
message or null if the message could not be
deciphered.
getProtocolConnectionParameters
protected String getProtocolConnectionParameters()
- Description copied from class:
AbstractConnectionDiscoverer
- Overridden by subclasses to provide the protocol specific parameters for
connecting to the connection broker of this context. The parameters must
be delimited using
ProtocolMessageConstants.DELIMITER. There is
no need to prepend the delimiter.
- Specified by:
getProtocolConnectionParameters in class AbstractConnectionDiscoverer
- Returns:
- a string of parameters for the connection protocol of the
connection broker, delimited using
ProtocolMessageConstants.DELIMITER
Copyright © 2007-2009. All Rights Reserved.