|
GridGain 2.0.3
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.discovery.jboss.GridJbossDiscoverySpi
@GridSpiInfo(author="GridGain Systems",
url="www.gridgain.org",
email="support@gridgain.com",
version="x.x")
@GridSpiMultipleInstancesSupport(value=false)
public class GridJbossDiscoverySpi
JBoss implementation of GridDiscoverySpi SPI. It uses JBoss cluster capabilities
to discover remote nodes in grid. SPI registers in cluster service with name GridJbossDiscoverySpi.DISCO_SERVICE_NAME
and every node in the cluster makes cluster method call with name GridJbossDiscoverySpi.DISCO_METHOD_NAME to receive
the remote node data.
GridJbossDiscoverySpi.setPartitionJndiName(String)).GridJbossDiscoverySpi.setMetricsFrequency(long)).GridJbossDiscoverySpi spi = new GridJbossDiscoverySpi(); GridConfigurationAdapter cfg = new GridConfigurationAdapter(); // Override default discovery SPI. cfg.setDiscoverySpi(spi); // Start grid. GridFactory.start(cfg);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
...
<property name="discoverySpi">
<bean class="org.gridgain.grid.spi.discovery.jboss.GridJbossDiscoverySpi"/>
</property>
...
</bean>
Note: JBoss is not shipped with GridGain. If you don't have JBoss, you need to download it separately. See http://www.jboss.com for more information. Once installed, JBoss should be available on the classpath for GridGain. Most likely you will be starting GridGain from JBoss (you can use supplied loader for JBoss). Alternatively, if you use [GRIDGAIN_HOME]/bin/gridgain.{sh|bat} script to start a grid node you can simply add JBoss JARs to [GRIDGAIN_HOME]/bin/setenv.{sh|bat} scripts that's used to set up class path for the main scripts.
Note: When using JBoss discovery SPI you cannot start
multiple GridGain instances in the same VM due to limitations of JBoss. GridGain runtime
will detect this situation and prevent GridGain from starting in such case.
See GridSpiMultipleInstancesSupport for detail.
Note: This SPI use HAPartition.HAMembershipExtendedListener from JBoss Cluster API. See bug http://jira.jboss.com/jira/browse/JBAS-3833 and fixed JBoss AS versions: JBossAS-5.0.0.Beta1, JBossAS-4.2.0.CR1, JBossAS-4.0.5.SP1 and higher.
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.0.3
GridDiscoverySpi
![]() |
![]() |
![]() |
![]() |
| Field Summary | |
|---|---|
static long |
DFLT_METRICS_FREQ
Default metrics heartbeat delay (value is 3000). |
static String |
DFLT_PARTITION_JNDI_NAME
Default JBoss cluster partition JNDI name (value is /HAPartition/DefaultPartition). |
static String |
DISCO_METHOD_NAME
Method name of service registered in cluster (value is remoteExec). |
static String |
DISCO_SERVICE_NAME
Name of service registered in cluster (value is attrInfoService). |
| Constructor Summary | |
|---|---|
GridJbossDiscoverySpi()
|
|
| Method Summary | |
|---|---|
GridNode |
getLocalNode()
Gets local node. |
long |
getMetricsFrequency()
Gets delay between metrics requests. |
GridNode |
getNode(UUID nodeId)
Gets node by ID. |
int |
getRemoteNodeCount()
Gets the number of remote nodes. |
Collection<UUID> |
getRemoteNodeIds()
Gets a collection of remote nodes' IDs. |
List<GridNode> |
getRemoteNodes()
Gets collection of remote nodes in grid or empty collection if no remote nodes found. |
boolean |
pingNode(UUID nodeId)
Pings the remote node to see if it's alive. |
byte[] |
remoteExec(org.gridgain.grid.spi.discovery.jboss.GridJbossDiscoveryNodeData data)
Method called by Spi in cluster. |
void |
setListener(GridDiscoveryListener listener)
Sets a listener for discovery events. |
void |
setMetricsFrequency(long metricsFreq)
Sets delay between metrics requests. |
void |
setMetricsProvider(GridDiscoveryMetricsProvider metricsProvider)
Sets discovery metrics provider. |
void |
setNodeAttributes(Map<String,Serializable> attrs)
Sets node attributes which will be distributed in grid during join process. |
void |
setPartitionJndiName(String partJndiName)
IoC configuration parameter to specify JNDI name for partition. |
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, checkConfigurationConsistency, configInfo, getAuthor, getGridGainHome, getLocalNodeId, getNodeAttributes, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion, onContextDestroyed, onContextInitialized, registerMBean, setSpiContext, startInfo, startStopwatch, stopInfo, unregisterMBean, warnSpi, warnSpiParameter |
| 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 |
|---|
getNodeAttributes, onContextDestroyed, onContextInitialized |
| Methods inherited from interface org.gridgain.grid.spi.GridSpiManagementMBean |
|---|
getAuthor, getGridGainHome, getLocalNodeId, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion |
| Field Detail |
|---|
public static final String DFLT_PARTITION_JNDI_NAME
public static final String DISCO_SERVICE_NAME
public static final String DISCO_METHOD_NAME
public static final long DFLT_METRICS_FREQ
| Constructor Detail |
|---|
public GridJbossDiscoverySpi()
| Method Detail |
|---|
@GridSpiConfiguration(optional=true) public void setPartitionJndiName(String partJndiName)
partJndiName - Sets JNDI partition name.public byte[] remoteExec(org.gridgain.grid.spi.discovery.jboss.GridJbossDiscoveryNodeData data)
data - Called node data.
public List<GridNode> getRemoteNodes()
getRemoteNodes in interface GridDiscoverySpipublic GridNode getNode(UUID nodeId)
getNode in interface GridDiscoverySpinodeId - Node ID.
public Collection<UUID> getRemoteNodeIds()
getRemoteNodeIds in interface GridJbossDiscoverySpiMBeanpublic int getRemoteNodeCount()
getRemoteNodeCount in interface GridJbossDiscoverySpiMBeanpublic boolean pingNode(UUID nodeId)
pingNode in interface GridDiscoverySpinodeId - Node Id.
@GridSpiConfiguration(optional=true) public void setMetricsFrequency(long metricsFreq)
If not provided the default value is GridJbossDiscoverySpi.DFLT_METRICS_FREQ.
metricsFreq - Time in milliseconds.public long getMetricsFrequency()
getMetricsFrequency in interface GridJbossDiscoverySpiMBeanpublic GridNode getLocalNode()
getLocalNode in interface GridDiscoverySpipublic void setListener(GridDiscoveryListener listener)
GridDiscoveryEventType for a set of all possible
discovery events.
setListener in interface GridDiscoverySpilistener - Listener to discovery events.public void setMetricsProvider(GridDiscoveryMetricsProvider metricsProvider)
GridDiscoveryMetricsProvider.getMetrics() method to exchange
dynamic metrics between nodes.
setMetricsProvider in interface GridDiscoverySpimetricsProvider - Provider of metrics data.public void setNodeAttributes(Map<String,Serializable> attrs)
setNodeAttributes in interface GridDiscoverySpiattrs - Map of node attributes.
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 String toString()
toString in class Object
|
GridGain 2.0.3
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.0.3.20052008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|