Dashboard > GridGain User Guide > Table Of Contents > Developers Guide > Communication SPI > GridCoherenceCommunicationSpi
GridCoherenceCommunicationSpi
Added by architect, 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.communication.coherence Javadoc

Description

Oracle Coherence implementation of GridCommunicationSpi Javadoc SPI. It uses Coherence data grid framework to communicate with remote nodes. This SPI uses Coherence asynchronous call InvocationService#execute(Invocable, Set, InvocationObserver) to send a message to remote node. If parameter setAcknowledgment(boolean) Javadoc is set to true, then this SPI will use Coherence InvocationObserver to wait for request completion acknowledgment.

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} script that is used to set up class path for the main scripts.

Multiple Instances In VM

When using Coherence SPI (communication or discovery) you cannot start multiple GridGain instances in the same VM due to Mule limitiation. 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 GridCoherenceCommuncationSpi Javadoc

Setter Method Description Optional Default
setServiceName(String) Javadoc Sets Coherence invocation service name created and used by GridGain. Yes gridgain.comm.srvc
setAcknowledgment(boolean) Javadoc Sets message acknowledgments on or off. Yes false

Examples

As any GridGain SPI, GridCoherenceCommunicationSpi Javadoc can be configured either directly from code or from Spring configuration file. Here is an example of GridCoherenceCommunicationSpi Javadoc configuration from code:

GridCoherenceCommunicationSpi commSpi = new GridCoherenceCommunicationSpi();

// Override default false setting.
commSpi.setAcknowledgement(true);

GridConfigurationAdapter cfg = new GridConfigurationAdapter();

// Override default communication SPI.
cfg.setCommunicationSpi(commSpi);

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

or from Spring configuration file

<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
        ...
        <property name="communicationSpi">
            <bean class="org.gridgain.grid.spi.communication.coherence.GridCoherenceCommunicationSpi">
                <property name="acknowledgment" value="true"/>
            </bean>
        </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