@GridSpiMultipleInstancesSupport(value=true) @GridSpiConsistencyChecked(optional=false) public class GridTcpCommunicationSpi extends GridSpiAdapter implements GridCommunicationSpi<GridTcpCommunicationMessageAdapter>, GridTcpCommunicationSpiMBean
To enable communication with other nodes, this SPI adds ATTR_ADDRS
and ATTR_PORT local node attributes (see GridNode.attributes().
At startup, this SPI tries to start listening to local port specified by
setLocalPort(int) method. If local port is occupied, then SPI will
automatically increment the port number until it can successfully bind for
listening. setLocalPortRange(int) configuration parameter controls
maximum number of ports that SPI will try before it fails. Port range comes
very handy when starting multiple grid nodes on the same machine or even
in the same VM. In this case all nodes can be brought up without a single
change in configuration.
This SPI caches connections to remote nodes so it does not have to reconnect every
time a message is sent. By default, idle connections are kept active for
DFLT_IDLE_CONN_TIMEOUT period and then are closed. Use
setIdleConnectionTimeout(long) configuration parameter to configure
you own idle connection timeout.
setLocalAddress(String))setLocalPort(int))setLocalPortRange(int)setConnectionBufferFlushFrequency(long))setConnectionBufferSize(int))setIdleConnectionTimeout(long))setDirectBuffer(boolean))setDirectSendBuffer(boolean))setSelectorsCount(int))TCP_NODELAY socket option for sockets (see setTcpNoDelay(boolean))setAsyncSend(boolean))setMessageQueueLimit(int))setDualSocketConnection(boolean))setMinimumBufferedMessageCount(int))setBufferSizeRatio(double))setConnectTimeout(long))setMaxConnectTimeout(long))setReconnectCount(int))setSharedMemoryPort(int))setSocketReceiveBuffer(int))setSocketSendBuffer(int))GridTcpCommunicationSpi commSpi = new GridTcpCommunicationSpi(); // Override local port. commSpi.setLocalPort(4321); GridConfiguration cfg = new GridConfiguration(); // Override default communication SPI. cfg.setCommunicationSpi(commSpi); // Start grid. GridGain.start(cfg);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfiguration" singleton="true">
...
<property name="communicationSpi">
<bean class="org.gridgain.grid.spi.communication.tcp.GridTcpCommunicationSpi">
<!-- Override local port. -->
<property name="localPort" value="4321"/>
</bean>
</property>
...
</bean>
For information about Spring framework visit www.springframework.org
GridCommunicationSpi| Modifier and Type | Class and Description |
|---|---|
static class |
GridTcpCommunicationSpi.NodeIdMessage
Node ID message.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_ADDRS
Node attribute that is mapped to node IP addresses (value is comm.tcp.addrs).
|
static String |
ATTR_EXT_ADDRS
Node attribute that is mapped to node's external addresses (value is comm.tcp.ext-addrs).
|
static String |
ATTR_HOST_NAMES
Node attribute that is mapped to node host names (value is comm.tcp.host.names).
|
static String |
ATTR_PORT
Node attribute that is mapped to node port number (value is comm.tcp.port).
|
static String |
ATTR_SHMEM_PORT
Node attribute that is mapped to node port number (value is comm.shmem.tcp.port).
|
static long |
DFLT_CONN_BUF_FLUSH_FREQ
Default value for connection buffer flush frequency (value is 100 ms).
|
static int |
DFLT_CONN_BUF_SIZE
Default value for connection buffer size (value is 0).
|
static long |
DFLT_CONN_TIMEOUT
Default connection timeout (value is 1000ms).
|
static boolean |
DFLT_DUAL_SOCKET_CONNECTION
Default value for dualSocketConnection flag.
|
static long |
DFLT_IDLE_CONN_TIMEOUT
Default idle connection timeout (value is 30000ms).
|
static long |
DFLT_MAX_CONN_TIMEOUT
Default Maximum connection timeout (value is 600,000ms).
|
static int |
DFLT_MSG_QUEUE_LIMIT
Default message queue limit per connection (for incoming and outgoing .
|
static int |
DFLT_PORT
Default port which node sets listener to (value is 47100).
|
static int |
DFLT_PORT_RANGE
Default local port range (value is 100).
|
static int |
DFLT_RECONNECT_CNT
Default reconnect attempts count (value is 10).
|
static int |
DFLT_SELECTORS_CNT
Default count of selectors for TCP server equals to
"Math.min(4, Runtime.getRuntime().availableProcessors())". |
static int |
DFLT_SHMEM_PORT
Default port which node sets listener for shared memory connections (value is 48100).
|
static int |
DFLT_SOCK_BUF_SIZE
Default socket send and receive buffer size.
|
static boolean |
DFLT_TCP_NODELAY
Default value for
TCP_NODELAY socket option (value is true). |
static byte |
NODE_ID_MSG_TYPE
Node ID message type.
|
static String |
OUT_OF_RESOURCES_TCP_MSG
IPC error message.
|
| Constructor and Description |
|---|
GridTcpCommunicationSpi() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkConfigurationConsistency0(GridSpiContext spiCtx,
GridNode node,
boolean starting)
Method which is called in the end of checkConfigurationConsistency() method.
|
protected GridCommunicationClient |
createNioClient(GridNode node) |
protected GridCommunicationClient |
createShmemClient(GridNode node,
Integer port) |
protected GridCommunicationClient |
createTcpClient(GridNode node)
Establish TCP connection to remote node and returns client.
|
GridAddressResolver |
getAddressResolver()
Gets address resolver.
|
double |
getBufferSizeRatio()
Gets the buffer size ratio for this SPI.
|
long |
getConnectionBufferFlushFrequency()
Gets connection buffer flush frequency.
|
int |
getConnectionBufferSize()
Gets connection buffer size.
|
long |
getConnectTimeout()
Gets connect timeout used when establishing connection
with remote nodes.
|
long |
getIdleConnectionTimeout()
Gets maximum idle connection time upon which idle connections
will be closed.
|
GridCommunicationListener |
getListener() |
String |
getLocalAddress()
Gets local host address for socket binding.
|
int |
getLocalPort()
Gets local port for socket binding.
|
int |
getLocalPortRange()
Gets maximum number of local ports tried if all previously
tried ports are occupied.
|
long |
getMaxConnectTimeout()
Gets maximum connect timeout.
|
int |
getMessageQueueLimit()
Gets message queue limit for incoming and outgoing messages.
|
int |
getMinimumBufferedMessageCount()
Gets the minimum number of messages for this SPI, that are buffered
prior to sending.
|
Map<String,Object> |
getNodeAttributes()
This method is called before SPI starts (before method
GridSpi.spiStart(String)
is called). |
int |
getOutboundMessagesQueueSize()
Gets outbound messages queue size.
|
long |
getReceivedBytesCount()
Gets received bytes count.
|
int |
getReceivedMessagesCount()
Gets received messages count.
|
int |
getReconnectCount()
Gets maximum number of reconnect attempts used when establishing connection
with remote nodes.
|
int |
getSelectorsCount()
Gets count of selectors used in TCP server.
|
long |
getSentBytesCount()
Gets sent bytes count.
|
int |
getSentMessagesCount()
Gets sent messages count.
|
int |
getSharedMemoryPort()
Gets local port for shared memory communication.
|
int |
getSocketReceiveBuffer()
Gets receive buffer size for sockets created or accepted by this SPI.
|
int |
getSocketSendBuffer()
Gets send buffer size for sockets created or accepted by this SPI.
|
protected GridSpiContext |
getSpiContext()
Gets SPI context.
|
boolean |
isAsyncSend()
Gets flag defining whether asynchronous (NIO) or synchronous (blocking) IO
should be used to send messages.
|
boolean |
isDirectBuffer()
Gets flag that indicates whether direct or heap allocated buffer is used.
|
boolean |
isDirectSendBuffer()
Gets flag defining whether direct send buffer should be used.
|
boolean |
isDualSocketConnection()
Gets flag indicating whether dual-socket connection between nodes should be enforced.
|
boolean |
isTcpNoDelay()
Gets value for
TCP_NODELAY socket option. |
protected void |
notifyListener(UUID sndId,
GridTcpCommunicationMessageAdapter msg,
GridRunnable msgC) |
protected void |
onContextDestroyed0()
Method to be called in the beginning of onContextDestroyed() method.
|
void |
onContextInitialized0(GridSpiContext spiCtx)
Method to be called in the end of onContextInitialized method.
|
void |
resetMetrics()
Resets metrics for this SPI instance.
|
void |
sendMessage(GridNode node,
GridTcpCommunicationMessageAdapter msg)
Sends given message to destination node.
|
void |
setAddressResolver(GridAddressResolver addrRslvr)
Sets address resolver.
|
void |
setAsyncSend(boolean asyncSnd)
Sets flag defining whether asynchronous (NIO) or synchronous (blocking) IO
should be used to send messages.
|
void |
setBufferSizeRatio(double bufSizeRatio)
Sets the buffer size ratio for this SPI.
|
void |
setConnectionBufferFlushFrequency(long connBufFlushFreq)
Sets connection buffer flush frequency.
|
void |
setConnectionBufferSize(int connBufSize)
Sets connection buffer size.
|
void |
setConnectTimeout(long connTimeout)
Sets connect timeout used when establishing connection
with remote nodes.
|
void |
setDirectBuffer(boolean directBuf)
Sets flag to allocate direct or heap buffer in SPI.
|
void |
setDirectSendBuffer(boolean directSndBuf)
Sets whether to use direct buffer for sending.
|
void |
setDualSocketConnection(boolean dualSockConn)
Sets flag indicating whether dual-socket connection between nodes should be enforced.
|
void |
setIdleConnectionTimeout(long idleConnTimeout)
Sets maximum idle connection timeout upon which a connection
to client will be closed.
|
void |
setListener(GridCommunicationListener<GridTcpCommunicationMessageAdapter> lsnr)
Set communication listener.
|
void |
setLocalAddress(String locAddr)
Sets local host address for socket binding.
|
void |
setLocalPort(int locPort)
Sets local port for socket binding.
|
void |
setLocalPortRange(int locPortRange)
Sets local port range for local host ports (value must greater than or equal to 0).
|
void |
setMaxConnectTimeout(long maxConnTimeout)
Sets maximum connect timeout.
|
void |
setMessageQueueLimit(int msgQueueLimit)
Sets message queue limit for incoming and outgoing messages.
|
void |
setMinimumBufferedMessageCount(int minBufferedMsgCnt)
Sets the minimum number of messages for this SPI, that are buffered
prior to sending.
|
void |
setReconnectCount(int reconCnt)
Sets maximum number of reconnect attempts used when establishing connection
with remote nodes.
|
void |
setSelectorsCount(int selectorsCnt)
Sets the count of selectors te be used in TCP server.
|
void |
setSharedMemoryPort(int shmemPort)
Sets local port to accept shared memory connections.
|
void |
setSocketReceiveBuffer(int sockRcvBuf)
Sets receive buffer size for sockets created or accepted by this SPI.
|
void |
setSocketSendBuffer(int sockSndBuf)
Sets send buffer size for sockets created or accepted by this SPI.
|
void |
setTcpNoDelay(boolean tcpNoDelay)
Sets value for
TCP_NODELAY socket option. |
void |
spiStart(String gridName)
This method is called to start SPI.
|
void |
spiStop()
This method is called to stop SPI.
|
String |
toString() |
assertParameter, configInfo, createSpiAttributeName, getConsistentAttributeNames, getGridGainHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, injectables, onContextDestroyed, onContextInitialized, registerMBean, setName, startInfo, startStopwatch, stopInfo, unregisterMBeanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, onContextDestroyed, onContextInitializedgetGridGainHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormattedpublic static final String OUT_OF_RESOURCES_TCP_MSG
public static final String ATTR_ADDRS
public static final String ATTR_HOST_NAMES
public static final String ATTR_PORT
public static final String ATTR_SHMEM_PORT
public static final String ATTR_EXT_ADDRS
public static final int DFLT_PORT
public static final int DFLT_SHMEM_PORT
public static final long DFLT_IDLE_CONN_TIMEOUT
public static final long DFLT_CONN_BUF_FLUSH_FREQ
public static final int DFLT_CONN_BUF_SIZE
public static final int DFLT_SOCK_BUF_SIZE
public static final long DFLT_CONN_TIMEOUT
public static final long DFLT_MAX_CONN_TIMEOUT
public static final int DFLT_RECONNECT_CNT
public static final int DFLT_MSG_QUEUE_LIMIT
public static final boolean DFLT_DUAL_SOCKET_CONNECTION
public static final int DFLT_SELECTORS_CNT
"Math.min(4, Runtime.getRuntime().availableProcessors())".public static final int DFLT_PORT_RANGE
setLocalPortRange(int) for details.public static final boolean DFLT_TCP_NODELAY
TCP_NODELAY socket option (value is true).public static final byte NODE_ID_MSG_TYPE
@GridSpiConfiguration(optional=true) @GridAddressResolverResource public void setAddressResolver(GridAddressResolver addrRslvr)
addrRslvr - Address resolver.public GridAddressResolver getAddressResolver()
@GridSpiConfiguration(optional=true) @GridLocalHostResource public void setLocalAddress(String locAddr)
locAddr - IP address. Default value is any available local
IP address.public String getLocalAddress()
getLocalAddress in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setLocalPort(int locPort)
If not provided, default value is DFLT_PORT.
locPort - Port number.public int getLocalPort()
getLocalPort in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setLocalPortRange(int locPortRange)
setLocalPort(int)} is occupied,
implementation will try to increment the port number for as long as it is less than
initial value plus this range.
If port range value is 0, then implementation will try bind only to the port provided by
setLocalPort(int) method and fail if binding to this port did not succeed.
Local port range is very useful during development when more than one grid nodes need to run on the same physical machine.
If not provided, default value is DFLT_PORT_RANGE.
locPortRange - New local port range.public int getLocalPortRange()
getLocalPortRange in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setSharedMemoryPort(int shmemPort)
If set to -1 shared memory communication will be disabled.
If not provided, default value is DFLT_SHMEM_PORT.
shmemPort - Port number.public int getSharedMemoryPort()
getSharedMemoryPort in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setIdleConnectionTimeout(long idleConnTimeout)
If not provided, default value is DFLT_IDLE_CONN_TIMEOUT.
idleConnTimeout - Maximum idle connection time.public long getIdleConnectionTimeout()
getIdleConnectionTimeout in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setConnectionBufferSize(int connBufSize)
0 connection buffer is disabled.
If not provided, default value is DFLT_CONN_BUF_SIZE.
connBufSize - Connection buffer size.setConnectionBufferFlushFrequency(long)public int getConnectionBufferSize()
If set to 0 connection buffer is disabled.
getConnectionBufferSize in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setConnectionBufferFlushFrequency(long connBufFlushFreq)
Client connections to other nodes in topology use buffered output. This frequency defines how often system will advice to flush connection buffer.
If not provided, default value is DFLT_CONN_BUF_FLUSH_FREQ.
This property is used only if GridTcpCommunicationSpiMBean.getConnectionBufferSize() is greater than 0.
setConnectionBufferFlushFrequency in interface GridTcpCommunicationSpiMBeanconnBufFlushFreq - Flush frequency.GridTcpCommunicationSpiMBean.getConnectionBufferSize()public long getConnectionBufferFlushFrequency()
Client connections to other nodes in topology use buffered output. This frequency defines how often system will advice to flush connection buffer.
getConnectionBufferFlushFrequency in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setConnectTimeout(long connTimeout)
0 is interpreted as infinite timeout.
If not provided, default value is DFLT_CONN_TIMEOUT.
connTimeout - Connect timeout.public long getConnectTimeout()
getConnectTimeout in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setMaxConnectTimeout(long maxConnTimeout)
0 is interpreted as infinite timeout.
If not provided, default value is DFLT_MAX_CONN_TIMEOUT.
maxConnTimeout - Maximum connect timeout.public long getMaxConnectTimeout()
getMaxConnectTimeout in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setReconnectCount(int reconCnt)
If not provided, default value is DFLT_RECONNECT_CNT.
reconCnt - Maximum number of reconnection attempts.public int getReconnectCount()
getReconnectCount in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setDirectBuffer(boolean directBuf)
true, then SPI will use ByteBuffer.allocateDirect(int) call.
Otherwise, SPI will use ByteBuffer.allocate(int) call.
If not provided, default value is true.
directBuf - Flag indicates to allocate direct or heap buffer in SPI.public boolean isDirectBuffer()
isDirectBuffer in interface GridTcpCommunicationSpiMBeanpublic boolean isDirectSendBuffer()
isDirectSendBuffer in interface GridTcpCommunicationSpiMBeanTrue if direct buffers should be used.@GridSpiConfiguration(optional=true) public void setDirectSendBuffer(boolean directSndBuf)
If not provided default is false.
directSndBuf - True to use direct buffers for send.@GridSpiConfiguration(optional=true) public void setSelectorsCount(int selectorsCnt)
DFLT_SELECTORS_CNT.selectorsCnt - Selectors count.public int getSelectorsCount()
getSelectorsCount in interface GridTcpCommunicationSpiMBeanpublic boolean isAsyncSend()
isAsyncSend in interface GridTcpCommunicationSpiMBeanTrue if asynchronous IO should be used to send messages.@GridSpiConfiguration(optional=true) public void setAsyncSend(boolean asyncSnd)
If not provided, default value is true.
asyncSnd - True if asynchronous IO should be used to send messages.@GridSpiConfiguration(optional=true) public void setTcpNoDelay(boolean tcpNoDelay)
TCP_NODELAY socket option. Each
socket will be opened using provided value.
Setting this option to true disables Nagle's algorithm
for socket decreasing latency and delivery time for small messages.
For systems that work under heavy network load it is advisable to
set this value to false.
If not provided, default value is DFLT_TCP_NODELAY.
tcpNoDelay - True to disable TCP delay.public boolean isTcpNoDelay()
TCP_NODELAY socket option.isTcpNoDelay in interface GridTcpCommunicationSpiMBeanTrue if TCP delay is disabled.@GridSpiConfiguration(optional=true) public void setSocketReceiveBuffer(int sockRcvBuf)
If not provided, default is DFLT_SOCK_BUF_SIZE.
sockRcvBuf - Socket receive buffer size.public int getSocketReceiveBuffer()
If not provided, default is DFLT_SOCK_BUF_SIZE.
getSocketReceiveBuffer in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setSocketSendBuffer(int sockSndBuf)
If not provided, default is DFLT_SOCK_BUF_SIZE.
sockSndBuf - Socket send buffer size.public int getSocketSendBuffer()
If not provided, default is DFLT_SOCK_BUF_SIZE.
getSocketSendBuffer in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setDualSocketConnection(boolean dualSockConn)
true, two separate connections will be established between communicating nodes: one for outgoing
messages, and one for incoming. When set to false, single TCP connection will be used
for both directions.
This flag is useful on some operating systems, when TCP_NODELAY flag is disabled and
messages take too long to get delivered.
If not provided, default is false.
dualSockConn - Whether dual-socket connection should be enforced.public boolean isDualSocketConnection()
true, two separate connections will be established between communicating nodes: one for outgoing
messages, and one for incoming. When set to false, single TCP connection will be used
for both directions.
This flag is useful on some operating systems, when TCP_NODELAY flag is disabled and
messages take too long to get delivered.
isDualSocketConnection in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setMessageQueueLimit(int msgQueueLimit)
This parameter only used when isAsyncSend() set to true.
When set to positive number send queue is limited to the configured value.
0 disables the size limitations.
If not provided, default is DFLT_MSG_QUEUE_LIMIT.
msgQueueLimit - Send queue size limit.public int getMessageQueueLimit()
This parameter only used when GridTcpCommunicationSpiMBean.isAsyncSend() set to true.
getMessageQueueLimit in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setMinimumBufferedMessageCount(int minBufferedMsgCnt)
Defaults to either 512 or GridSystemProperties.GG_MIN_BUFFERED_COMMUNICATION_MSG_CNT
system property (if specified).
minBufferedMsgCnt - Minimum buffered message count.public int getMinimumBufferedMessageCount()
getMinimumBufferedMessageCount in interface GridTcpCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setBufferSizeRatio(double bufSizeRatio)
Defaults to either 0.8 or GridSystemProperties.GG_COMMUNICATION_BUF_RESIZE_RATIO
system property (if specified).
bufSizeRatio - Buffer size ratio.public double getBufferSizeRatio()
getBufferSizeRatio in interface GridTcpCommunicationSpiMBeanpublic void setListener(GridCommunicationListener<GridTcpCommunicationMessageAdapter> lsnr)
setListener in interface GridCommunicationSpi<GridTcpCommunicationMessageAdapter>lsnr - Listener to set or null to unset the listener.public GridCommunicationListener getListener()
public int getSentMessagesCount()
getSentMessagesCount in interface GridCommunicationSpi<GridTcpCommunicationMessageAdapter>getSentMessagesCount in interface GridTcpCommunicationSpiMBeanpublic long getSentBytesCount()
getSentBytesCount in interface GridCommunicationSpi<GridTcpCommunicationMessageAdapter>getSentBytesCount in interface GridTcpCommunicationSpiMBeanpublic int getReceivedMessagesCount()
getReceivedMessagesCount in interface GridCommunicationSpi<GridTcpCommunicationMessageAdapter>getReceivedMessagesCount in interface GridTcpCommunicationSpiMBeanpublic long getReceivedBytesCount()
getReceivedBytesCount in interface GridCommunicationSpi<GridTcpCommunicationMessageAdapter>getReceivedBytesCount in interface GridTcpCommunicationSpiMBeanpublic int getOutboundMessagesQueueSize()
getOutboundMessagesQueueSize in interface GridCommunicationSpi<GridTcpCommunicationMessageAdapter>getOutboundMessagesQueueSize in interface GridTcpCommunicationSpiMBeanpublic void resetMetrics()
resetMetrics in interface GridCommunicationSpi<GridTcpCommunicationMessageAdapter>public Map<String,Object> getNodeAttributes() throws GridSpiException
GridSpi.spiStart(String)
is called). It allows SPI implementation to add attributes to a local
node. Kernal collects these attributes from all SPI implementations
loaded up and then passes it to discovery SPI so that they can be
exchanged with other nodes.getNodeAttributes in interface GridSpigetNodeAttributes in class GridSpiAdapterGridSpiException - Throws in case of any error.public void spiStart(String gridName) throws GridSpiException
spiStart in interface GridSpigridName - Name of grid instance this SPI is being started for
(null for default grid).GridSpiException - Throws in case of any error during SPI start.public void onContextInitialized0(GridSpiContext spiCtx) throws GridSpiException
onContextInitialized0 in class GridSpiAdapterspiCtx - SPI context.GridSpiException - In case of errors.protected GridSpiContext getSpiContext()
getSpiContext in class GridSpiAdapterpublic void spiStop()
throws GridSpiException
Note that this method can be called at any point including during recovery of failed start. It should make no assumptions on what state SPI will be in when this method is called.
spiStop in interface GridSpiGridSpiException - Thrown in case of any error during SPI stop.protected void onContextDestroyed0()
onContextDestroyed0 in class GridSpiAdapterprotected void checkConfigurationConsistency0(GridSpiContext spiCtx, GridNode node, boolean starting) throws GridSpiException
checkConfigurationConsistency0 in class GridSpiAdapterspiCtx - SPI context.node - Remote node.starting - If this node is starting or not.GridSpiException - in case of errors.public void sendMessage(GridNode node, GridTcpCommunicationMessageAdapter msg) throws GridSpiException
sendMessage in interface GridCommunicationSpi<GridTcpCommunicationMessageAdapter>node - Destination node.msg - Message to send.GridSpiException - Thrown in case of any error during sending the message.
Note that this is not guaranteed that failed communication will result
in thrown exception as this is dependant on SPI implementation.@Nullable protected GridCommunicationClient createNioClient(GridNode node) throws GridException
node - Node to create client for.GridException - If failed.@Nullable protected GridCommunicationClient createShmemClient(GridNode node, Integer port) throws GridException
node - Node.port - Port.GridException - If failed.protected GridCommunicationClient createTcpClient(GridNode node) throws GridException
node - Remote node.GridException - If failed.protected void notifyListener(UUID sndId, GridTcpCommunicationMessageAdapter msg, GridRunnable msgC)
sndId - Sender ID.msg - Communication message.msgC - Closure to call when message processing finished.Copyright © 2014. All rights reserved.