Package org.openspaces.core
Class GigaSpaceConfigurer
java.lang.Object
org.openspaces.core.GigaSpaceConfigurer
A simple programmatic configurer for
GigaSpace instance wrapping the
GigaSpaceFactoryBean.
Usage example:
SpaceConfigurer spaceConfigurer = new EmbeddedSpaceConfigurer("mySpace");
GigaSpace gigaSpace = new GigaSpaceConfigurer(spaceConfigurer).create();
...
spaceConfigurer.close();
- Author:
- kimchy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPrefix for the isolation constants defined in TransactionDefinition -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFor internal usage onlyGigaSpaceConfigurer(IJSpace space) Constructs a new configurer based on the Space.GigaSpaceConfigurer(SpaceConfigurer configurer) Constructs a new configurer based on the Space. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclose()clustered(boolean clustered) Sets the cluster flag controlling if thisGigaSpacewill work with a clustered view of the space or directly with a cluster member.create()Creates a newGigaSpaceinstance if non already created.defaultChangeModifiers(ChangeModifiers defaultChangeModifiers) Set the defaultChangeModifiersto be used for change operations on theGigaSpaceinstance.defaultClearModifiers(ClearModifiers defaultClearModifiers) Set the defaultClearModifiersto be used for clear operations on theGigaSpaceinstance.defaultCountModifiers(CountModifiers defaultCountModifiers) Set the defaultCountModifiersto be used for count operations on theGigaSpaceinstance.defaultIsolationLevel(int defaultIsolationLevel) Set the default isolation level.defaultIsolationLevel(String name) Set the default isolation level.defaultReadModifiers(ReadModifiers defaultReadModifiers) Set the defaultReadModifiersto be used for read operations on theGigaSpaceinstance.defaultReadTimeout(long defaultReadTimeout) Sets the default read timeout forGigaSpace.read(Object)andGigaSpace.readIfExists(Object)operations.defaultTakeModifiers(TakeModifiers defaultTakeModifiers) Set the defaultTakeModifiersto be used for take operations on theGigaSpaceinstance.defaultTakeTimeout(long defaultTakeTimeout) Sets the default take timeout forGigaSpace.take(Object)andGigaSpace.takeIfExists(Object)operations.defaultWriteLease(long defaultWriteLease) Sets the default write lease forGigaSpace.write(Object)operation.defaultWriteModifiers(WriteModifiers defaultWriteModifiers) Set the defaultWriteModifiersto be used for write operations on theGigaSpaceinstance.exTranslator(ExceptionTranslator exTranslator) Sets the exception translator that will be used by the createdGigaSpace.intlonglonglongprotected GigaSpacegetName()getSpace()org.springframework.transaction.PlatformTransactionManagerCreates a newGigaSpaceinstance if non already created.protected DefaultGigaSpaceSets the name of the GigaSpace instance which will be created.protected voidFor internal usage onlytransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Set the transaction manager to enable transactional operations.txProvider(TransactionProvider txProvider) Sets the transaction provider that will be used by the createdGigaSpace.
-
Field Details
-
PREFIX_ISOLATION
Prefix for the isolation constants defined in TransactionDefinition- See Also:
-
-
Constructor Details
-
GigaSpaceConfigurer
Constructs a new configurer based on the Space. -
GigaSpaceConfigurer
Constructs a new configurer based on the Space. -
GigaSpaceConfigurer
protected GigaSpaceConfigurer()For internal usage only- See Also:
-
-
Method Details
-
space
For internal usage only- See Also:
-
getSpace
-
name
Sets the name of the GigaSpace instance which will be created. If not specified, the space name will be used.- Parameters:
name- Name of the GigaSpace instance.
-
getName
-
txProvider
Sets the transaction provider that will be used by the createdGigaSpace. This is an optional parameter and defaults toDefaultTransactionProvider.- Parameters:
txProvider- The transaction provider to use
-
getTxProvider
-
exTranslator
Sets the exception translator that will be used by the createdGigaSpace. This is an optional parameter and defaults toDefaultExceptionTranslator.- Parameters:
exTranslator- The exception translator to use
-
getExTranslator
-
clustered
Sets the cluster flag controlling if thisGigaSpacewill work with a clustered view of the space or directly with a cluster member. By default if this flag is not set it will be set automatically by this factory. It will be set tofalseif the space is an embedded one AND the space is not a local cache proxy. It will be set totrueotherwise (i.e. the space is not an embedded space OR the space is a local cache proxy).- Parameters:
clustered- If theGigaSpaceis going to work with a clustered view of the space or directly with a cluster member
-
getClustered
-
defaultReadTimeout
Sets the default read timeout forGigaSpace.read(Object)andGigaSpace.readIfExists(Object)operations. Default to 0. -
getDefaultReadTimeout
public long getDefaultReadTimeout() -
defaultTakeTimeout
Sets the default take timeout forGigaSpace.take(Object)andGigaSpace.takeIfExists(Object)operations. Default to 0. -
getDefaultTakeTimeout
public long getDefaultTakeTimeout() -
defaultWriteLease
Sets the default write lease forGigaSpace.write(Object)operation. Default toLease.FOREVER. -
getDefaultWriteLease
public long getDefaultWriteLease() -
defaultIsolationLevel
Set the default isolation level. Must be one of the isolation constants in the TransactionDefinition interface. Default is ISOLATION_DEFAULT.- Throws:
IllegalArgumentException- if the supplied value is not one of theISOLATION_constants- See Also:
-
TransactionDefinition.ISOLATION_DEFAULT
-
getDefaultIsolationLevel
public int getDefaultIsolationLevel() -
defaultIsolationLevel
Set the default isolation level. Must be one of the isolation constants in the TransactionDefinition interface. Default is ISOLATION_DEFAULT.- Throws:
IllegalArgumentException- if the supplied value is not one of theISOLATION_constants- See Also:
-
TransactionDefinition.ISOLATION_DEFAULT
-
defaultWriteModifiers
Set the defaultWriteModifiersto be used for write operations on theGigaSpaceinstance. Defaults toWriteModifiers.UPDATE_OR_WRITE- Parameters:
defaultWriteModifiers- The default write modifiers.- See Also:
-
getDefaultWriteModifiers
-
defaultReadModifiers
Set the defaultReadModifiersto be used for read operations on theGigaSpaceinstance. Defaults toReadModifiers.READ_COMMITTED- Parameters:
defaultReadModifiers- The default read modifiers.- See Also:
-
getDefaultReadModifiers
-
defaultTakeModifiers
Set the defaultTakeModifiersto be used for take operations on theGigaSpaceinstance. Defaults toTakeModifiers.NONE- Parameters:
defaultTakeModifiers- The default take modifiers.- See Also:
-
getDefaultTakeModifiers
-
defaultCountModifiers
Set the defaultCountModifiersto be used for count operations on theGigaSpaceinstance. Defaults toCountModifiers.NONE- Parameters:
defaultCountModifiers- The default count modifiers.- See Also:
-
getDefaultCountModifiers
-
defaultClearModifiers
Set the defaultClearModifiersto be used for clear operations on theGigaSpaceinstance. Defaults toClearModifiers.NONE- Parameters:
defaultClearModifiers- The default clear modifiers.- See Also:
-
getDefaultClearModifiers
-
defaultChangeModifiers
Set the defaultChangeModifiersto be used for change operations on theGigaSpaceinstance. Defaults toChangeModifiers.NONE- Parameters:
defaultChangeModifiers- The default change modifiers.- See Also:
-
getDefaultChangeModifiers
-
transactionManager
public GigaSpaceConfigurer transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Set the transaction manager to enable transactional operations. Can benullif transactional support is not required or the default space is used as a transactional context. -
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager() -
create
Creates a newGigaSpaceinstance if non already created. -
close
- Throws:
Exception
-
getGigaSpaceIfInitialized
-
gigaSpace
Creates a newGigaSpaceinstance if non already created.- See Also:
-
initialize
-