Class StandaloneContainerRunnable
java.lang.Object
org.openspaces.pu.container.standalone.StandaloneContainerRunnable
- All Implemented Interfaces:
Runnable
A standalone container runnable allowing to start a Spring based application context based on the
provided parameters (
BeanLevelProperties, ClusterInfo, and a list of config locations).
This runnable allows to start a processing unit container within a running thread, mainly
allowing for custom class loader created based on the processing unit structure to be scoped only
within the running thread. When using StandaloneProcessingUnitContainer.main(String[])
this feature is not required but when integrating the standalone container within another
application this allows not to corrupt the external environment thread context class loader.
- Author:
- kimchy
-
Constructor Summary
ConstructorsConstructorDescriptionStandaloneContainerRunnable(BeanLevelProperties beanLevelProperties, ClusterInfo clusterInfo, List<String> configLocations) Constructs a new standalone container runnable based on the provided configuration set parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.context.ApplicationContextReturns Spring application context used as the backend for this container.booleanbooleanReturnstrueif the application context initialized successfully.booleanReturntrueif this runnable is currently running.voidrun()Constructs a new SpringApplicationContextbased on the configured list of config locations.voidstop()Stop this currently running container runnable.
-
Constructor Details
-
StandaloneContainerRunnable
public StandaloneContainerRunnable(BeanLevelProperties beanLevelProperties, ClusterInfo clusterInfo, List<String> configLocations) Constructs a new standalone container runnable based on the provided configuration set parameters.- Parameters:
beanLevelProperties- The properties based configuration for Spring contextclusterInfo- The cluster info configurationconfigLocations- List of config locations (string based)
-
-
Method Details
-
run
public void run()Constructs a new SpringApplicationContextbased on the configured list of config locations. Also uses the providedClusterInfoandBeanLevelPropertiesin order to further config the application context. -
isInitialized
public boolean isInitialized()Returnstrueif the application context initialized successfully. -
isRunning
public boolean isRunning()Returntrueif this runnable is currently running. -
stop
public void stop()Stop this currently running container runnable. -
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()Returns Spring application context used as the backend for this container. -
hasException
public boolean hasException() -
getException
-