Class UrlSpaceFactoryBean

java.lang.Object
org.openspaces.core.space.AbstractSpaceFactoryBean
org.openspaces.core.space.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

public class UrlSpaceFactoryBean extends AbstractSpaceFactoryBean implements BeanLevelMergedPropertiesAware, ClusterInfoAware
A space factory bean that creates a space (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
  • Constructor Details

    • UrlSpaceFactoryBean

      public UrlSpaceFactoryBean()
      Creates a new url space factory bean. The url parameters is requires so the setUrl(String) must be called before the bean is initialized.
    • UrlSpaceFactoryBean

      public UrlSpaceFactoryBean(String url)
      Creates a new url space factory bean based on the url provided.
      Parameters:
      url - The url to create the IJSpace with.
    • UrlSpaceFactoryBean

      public UrlSpaceFactoryBean(String url, Map<String,Object> params)
      Creates a new url space factory bean based on the url and map parameters provided.
      Parameters:
      url - The url to create the IJSpace with.
      params - The parameters to create the IJSpace with.
  • Method Details

    • doCreateSpace

      protected IJSpace doCreateSpace() throws org.springframework.dao.DataAccessException
      Creates the space.
      Specified by:
      doCreateSpace in class AbstractSpaceFactoryBean
      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

      public void setSecurityConfig(SecurityConfig securityConfig)
      Description copied from class: AbstractSpaceFactoryBean
      Sets security configuration for the Space. If not set, no security will be used.
      Overrides:
      setSecurityConfig in class AbstractSpaceFactoryBean
    • setUrl

      public void setUrl(String url)
      Sets the url the IJSpace will be created with. Note this url does not take affect after the bean has been initialized.
      Parameters:
      url - The url to create the IJSpace with.
    • setParameters

      public void setParameters(Map<String,Object> parameters)
      Sets the parameters the IJSpace will 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 the IJSpace with.
    • setProperties

      public void setProperties(Properties properties)
      Same as parameters just with properties for simpler configuration.
    • setUrlProperties

      public void setUrlProperties(Properties urlProperties)
      Sets the url properties. Note, most if not all url level properties can be set using explicit setters.
    • setSchema

      public void setSchema(String schema)
      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 default will 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

      public void setLookupGroups(String lookupGroups)
      The Jini Lookup Service group to find container or space using multicast (jini protocol). Groups are comma separated list.
    • setLookupLocators

      public void setLookupLocators(String lookupLocators)
      The Jini Lookup locators for the Space. In the form of: host1:port1,host2:port2.
    • setLookupTimeout

      public void setLookupTimeout(Integer lookupTimeout)
      The max timeout in milliseconds to find a Container or Space using multicast (jini protocol). Defaults to 6000 (i.e. 6 seconds).
    • setVersioned

      public void setVersioned(boolean versioned)
      When false, optimistic lock is disabled. Default to the Space default value.
    • setNoWriteLease

      public void setNoWriteLease(boolean noWriteLease)
      If true - 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 to true it 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 to false).
    • setFilterProviders

      public void setFilterProviders(FilterProviderFactory[] filterProviders)
      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

      public void setExternalDataSource(ManagedDataSource externalDataSource)
      A data source
    • setSpaceDataSource

      public void setSpaceDataSource(SpaceDataSource spaceDataSource)
      Sets the SpaceDataSource which will be used as a data source for the space.
      Parameters:
      spaceDataSource - The SpaceDataSource instance.
    • setSpaceSynchronizationEndpoint

      public void setSpaceSynchronizationEndpoint(SpaceSynchronizationEndpoint spaceSynchronizationEndpoint)
      Parameters:
      spaceSynchronizationEndpoint -
    • setSpaceTypes

      public void setSpaceTypes(SpaceTypeDescriptor[] typeDescriptors)
      Inject a list of space types.
    • setQueryExtensionProviders

      public void setQueryExtensionProviders(QueryExtensionProvider[] queryExtenstionProviders)
      Inject a list of space types.
    • setCachePolicy

      public void setCachePolicy(CachePolicy cachePolicy)
      Sets the cache policy that the space will use. If not set, will default to the one configured in the space schema.
      See Also:
    • setMergedBeanLevelProperties

      public void setMergedBeanLevelProperties(Properties beanLevelProperties)
      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:
      setMergedBeanLevelProperties in interface BeanLevelMergedPropertiesAware
    • attributeStore

      public void attributeStore(AttributeStore attributeStore)
    • setClusterInfo

      public void setClusterInfo(ClusterInfo clusterInfo)
      Injected thanks to this bean implementing ClusterInfoAware. If set will use the cluster information in order to configure the url based on it.
      Specified by:
      setClusterInfo in interface ClusterInfoAware
      Parameters:
      clusterInfo - The cluster information to be injected
    • setGatewayTargets

      @Deprecated public void setGatewayTargets(SpaceCustomComponentFactoryBean gatewayFactoryBean)
      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

      public void setCustomComponent(SpaceCustomComponentFactoryBean customComponentFactoryBean)
    • 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

      public void setCustomCachePolicy(CustomCachePolicyFactoryBean customCachePolicy)
    • setBlobStoreDataPolicy

      public void setBlobStoreDataPolicy(BlobStoreDataPolicyFactoryBean blobStoreDataPolicy)
    • setAttributeStore

      public void setAttributeStore(AttributeStoreFactoryBean attributeStore)
    • setSpaceSqlFunction

      public void setSpaceSqlFunction(SpaceSqlFunctionBean[] spaceSqlFunctionBeans)