|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridgain.grid.spi.GridSpiAdapter
org.gridgain.grid.spi.communication.jgroups.GridJgroupsCommunicationSpi
@GridSpiInfo(author="GridGain Systems",
url="www.gridgain.org",
email="support@gridgain.com",
version="x.x")
@GridSpiMultipleInstancesSupport(value=true)
public class GridJgroupsCommunicationSpi
JGroups implementation of GridCommunicationSpi SPI. It uses JGroups
to communicate with one or more other nodes.
This SPI has no mandatory parameters.
GridJgroupsCommunicationSpi.setConfigurationFile(String),
GridJgroupsCommunicationSpi.setConfigurationUrl(URL)).GridJgroupsCommunicationSpi.setSendTimeout(long)).
GridJgroupsCommunicationSpi.setGroupName(String)).GridJgroupsCommunicationSpi.setStackName(String)).
GridJgroupsCommunicationSpi commSpi = new GridJgroupsCommunicationSpi();
// Override default JGroups configuration file.
commSpi.setConfigurationFile("/my/config/path/jgroups.xml");
GridConfigurationAdapter cfg = new GridConfigurationAdapter();
// Override default communication SPI.
cfg.setCommunicationSpi(commSpi);
// Start grid.
GridFactory.start(cfg);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
...
<property name="communicationSpi">
<bean class="org.gridgain.grid.spi.communication.jgroups.GridJgroupsCommunicationSpi">
<property name="configurationFile" value="/my/config/path/jgroups.xml"/>
</bean>
</property>
...
</bean>
For information about Spring framework visit www.springframework.org
See Also:
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.1.0
GridCommunicationSpi
![]() |
![]() |
![]() |
![]() |
| Field Summary | |
|---|---|
static String |
DFLT_CONFIG_FILE
Default JGroups configuration path relative to GridGain installation home folder. |
static String |
DFLT_GRP_NAME
Default JGroups group name (value is grid.comm.jgroups). |
static long |
DFLT_SEND_TIMEOUT
Default timeout for message acknowledgments (value is 10000). |
static String |
DFLT_STACK_NAME
Default JGroups stack name (value is grid.jgroups.stack). |
| Constructor Summary | |
|---|---|
GridJgroupsCommunicationSpi()
|
|
| Method Summary | |
|---|---|
String |
getConfigurationFile()
Gets either absolute or relative to GridGain installation home folder path to JGroups XML configuration file. |
protected List<String> |
getConsistentAttributeNames()
Returns back list of attributes that should be consistent for this SPI. |
String |
getGroupName()
Gets JGroups group name. |
InetAddress |
getLocalAddress()
Gets JGroups channel local IP address. |
int |
getLocalPort()
Gets JGroups channel local port number. |
Map<String,Serializable> |
getNodeAttributes()
This method is called before SPI starts (before method GridSpi.spiStart(String)
is called). It allows SPI implementation to add attributes to a local
node. Kernel 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. |
long |
getSendTimeout()
Gets time limit in milliseconds to wait for message acknowledgements from remote nodes. |
String |
getStackName()
Gets JGroups stack name. |
void |
sendMessage(Collection<GridNode> destNodes,
Serializable msg)
Sends given message to destination nodes. |
void |
sendMessage(GridNode destNode,
Serializable msg)
Sends given message to destination node. |
void |
setConfigurationFile(String cfgFile)
Sets either absolute or relative to GridGain installation home folder path to JGroups XML configuration file. |
void |
setConfigurationUrl(URL cfgUrl)
Sets URL to JGroups XML configuration file. |
void |
setGroupName(String grpName)
Sets JGroups group name. |
void |
setListener(GridMessageListener listener)
Set communication listener. |
void |
setSendTimeout(long sendTimeout)
Sets time limit in milliseconds to wait for message acknowledgements from remote nodes. |
void |
setStackName(String stackName)
Sets JGroups stack name. |
void |
spiStart(String gridName)
This method is called to start SPI. |
void |
spiStop()
This method is called to stop SPI. |
String |
toString()
|
| Methods inherited from class org.gridgain.grid.spi.GridSpiAdapter |
|---|
assertParameter, configInfo, createSpiAttributeName, getAuthor, getGridGainHome, getLocalNodeId, getName, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion, onContextDestroyed, onContextInitialized, registerMBean, setName, setSpiContext, startInfo, startStopwatch, stopInfo, unregisterMBean |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.gridgain.grid.spi.GridSpi |
|---|
getName, onContextDestroyed, onContextInitialized |
| Methods inherited from interface org.gridgain.grid.spi.GridSpiManagementMBean |
|---|
getAuthor, getGridGainHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion |
| Field Detail |
|---|
public static final String DFLT_GRP_NAME
public static final String DFLT_STACK_NAME
public static final String DFLT_CONFIG_FILE
public static final long DFLT_SEND_TIMEOUT
| Constructor Detail |
|---|
public GridJgroupsCommunicationSpi()
| Method Detail |
|---|
@GridSpiConfiguration(optional=true) public void setConfigurationFile(String cfgFile)
If not provided, default value is GridJgroupsCommunicationSpi.DFLT_CONFIG_FILE.
cfgFile - Path to JGroups configuration file.@GridSpiConfiguration(optional=true) public void setConfigurationUrl(URL cfgUrl)
If not provided, default value is GridJgroupsCommunicationSpi.DFLT_CONFIG_FILE.
cfgUrl - URL to JGroups configuration file.public String getConfigurationFile()
getConfigurationFile in interface GridJgroupsCommunicationSpiMBeanpublic InetAddress getLocalAddress()
getLocalAddress in interface GridJgroupsCommunicationSpiMBeanpublic int getLocalPort()
getLocalPort in interface GridJgroupsCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setSendTimeout(long sendTimeout)
If not provided, default value is GridJgroupsCommunicationSpi.DFLT_SEND_TIMEOUT.
sendTimeout - Timeout to wait for responses.public long getSendTimeout()
getSendTimeout in interface GridJgroupsCommunicationSpiMBeanpublic String getGroupName()
getGroupName in interface GridJgroupsCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setGroupName(String grpName)
If not provided, default value is GridJgroupsCommunicationSpi.DFLT_GRP_NAME.
grpName - JGroups group name.public String getStackName()
getStackName in interface GridJgroupsCommunicationSpiMBean@GridSpiConfiguration(optional=true) public void setStackName(String stackName)
If not provided, default value is GridJgroupsCommunicationSpi.DFLT_STACK_NAME.
stackName - JGroups stack name.
public Map<String,Serializable> getNodeAttributes()
throws GridSpiException
GridSpi.spiStart(String)
is called). It allows SPI implementation to add attributes to a local
node. Kernel 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 GridSpiGridSpiException - Throws in case of any error during SPI start.gridName - Name of grid instance this SPI is being started for
(null for default grid).
public void spiStop()
throws GridSpiException
spiStop in interface GridSpiGridSpiException - Thrown in case of any error during SPI stop.
public void sendMessage(GridNode destNode,
Serializable msg)
throws GridSpiException
sendMessage in interface GridCommunicationSpiGridSpiException - 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.destNode - Destination node.msg - Message to send.
public void sendMessage(Collection<GridNode> destNodes,
Serializable msg)
throws GridSpiException
sendMessage in interface GridCommunicationSpiGridSpiException - 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.destNodes - Destination nodes.msg - Message to send.public void setListener(GridMessageListener listener)
setListener in interface GridCommunicationSpilistener - Listener to set or null to unset the listener.protected List<String> getConsistentAttributeNames()
getConsistentAttributeNames in class GridSpiAdapterpublic String toString()
toString in class Object
|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Grid Computing Made Simple, ver. 2.1.0.19122008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|
|