Class UrlSpaceFactoryBean
- All Implemented Interfaces:
InternalDumpProcessor,EventListener,ClusterInfoAware,MemberAliveIndicator,BeanLevelMergedPropertiesAware,ServiceDetailsProvider,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,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
IJSpace) based on a url.
The factory allows to specify url properties using urlProperties and space parameters using parameters or
using properties. It also accepts a ClusterInfo using
setClusterInfo(ClusterInfo) and translates it into the relevant space url properties
automatically.
Most url properties are explicitly exposed using different setters. Though they can also be
set using the urlProperties the explicit setters
allow for more readable and simpler configuration. Some examples of explicit url properties are:
setSchema(String), setFifo(boolean).
The factory uses the BeanLevelMergedPropertiesAware in order to be injected with
properties that were not parameterized in advance (using ${...} notation). This will directly
inject additional properties in the Space creation/finding process.
- Author:
- kimchy
-
Field Summary
Fields inherited from class org.openspaces.core.space.AbstractSpaceFactoryBean
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new url space factory bean.Creates a new url space factory bean based on the url provided.UrlSpaceFactoryBean(String url, Map<String, Object> params) Creates a new url space factory bean based on the url and map parameters provided. -
Method Summary
Modifier and TypeMethodDescriptionvoidattributeStore(AttributeStore attributeStore) protected IJSpaceCreates the space.voidsetAttributeStore(AttributeStoreFactoryBean attributeStore) voidsetBlobStoreDataPolicy(BlobStoreDataPolicyFactoryBean blobStoreDataPolicy) voidsetCachePolicy(CachePolicy cachePolicy) Sets the cache policy that the space will use.voidsetClusterInfo(ClusterInfo clusterInfo) Injected thanks to this bean implementingClusterInfoAware.voidsetCustomCachePolicy(CustomCachePolicyFactoryBean customCachePolicy) voidsetCustomComponent(SpaceCustomComponentFactoryBean customComponentFactoryBean) voidsetDistributedTransactionProcessingConfiguration(DistributedTransactionProcessingConfigurationFactoryBean distributedTransactionProcessingConfiguration) Sets the distributed transaction processing configuration for the Mirror component.voidsetExternalDataSource(ManagedDataSource externalDataSource) A data sourcevoidsetFifo(boolean fifo) Indicates that all take/write operations be conducted in FIFO mode.voidsetFilterProviders(FilterProviderFactory[] filterProviders) Inject a list of filter provider factories providing the ability to inject actual Space filters.voidsetGatewayTargets(SpaceCustomComponentFactoryBean gatewayFactoryBean) Deprecated.Since 12.0 - Use #setCustomComponent instead.voidsetLookupGroups(String lookupGroups) The Jini Lookup Service group to find container or space using multicast (jini protocol).voidsetLookupLocators(String lookupLocators) The Jini Lookup locators for the Space.voidsetLookupTimeout(Integer lookupTimeout) The max timeout in milliseconds to find a Container or Space using multicast (jini protocol).voidsetMergedBeanLevelProperties(Properties beanLevelProperties) Externally managed override properties using open spaces extended config support.voidsetMirror(boolean mirror) When setting this URL property totrueit will allow the space to connect to the Mirror service to push its data and operations for asynchronous persistency.voidsetNoWriteLease(boolean noWriteLease) Iftrue- Lease object would not return from the write/writeMultiple operations.voidsetParameters(Map<String, Object> parameters) Sets the parameters theIJSpacewill be created with.voidsetProperties(Properties properties) Same asparametersjust with properties for simpler configuration.voidsetQueryExtensionProviders(QueryExtensionProvider[] queryExtenstionProviders) Inject a list of space types.voidsetReplicationFilterProvider(ReplicationFilterProviderFactory replicationFilterProvider) Injects a replication provider allowing to directly inject actual replication filters.voidThe space instance is created using a space schema file which can be used as a template configuration file for creating a space.voidsetSecured(boolean secured) Sets the space as secured.voidsetSecurityConfig(SecurityConfig securityConfig) Sets security configuration for the Space.voidsetSpaceDataSource(SpaceDataSource spaceDataSource) Sets theSpaceDataSourcewhich will be used as a data source for the space.voidsetSpaceSqlFunction(SpaceSqlFunctionBean[] spaceSqlFunctionBeans) voidsetSpaceSynchronizationEndpoint(SpaceSynchronizationEndpoint spaceSynchronizationEndpoint) voidsetSpaceTypes(SpaceTypeDescriptor[] typeDescriptors) Inject a list of space types.voidSets the url theIJSpacewill be created with.voidsetUrlProperties(Properties urlProperties) Sets the url properties.voidsetVersioned(boolean versioned) Whenfalse, optimistic lock is disabled.Methods inherited from class org.openspaces.core.space.AbstractSpaceFactoryBean
addServiceDetails, afterPropertiesSet, close, destroy, fireSpaceAfterBackupEvent, fireSpaceAfterPrimaryEvent, fireSpaceBeforeBackupEvent, fireSpaceBeforePrimaryEvent, getApplicationContext, getName, getObject, getObjectType, getSecurityConfig, getServicesDetails, isAlive, isMemberAliveEnabled, isRegisterForSpaceModeNotifications, isSingleton, onApplicationEvent, process, setApplicationContext, setBeanName, setCredentialsProvider, setEnableMemberAliveIndicator, setPrimaryBackupListener, setRegisterForSpaceModeNotifications, setUserDetails, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface com.gigaspaces.internal.dump.InternalDumpProcessor
getDumpFileReportLocation, setDumpFileReportLocation
-
Constructor Details
-
UrlSpaceFactoryBean
public UrlSpaceFactoryBean()Creates a new url space factory bean. The url parameters is requires so thesetUrl(String)must be called before the bean is initialized. -
UrlSpaceFactoryBean
Creates a new url space factory bean based on the url provided.- Parameters:
url- The url to create theIJSpacewith.
-
UrlSpaceFactoryBean
Creates a new url space factory bean based on the url and map parameters provided.
-
-
Method Details
-
doCreateSpace
Creates the space.- Specified by:
doCreateSpacein classAbstractSpaceFactoryBean- Returns:
- The IJSpace implementation used for the factory bean
- Throws:
org.springframework.dao.DataAccessException
-
setSecured
public void setSecured(boolean secured) Sets the space as secured. Note, when passing userName and password it will automatically be secured. -
setSecurityConfig
Description copied from class:AbstractSpaceFactoryBeanSets security configuration for the Space. If not set, no security will be used.- Overrides:
setSecurityConfigin classAbstractSpaceFactoryBean
-
setUrl
Sets the url theIJSpacewill be created with. Note this url does not take affect after the bean has been initialized.- Parameters:
url- The url to create theIJSpacewith.
-
setParameters
Sets the parameters theIJSpacewill be created with. Note this parameters does not take affect after the bean has been initialized.Note, this should not be confused with
setUrlProperties(java.util.Properties). The parameters here are the ones referred to as custom properties and allows for example to control the xpath injection to space schema.- Parameters:
parameters- The parameters to create theIJSpacewith.
-
setProperties
Same asparametersjust with properties for simpler configuration. -
setUrlProperties
Sets the url properties. Note, most if not all url level properties can be set using explicit setters. -
setSchema
The space instance is created using a space schema file which can be used as a template configuration file for creating a space. The user specifies one of the pre-configured schema names (to create a space instance from its template) or a custom one using this property.If a schema name is not defined, a default schema name called
defaultwill be used. -
setFifo
public void setFifo(boolean fifo) Indicates that all take/write operations be conducted in FIFO mode. Default is the Space default (false). -
setLookupGroups
The Jini Lookup Service group to find container or space using multicast (jini protocol). Groups are comma separated list. -
setLookupLocators
The Jini Lookup locators for the Space. In the form of:host1:port1,host2:port2. -
setLookupTimeout
The max timeout in milliseconds to find a Container or Space using multicast (jini protocol). Defaults to6000(i.e. 6 seconds). -
setVersioned
public void setVersioned(boolean versioned) Whenfalse, optimistic lock is disabled. Default to the Space default value. -
setNoWriteLease
public void setNoWriteLease(boolean noWriteLease) Iftrue- Lease object would not return from the write/writeMultiple operations. Defaults to the Space default value (false). -
setMirror
public void setMirror(boolean mirror) When setting this URL property totrueit will allow the space to connect to the Mirror service to push its data and operations for asynchronous persistency. Defaults to the Space default (which defaults tofalse). -
setFilterProviders
Inject a list of filter provider factories providing the ability to inject actual Space filters. -
setReplicationFilterProvider
public void setReplicationFilterProvider(ReplicationFilterProviderFactory replicationFilterProvider) Injects a replication provider allowing to directly inject actual replication filters. -
setExternalDataSource
A data source -
setSpaceDataSource
Sets theSpaceDataSourcewhich will be used as a data source for the space.- Parameters:
spaceDataSource- TheSpaceDataSourceinstance.
-
setSpaceSynchronizationEndpoint
public void setSpaceSynchronizationEndpoint(SpaceSynchronizationEndpoint spaceSynchronizationEndpoint) - Parameters:
spaceSynchronizationEndpoint-
-
setSpaceTypes
Inject a list of space types. -
setQueryExtensionProviders
Inject a list of space types. -
setCachePolicy
Sets the cache policy that the space will use. If not set, will default to the one configured in the space schema. -
setMergedBeanLevelProperties
Externally managed override properties using open spaces extended config support. Should not be set directly but allowed for different Spring context container to set it.- Specified by:
setMergedBeanLevelPropertiesin interfaceBeanLevelMergedPropertiesAware
-
attributeStore
-
setClusterInfo
Injected thanks to this bean implementingClusterInfoAware. If set will use the cluster information in order to configure the url based on it.- Specified by:
setClusterInfoin interfaceClusterInfoAware- Parameters:
clusterInfo- The cluster information to be injected
-
setGatewayTargets
Deprecated.Since 12.0 - Use #setCustomComponent instead.Sets the gateway replication targets to be used with the constructed space.- Parameters:
gatewayFactoryBean- The gateway targets factory bean.
-
setCustomComponent
-
setDistributedTransactionProcessingConfiguration
public void setDistributedTransactionProcessingConfiguration(DistributedTransactionProcessingConfigurationFactoryBean distributedTransactionProcessingConfiguration) Sets the distributed transaction processing configuration for the Mirror component.- Parameters:
distributedTransactionProcessingConfiguration- The distributed transaction processing configuration to set.
-
setCustomCachePolicy
-
setBlobStoreDataPolicy
-
setAttributeStore
-
setSpaceSqlFunction
-