Package org.openspaces.core
Class GigaMapFactoryBean
java.lang.Object
org.openspaces.core.GigaMapFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean,org.springframework.beans.factory.InitializingBean
public class GigaMapFactoryBean
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.BeanNameAware
- Author:
- kimchy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPrefix for the isolation constants defined in TransactionDefinitionFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()ReturnGigaMapimplementation constructed in theafterPropertiesSet()phase.booleanReturnstrueas this is a singleton.voidsetBeanName(String beanName) voidsetDefaultIsolationLevel(int defaultIsolationLevel) Set the default isolation level.final voidsetDefaultIsolationLevelName(String constantName) Set the default isolation level by the name of the corresponding constant in TransactionDefinition, e.g.voidsetDefaultLockTimeToLive(long defaultLockTimeToLive) Sets (in milliseconds) the default time to live for locks.voidsetDefaultTimeToLive(long defaultTimeToLive) Sets the default time to live (in milliseconds) for new entries.voidsetDefaultWaitForResponse(long defaultWaitForResponse) Sets (in milliseconds) the default wait timeout when perfomingMap.get(Object)orMap.remove(Object).voidsetDefaultWaitingForLockTimeout(long defaultWaitingForLockTimeout) Sets (in milliseconds) the default time to wait for a given lock when locking.voidsetExTranslator(ExceptionTranslator exTranslator) Sets the exception translator that will be used by the createdGigaMap.voidSets the map that will be used by the createdGigaMap.voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Set the transaction manager to enable transactional operations.voidsetTxProvider(TransactionProvider txProvider) Sets the transaction provider that will be used by the createdGigaMap.
-
Field Details
-
PREFIX_ISOLATION
Prefix for the isolation constants defined in TransactionDefinition- See Also:
-
-
Constructor Details
-
GigaMapFactoryBean
public GigaMapFactoryBean()
-
-
Method Details
-
setMap
Sets the map that will be used by the created
GigaMap. This is a required parameter to the factory.- Parameters:
map- The map used
-
setTxProvider
Sets the transaction provider that will be used by the created
GigaMap. This is an optional parameter and defaults toDefaultTransactionProvider.- Parameters:
txProvider- The transaction provider to use
-
setExTranslator
Sets the exception translator that will be used by the created
GigaMap. This is an optional parameter and defaults toDefaultExceptionTranslator.- Parameters:
exTranslator- The exception translator to use
-
setDefaultWaitForResponse
public void setDefaultWaitForResponse(long defaultWaitForResponse) Sets (in milliseconds) the default wait timeout when perfomingMap.get(Object)orMap.remove(Object). Defaults to NO WAIT (0). -
setDefaultTimeToLive
public void setDefaultTimeToLive(long defaultTimeToLive) Sets the default time to live (in milliseconds) for new entries. Defaults to FOREVER. -
setDefaultLockTimeToLive
public void setDefaultLockTimeToLive(long defaultLockTimeToLive) Sets (in milliseconds) the default time to live for locks. Defaults to 60 seconds. -
setDefaultWaitingForLockTimeout
public void setDefaultWaitingForLockTimeout(long defaultWaitingForLockTimeout) Sets (in milliseconds) the default time to wait for a given lock when locking. Defaults to 10 seconds. -
setDefaultIsolationLevelName
Set the default isolation level by the name of the corresponding constant in TransactionDefinition, e.g. "ISOLATION_DEFAULT".- Parameters:
constantName- name of the constant- Throws:
IllegalArgumentException- if the supplied value is not resolvable to one of theISOLATION_constants or isnull- See Also:
-
setDefaultIsolationLevel(int)TransactionDefinition.ISOLATION_DEFAULT
-
setDefaultIsolationLevel
public void setDefaultIsolationLevel(int 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
-
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Set the transaction manager to enable transactional operations. Can be
nullif transactional support is not required or the default space is used as a transactional context. -
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getObject
ReturnGigaMapimplementation constructed in theafterPropertiesSet()phase.- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean
-
isSingleton
public boolean isSingleton()Returnstrueas this is a singleton.- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean
-
destroy
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-