GigaSpaces XAP 9.7.2 API

org.openspaces.pu.container.standalone
Class StandaloneContainerRunnable

java.lang.Object
  extended by org.openspaces.pu.container.standalone.StandaloneContainerRunnable
All Implemented Interfaces:
Runnable

public class StandaloneContainerRunnable
extends Object
implements 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
StandaloneContainerRunnable(BeanLevelProperties beanLevelProperties, ClusterInfo clusterInfo, List<String> configLocations)
          Constructs a new standalone container runnable based on the provided configuration set parameters.
 
Method Summary
 ApplicationContext getApplicationContext()
          Returns Spring application context used as the backend for this container.
 Throwable getException()
           
 boolean hasException()
           
 boolean isInitialized()
          Returns true if the application context initialized successfully.
 boolean isRunning()
          Return true if this runnable is currently running.
 void run()
          Constructs a new Spring ApplicationContext based on the configured list of config locations.
 void stop()
          Stop this currently running container runnable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 context
clusterInfo - The cluster info configuration
configLocations - List of config locations (string based)
Method Detail

run

public void run()
Constructs a new Spring ApplicationContext based on the configured list of config locations. Also uses the provided ClusterInfo and BeanLevelProperties in order to further config the application context.

Specified by:
run in interface Runnable

isInitialized

public boolean isInitialized()
Returns true if the application context initialized successfully.


isRunning

public boolean isRunning()
Return true if this runnable is currently running.


stop

public void stop()
Stop this currently running container runnable.


getApplicationContext

public ApplicationContext getApplicationContext()
Returns Spring application context used as the backend for this container.


hasException

public boolean hasException()

getException

public Throwable getException()

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.