Dashboard > GridGain User Guide > Table Of Contents > Developers Guide > Discovery SPI > GridCoherenceDiscoverySpi
GridCoherenceDiscoverySpi
Added by morpheus, last edited by link on Feb 06, 2008  (view change)
Labels: 
(None)


Click on Javadoc link to open Javadoc documentation.

Package

org.gridgain.grid.spi.discovery.coherence Javadoc

Description

GridCoherenceDiscoverySpi Javadoc discovery SPI implementation using Oracle Coherence node discovery. It uses Coherence cluster capabilities discover remote nodes in grid. SPI works with Coherence distributed cache named GridCoherenceDiscoverySpi.DFLT_GRIDGAIN_CACHE Javadoc . Every node in the cluster works with that cache to communicate with other remote nodes.

Libraries

Coherence is not shipped with GridGain. If you don't have Coherence, you need to download it separately. See http://www.oracle.com/tangosol/index.html for more information. Once installed, Coherence should be available on the classpath for GridGain. If you use [GRIDGAIN_HOME]/bin/gridgain.{sh|bat} script to start a grid node you can simply add Coherence JARs to [GRIDGAIN_HOME]/bin/setenv.{sh|bat} scripts that's used to set up class path for the main scripts.

Multiple Instances In VM

When using Coherence SPIs (communication or discovery) you cannot start multiple GridGain instances in the same VM due to limitations of Coherence. GridGain runtime will detect this situation and prevent GridGain from starting in such case. See GridSpiMultipleInstancesSupport Javadoc for details.

Configuration

The following configuration parameters can be used to configure GridMulticastDiscoverySpi:

Setter Method Description Optional Default
setCacheName(String) Javadoc Coherence cache name. Yes gridgain.discovery.cache (specified by GridCoherenceDiscoverySpi.DFLT_GRIDGAIN_CACHE Javadoc )
setMetricsFrequency(long) Javadoc Grid node metrics update frequency. Yes 3000 (specified by GridCoherenceDiscoverySpi.DFLT_METRICS_FREQ Javadoc )

Examples

GridCoherenceDiscoverySpi Javadoc needs to be explicitly configured to be used. Here is a configuration example:

GridCoherenceDiscoverySpi spi = new GridCoherenceDiscoverySpi();

GridConfigurationAdapter cfg = new GridConfigurationAdapter();

// Override default discovery SPI.
cfg.setDiscoverySpi(spi);

// Start grid.
GridFactory.start(cfg);

or from Spring configuration file

<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
        ...
        <property name="discoverySpi">
            <bean class="org.gridgain.grid.spi.discovery.coherence.GridCoherenceDiscoverySpi"/>
        </property>
        ...
</bean>


For more information about using Spring framework for configuration click here.

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators