GigaSpaces XAP 7.0 API

org.openspaces.core
Class GigaMapFactoryBean

java.lang.Object
  extended by org.openspaces.core.GigaMapFactoryBean
All Implemented Interfaces:
BeanNameAware, FactoryBean, InitializingBean

public class GigaMapFactoryBean
extends Object
implements InitializingBean, FactoryBean, BeanNameAware

Author:
kimchy

Field Summary
static String PREFIX_ISOLATION
          Prefix for the isolation constants defined in TransactionDefinition
 
Constructor Summary
GigaMapFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 Object getObject()
          Return GigaMap implementation constructed in the afterPropertiesSet() phase.
 Class<? extends GigaMap> getObjectType()
           
 boolean isSingleton()
          Returns true as this is a singleton.
 void setBeanName(String beanName)
           
 void setDefaultIsolationLevel(int defaultIsolationLevel)
          Set the default isolation level.
 void setDefaultIsolationLevelName(String constantName)
          Set the default isolation level by the name of the corresponding constant in TransactionDefinition, e.g.
 void setDefaultLockTimeToLive(long defaultLockTimeToLive)
          Sets (in milliseconds) the default time to live for locks.
 void setDefaultTimeToLive(long defaultTimeToLive)
          Sets the default time to live (in milliseconds) for new entries.
 void setDefaultWaitForResponse(long defaultWaitForResponse)
          Sets (in milliseconds) the default wait timeout when perfoming Map.get(Object) or Map.remove(Object).
 void setDefaultWaitingForLockTimeout(long defaultWaitingForLockTimeout)
          Sets (in milliseconds) the default time to wait for a given lock when locking.
 void setExTranslator(ExceptionTranslator exTranslator)
          Sets the exception translator that will be used by the created GigaMap.
 void setMap(IMap map)
          Sets the map that will be used by the created GigaMap.
 void setTransactionManager(PlatformTransactionManager transactionManager)
          Set the transaction manager to enable transactional operations.
 void setTxProvider(TransactionProvider txProvider)
          Sets the transaction provider that will be used by the created GigaMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX_ISOLATION

public static final String PREFIX_ISOLATION
Prefix for the isolation constants defined in TransactionDefinition

See Also:
Constant Field Values
Constructor Detail

GigaMapFactoryBean

public GigaMapFactoryBean()
Method Detail

setMap

public void setMap(IMap map)

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

public void setTxProvider(TransactionProvider txProvider)

Sets the transaction provider that will be used by the created GigaMap. This is an optional parameter and defaults to DefaultTransactionProvider.

Parameters:
txProvider - The transaction provider to use

setExTranslator

public void setExTranslator(ExceptionTranslator exTranslator)

Sets the exception translator that will be used by the created GigaMap. This is an optional parameter and defaults to DefaultExceptionTranslator.

Parameters:
exTranslator - The exception translator to use

setDefaultWaitForResponse

public void setDefaultWaitForResponse(long defaultWaitForResponse)
Sets (in milliseconds) the default wait timeout when perfoming Map.get(Object) or Map.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

public final void setDefaultIsolationLevelName(String constantName)
                                        throws IllegalArgumentException
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 the ISOLATION_ constants or is null
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 the ISOLATION_ constants
See Also:
TransactionDefinition.ISOLATION_DEFAULT

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)

Set the transaction manager to enable transactional operations. Can be null if transactional support is not required or the default space is used as a transactional context.


setBeanName

public void setBeanName(String beanName)
Specified by:
setBeanName in interface BeanNameAware

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

getObject

public Object getObject()
Return GigaMap implementation constructed in the afterPropertiesSet() phase.

Specified by:
getObject in interface FactoryBean

getObjectType

public Class<? extends GigaMap> getObjectType()
Specified by:
getObjectType in interface FactoryBean

isSingleton

public boolean isSingleton()
Returns true as this is a singleton.

Specified by:
isSingleton in interface FactoryBean

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.