|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.core.space.AbstractSpaceFactoryBean org.openspaces.core.space.UrlSpaceFactoryBean
public class UrlSpaceFactoryBean
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.
SpaceURLParser
,
SpaceFinder
Field Summary |
---|
Fields inherited from class org.openspaces.core.space.AbstractSpaceFactoryBean |
---|
logger |
Constructor Summary | |
---|---|
UrlSpaceFactoryBean()
Creates a new url space factory bean. |
|
UrlSpaceFactoryBean(String url)
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 | |
---|---|
protected IJSpace |
doCreateSpace()
Creates the space by calling doGetSpaceUrls() and then using the returned
SpaceURL a space is found using SpaceFinder.find(SpaceURL) . |
protected SpaceURL[] |
doGetSpaceUrls()
Parses the given space url using SpaceURLParser and returns the parsed
SpaceURL . |
void |
setCachePolicy(CachePolicy cachePolicy)
Sets the cache policy that the space will use. |
void |
setClusterInfo(ClusterInfo clusterInfo)
Injected thanks to this bean implementing ClusterInfoAware . |
void |
setExternalDataSource(ManagedDataSource externalDataSource)
A data source |
void |
setFifo(boolean fifo)
Indicates that all take/write operations be conducted in FIFO mode. |
void |
setFilterProviders(FilterProviderFactory[] filterProviders)
Inject a list of filter provider factories providing the ability to inject actual Space filters. |
void |
setLookupGroups(String lookupGroups)
The Jini Lookup Service group to find container or space using multicast (jini protocol). |
void |
setLookupLocators(String lookupLocators)
The Jini Lookup locators for the Space. |
void |
setLookupTimeout(Integer lookupTimeout)
The max timeout in milliseconds to find a Container or Space using multicast (jini protocol). |
void |
setMergedBeanLevelProperties(Properties beanLevelProperties)
Externally managed override properties using open spaces extended config support. |
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. |
void |
setNoWriteLease(boolean noWriteLease)
If true - Lease object would not return from the write/writeMultiple
operations. |
void |
setParameters(Map<String,Object> parameters)
Sets the parameters the IJSpace will be created with. |
void |
setProperties(Properties properties)
Same as parameters just with properties for simpler
configuration. |
void |
setReplicationFilterProvider(ReplicationFilterProviderFactory replicationFilterProvider)
Injects a replication provider allowing to directly inject actual replication filters. |
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. |
void |
setSecured(boolean secured)
Sets the space as secured. |
void |
setUrl(String url)
Sets the url the IJSpace will be created with. |
void |
setUrlProperties(Properties urlProperties)
Sets the url properties. |
void |
setVersioned(boolean versioned)
When false , optimistic lock is disabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UrlSpaceFactoryBean()
setUrl(String)
must be called before the bean is initialized.
public UrlSpaceFactoryBean(String url)
url
- The url to create the IJSpace
with.public UrlSpaceFactoryBean(String url, Map<String,Object> params)
url
- The url to create the IJSpace
with.params
- The parameters to create the IJSpace
with.Method Detail |
---|
public void setSecured(boolean secured)
public void setUrl(String url)
IJSpace
will be created with. Note this url does not take affect
after the bean has been initialized.
url
- The url to create the IJSpace
with.public void setParameters(Map<String,Object> parameters)
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
- The parameters to create the IJSpace
with.public void setProperties(Properties properties)
parameters
just with properties for simpler
configuration.
public void setUrlProperties(Properties urlProperties)
public void setSchema(String schema)
If a schema name is not defined, a default schema name called default
will be
used.
public void setFifo(boolean fifo)
false
).
public void setLookupGroups(String lookupGroups)
public void setLookupLocators(String lookupLocators)
host1:port1,host2:port2
.
public void setLookupTimeout(Integer lookupTimeout)
6000
(i.e. 6 seconds).
public void setVersioned(boolean versioned)
false
, optimistic lock is disabled. Default to the Space default value.
public void setNoWriteLease(boolean noWriteLease)
true
- Lease object would not return from the write/writeMultiple
operations. Defaults to the Space default value (false
).
public void setMirror(boolean mirror)
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
).
public void setFilterProviders(FilterProviderFactory[] filterProviders)
public void setReplicationFilterProvider(ReplicationFilterProviderFactory replicationFilterProvider)
public void setExternalDataSource(ManagedDataSource externalDataSource)
public void setCachePolicy(CachePolicy cachePolicy)
AllInCachePolicy
,
LruCachePolicy
public void setMergedBeanLevelProperties(Properties beanLevelProperties)
setMergedBeanLevelProperties
in interface BeanLevelMergedPropertiesAware
public void setClusterInfo(ClusterInfo clusterInfo)
ClusterInfoAware
. If set will use the
cluster information in order to configure the url based on it.
setClusterInfo
in interface ClusterInfoAware
clusterInfo
- The cluster information to be injectedprotected IJSpace doCreateSpace() throws DataAccessException
doGetSpaceUrls()
and then using the returned
SpaceURL
a space is found using SpaceFinder.find(SpaceURL)
.
doCreateSpace
in class AbstractSpaceFactoryBean
DataAccessException
protected SpaceURL[] doGetSpaceUrls() throws DataAccessException
SpaceURLParser
and returns the parsed
SpaceURL
.
Uses the setUrlProperties(java.util.Properties)
and
setParameters(java.util.Map)
as parameters for the space. Also uses the
setClusterInfo(org.openspaces.core.cluster.ClusterInfo)
by automatically translating
the cluster information into relevant Space url properties.
DataAccessException
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |