OpenSpaces Core Component - GigaSpace

  Search Here
Searching GigaSpaces XAP/EDG 6.5 Documentation

                                               

Summary: The JavaSpaces API is abstracted in OpenSpaces by a simple wrapper: the GigaSpace interface.

This page is specific to:
GigaSpaces 6.5

If you're interested in another version, click it below:
GigaSpaces 6.0

Overview

OpenSpaces provides a simpler space API using the GigaSpace interface, by wrapping the IJSpace (and the Jini JavaSpace), and simplifying both the API and its programming model. The interface allows the POJO domain model to be stored in the space (using GigaSpaces POJO support), declarative transactions, usage of Java 5 Generics, coherent runtime exception hierarchy, and more.

Here is a very simple example of how to define it:

The GigaSpace interface is a thin wrapper built on top of IJSpace. Within a single Processing Unit (or Spring application context), several GigaSpace instances can be defined, each with different characteristics.

The IJSpace interface is not hidden, and can be used even when using the GigaSpace interface. GigaSpace simplifies most operations used with the space (compared to IJSpace), but some operations still require access to IJSpace, which can be accessed through the GigaSpace API.

Clustered Flag

When configuring a Space an IJSpace instance is registered with Spring application context. When starting an embedded space with a cluster topology, or when looking up a remote space started with a cluster topology, a clustered proxy is returned. A clustered proxy is a smart proxy that performs operations against the whole cluster.

Many times, especially when working with a Processing Unit that starts an embedded space, operations against the space should be performed directly on the cluster member. This is a core concept of SBA and Processing Unit, where most if not all operations should be performed in-memory without leaving the processing unit boundaries when a Processing Unit starts an embedded space.

The decision of working directly with a cluster member or against the whole cluster is done in the GigaSpace level. The GigaSpacesFactoryBean provides a clustered flag with the following logic as the default value: If the space is started in embedded mode (for example, /./space), the clustered flag is set to false. When the space is looked up in a remote protocol (Jini or RMI), the clustered flag is set to true. Naturally, the flag can be set explicitly. Here is an example of how the clustered flag can be configured:

The above example shows a typical scenario where the clustered flag is used. Within a Processing Unit, an application might need to access both the cluster member and the whole cluster directly.

Simpler API

The GigaSpace interface provides a simpler space API by utilizing Java 5 generics, and allowing sensible defaults. Here is an example of the space take operation as defined within GigaSpace:

public interface GigaSpace {

    // ....
    
    <T> T take(T template) throws DataAccessException;
    
    <T> T take(T template, long timeout) throws DataAccessException;
}

In the example above, the take operation can be performed without specifying a timeout. The default take timeout is 0 (no wait), and can be overridden when configuring the GigaSpace factory. In a similar manner, the read timeout and write lease can be specified.


GigaSpaces 6.5 Documentation Contents (Current Page in Bold)

    Java

    C++

    .NET

    Middleware Capabilities

    Configuration and Management

Add GigaSpaces wiki search to your browser search engines!
(works on Firefox 2 and Internet Explorer 7)

Labels