Class Annotations


The GigaSpaces API supports class level decorations with POJOs. These can be specified via annotations on the space class source itself for all class instances.

See also:

XAP provides the ability to obtain and modify class meta data of objects stored in the Space during runtime.


Persistence

Syntax persist
Argument boolean
Default false
Description When a space is defined as persistent, a ‘true’ value for this annotation persists objects of this type.

Example:

@SpaceClass(persist=true)
public class Person {
//
}
See also:

Space Persistency

Include Properties

Syntax includeProperties
Argument IncludeProperties
Default IncludeProperties.IMPLICIT
Description IncludeProperties.IMPLICIT takes into account all POJO fields – even if a get method is not declared with a @SpaceProperty annotation, it is taken into account as a space field.IncludeProperties.EXPLICIT takes into account only the get methods which are declared with a @SpaceProperty annotation.

Example:

@SpaceClass(includeProperties=IncludeProperties.EXPLICIT)
public class Person {
  //
}

FIFO Support

Syntax fifoSupport
Argument FifoSupport
Default FifoSupport.NOT_SET
Description To enable FIFO operations, set this attribute to FifoSupport.OPERATION

Example:

@SpaceClass(fifoSupport=FifoSupport.OPERATION)
public class Person {
  //
}
See also:

Fifo Support

Inherit Index

Syntax inheritIndexes
Argument boolean
Default true
Description Whether to use the class indexes list only, or to also include the superclass’ indexes.
If the class does not define indexes, superclass indexes are used.
Options:
- false – class indexes only.
- true – class indexes and superclass indexes.

Example:

@SpaceClass(inheritIndexes=false)
public class Person {
  //
}
See also:

Indexing

Storage Type

Syntax storageType
Argument StorageType
Default StorageType.OBJECT
Description To determine a default storage type for each non primitive property for which a (field level) storage type was not defined.

Example:

@SpaceClass(storageType=StorageType.BINARY)
public class Person {
  //
}
See also:

Storage types

Replication

Syntax replicate
Argument boolean
Default true
Description When running in a partial replication mode, a false value for this property will not replicates all objects from this class type to the replica space or backup space.}

Example:

@SpaceClass(replicate=false)
public class Person {
  //
}
See also:

Replication

Compound Index

Syntax CompoundSpaceIndexes CompoundSpaceIndex paths
Argument(s) string
Values attribute name(s)
Description Indexes can be defined for multiple attributes of a class

Example:

@CompoundSpaceIndexes({ @CompoundSpaceIndex(paths = { "firstName", "lastName" }) })
@SpaceClass
public class User {
     private Long id;
     private String firstName;
     private String lastName;
     private Double balance;
     private Double creditLimit;
     private EAccountStatus status;
     private Address address;
     private String[] comment;
}

See also:

Compond Indexing

Blob Store

Syntax blobstoreEnabled
Argument boolean
Default true
Description By default any Space Data Type is blobStore enabled. When decorating the space class with its meta data you may turn off the blobStore behavior using the @SpaceClass blobStore annotation or gs.xml blobStore tag.

Example:

@SpaceClass(blobstoreEnabled = false)
public class Person {
    .......
}

See also:

Memoryxtend

Change code without restarts

Syntax SupportCodeChange id=
Argument string
Default ””
Description Changing execution code without restarting the data grid

Example:

@SupportCodeChange(id="1")
public class DynamicTask implements Task<Integer> {

    @Override
    public Integer execute() throws Exception {
        return new Integer(1);
    }
}