Java

Attention

A sample for GigaSpaces integration has been contributed from a graduate work, which will be described here. No reports have been given from our users about successfully integrating this database with any devonfw tech stack. If you want to share your knowledge or report usage, please contribute by clicking on the pen next to the section headline.If you need help on devonfw tech stack knowledge to get the integration working for you, stay in contact at GitHub.

Possible Approach

GigaSpaces is currently not in the central maven repository, therefore an additional repository needs to be added along with the dependency:

<repositories>
    <repository>
	<id>org.openspaces</id>
	<url>http://maven-repository.openspaces.org</url>
    </repository>
</repositories>

<dependency>
    <groupId>org.gigaspaces</groupId>
    <artifactId>xap-openspaces</artifactId>
    <version>${gsVersion}</version>
</dependency>

Of course the version (${gsVersion}) needs to be adopted to your needs.

@Configuration
public class ContextConfiguration {
  @Bean
  public GigaSpace space() {
    UrlSpaceConfigurer urlSpaceConfigurer = new UrlSpaceConfigurer("jini://*/*/my-space");
    return new GigaSpaceConfigurer(urlSpaceConfigurer).gigaSpace();
  }
}

To establish a connection with a running instance of GigaSpaces, a Configuration Class is required. Here a Bean will be created that retrieves via URL the name of a Space e.g. my-space (a Space is equivalent to a Database Schema). Of course a Space needs to be firstly created in order to use it (see also the Example). This bean can be used for all database typical operations e.g. create, read, update and delete data (a complete list can be found here). Another possibility to execute those operations is via spring-data (see section below). The spring-data-gigaspaces automatically detects if a GigaSpaces Bean exists.

Spring-Data

There is spring-data support available for GigaSpaces XAP (Smart Cache) via spring-data-gigaspaces.

Example

There is an implementation of the sample application, My Thai Star, using GigaSpaces XAP (Smart Cache) as data storage. More details can be found on mts-gigaspaces.

Last updated 2023-11-20 10:37:01 UTC