|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.pu.container.integrated.IntegratedProcessingUnitContainerProvider
public class IntegratedProcessingUnitContainerProvider
An IntegratedProcessingUnitContainer
provider. An
integrated processing unit container can be used to run a processing unit within an existing
environment. An example of what this existing environment will provide is the classpath that the
processing unit will run with. Examples for using the integrated processing unit container can be
integration tests or running the processing unit from within an IDE.
At its core the integrated processing unit container is built around Spring
ApplicationContext
configured based on a set of config
locations.
The provider allows for programmatic configuration of different processing unit aspects. It
allows to configure where the processing unit Spring context xml descriptors are located (by
default it uses classpath*:/META-INF/spring/pu.xml
). It also allows to set
BeanLevelProperties
and
ClusterInfo
that will be injected to beans configured within
the processing unit.
For a runnable "main" processing unit container please see
IntegratedProcessingUnitContainer.main(String[])
.
Field Summary |
---|
Fields inherited from interface org.openspaces.pu.container.spi.ApplicationContextProcessingUnitContainerProvider |
---|
DEFAULT_FS_PU_CONTEXT_LOCATION, DEFAULT_PU_CONTEXT_LOCATION |
Fields inherited from interface org.openspaces.pu.container.ProcessingUnitContainerProvider |
---|
CONTAINER_CLASS_PROP |
Constructor Summary | |
---|---|
IntegratedProcessingUnitContainerProvider()
|
Method Summary | |
---|---|
void |
addConfigLocation(Resource resource)
Adds a config location using Springs Resource
abstraction. |
void |
addConfigLocation(String path)
Adds a config location based on a String description using Springs PathMatchingResourcePatternResolver . |
ProcessingUnitContainer |
createContainer()
Creates a new IntegratedProcessingUnitContainer based on the configured parameters. |
void |
setBeanLevelProperties(BeanLevelProperties beanLevelProperties)
Sets the BeanLevelProperties that will be used to
configure this processing unit. |
void |
setClassLoader(ClassLoader classLoader)
Sets the class loader this processing unit container will load the application context with. |
void |
setClusterInfo(ClusterInfo clusterInfo)
Sets the ClusterInfo that will be used to configure this
processing unit. |
void |
setCredentials(String username,
String password)
|
void |
setCredentialsProvider(CredentialsProvider credentialsProvider)
|
void |
setParentContext(ApplicationContext parentContext)
Sets Spring parent ApplicationContext that will be used
when constructing this processing unit application context. |
void |
setSecured(Boolean secured)
|
void |
setUserDetails(String username,
String password)
Deprecated. |
void |
setUserDetails(UserDetails userDetails)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntegratedProcessingUnitContainerProvider()
Method Detail |
---|
public void setParentContext(ApplicationContext parentContext)
ApplicationContext
that will be used
when constructing this processing unit application context.
public void setBeanLevelProperties(BeanLevelProperties beanLevelProperties)
BeanLevelProperties
that will be used to
configure this processing unit. When constructing the container this provider will
automatically add to the application context both
BeanLevelPropertyBeanPostProcessor
and
BeanLevelPropertyPlaceholderConfigurer
based on this
bean level properties.
setBeanLevelProperties
in interface BeanLevelPropertiesAware
public void setClusterInfo(ClusterInfo clusterInfo)
ClusterInfo
that will be used to configure this
processing unit. When constructing the container this provider will automatically add to the
application context the ClusterInfoBeanPostProcessor
in
order to allow injection of cluster info into beans that implement
ClusterInfoAware
.
setClusterInfo
in interface ClusterInfoAware
clusterInfo
- The cluster information to be injectedpublic void setClassLoader(ClassLoader classLoader)
setClassLoader
in interface ClassLoaderAwareProcessingUnitContainerProvider
public void addConfigLocation(Resource resource)
Resource
abstraction. This config location represents a Spring xml context.
Note, once a config location is added that default location used when no config location is
defined won't be used (the default location is classpath*:/META-INF/spring/pu.xml
).
addConfigLocation
in interface ApplicationContextProcessingUnitContainerProvider
@Deprecated public void setUserDetails(UserDetails userDetails)
@Deprecated public void setUserDetails(String username, String password)
public void setCredentials(String username, String password)
public void setCredentialsProvider(CredentialsProvider credentialsProvider)
public void setSecured(Boolean secured)
public void addConfigLocation(String path) throws IOException
PathMatchingResourcePatternResolver
.
addConfigLocation
in interface ApplicationContextProcessingUnitContainerProvider
IOException
PathMatchingResourcePatternResolver
public ProcessingUnitContainer createContainer() throws CannotCreateContainerException
IntegratedProcessingUnitContainer
based on the configured parameters.
If addConfigLocation(org.springframework.core.io.Resource)
or
addConfigLocation(String)
were used, the Spring xml context will be read based on
the provided locations. If no config location was provided the default config location will
be classpath*:/META-INF/spring/pu.xml
.
If setBeanLevelProperties(org.openspaces.core.properties.BeanLevelProperties)
is set
will use the configured bean level properties in order to configure the application context
and specific beans within it based on properties. This is done by adding
BeanLevelPropertyBeanPostProcessor
and
BeanLevelPropertyPlaceholderConfigurer
to the
application context.
If setClusterInfo(org.openspaces.core.cluster.ClusterInfo)
is set will use it to
inject ClusterInfo
into beans that implement
ClusterInfoAware
.
createContainer
in interface ProcessingUnitContainerProvider
IntegratedProcessingUnitContainer
instance or an
CompoundProcessingUnitContainer
in case of a clustered processing unit
without a specific instance Id.
CannotCreateContainerException
|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |