Package com.ibm.jbatch.spi
Class BatchSPIManager
- java.lang.Object
-
- com.ibm.jbatch.spi.BatchSPIManager
-
public final class BatchSPIManager extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBatchSPIManager.PlatformModeA value ofSEsignifies execution on an SE platform, while a value ofEEsignifies execution on an EE platform.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertiesgetBatchContainerOverrideProperties()BatchJobUtilgetBatchJobUtil()BatchSecurityHelpergetBatchSecurityHelper()DatabaseConfigurationBeangetDataBaseConfigurationBean()This is not the method that the jbatch implementation will call to get the final configuration, and lock off further updates.ExecutorServiceProvidergetExecutorServiceProvider()DatabaseConfigurationBeangetFinalDatabaseConfiguration()Called by the core batch runtime at the point when it is ready to harden the database configuration.static BatchSPIManagergetInstance()BatchSPIManager.PlatformModegetPlatformMode()Returns the EEMode set via this SPI, if one has been set.voidregisterBatchContainerOverrideProperties(Properties properties)Override container properties read from META-INFvoidregisterBatchJobUtil(BatchJobUtil helper)May be called at any point and will be immediately reflected in the singleton, i.e.voidregisterBatchSecurityHelper(BatchSecurityHelper helper)May be called at any point and will be immediately reflected in the singleton, i.e.voidregisterDatabaseConfigurationBean(DatabaseConfigurationBean bean)This only will have an impact if the batch container has not already hardened its persistent store database configuration.voidregisterExecutorServiceProvider(ExecutorServiceProvider provider)May be called at any point and will be immediately reflected in the singleton, i.e.voidregisterPlatformMode(BatchSPIManager.PlatformMode mode)Override properties-file based config with programmatic setting of SE or EE platform mode.
-
-
-
Method Detail
-
getInstance
public static BatchSPIManager getInstance()
- Returns:
- singleton instance
-
getBatchJobUtil
public BatchJobUtil getBatchJobUtil()
- Returns:
- The most recently set BatchJobUtil
-
getBatchSecurityHelper
public BatchSecurityHelper getBatchSecurityHelper()
- Returns:
- The most recently set BatchSecurityHelper
-
getPlatformMode
public BatchSPIManager.PlatformMode getPlatformMode()
Returns the EEMode set via this SPI, if one has been set. A value ofTRUEsignifes EE mode while a value ofFALSEsignifies SE mode. Herenullis a significant value since we don't default at this level of config. I.e., anullvalue here means that the mode will be set by some other level of config (possibly defaulting at that level).- Returns:
- the EEMode set via this SPI, or 'null' if one has not been set.
-
getExecutorServiceProvider
public ExecutorServiceProvider getExecutorServiceProvider()
- Returns:
- The most recently set ExecutorServiceProvider
-
getBatchContainerOverrideProperties
public Properties getBatchContainerOverrideProperties()
-
registerBatchJobUtil
public void registerBatchJobUtil(BatchJobUtil helper)
May be called at any point and will be immediately reflected in the singleton, i.e. getBatchJobUtil() will return this.- Parameters:
helper- impl
-
registerBatchSecurityHelper
public void registerBatchSecurityHelper(BatchSecurityHelper helper)
May be called at any point and will be immediately reflected in the singleton, i.e. getBatchSecurityHelper() will return this.- Parameters:
helper- impl
-
registerPlatformMode
public void registerPlatformMode(BatchSPIManager.PlatformMode mode)
Override properties-file based config with programmatic setting of SE or EE platform mode. Note that by not calling this method, we do not get a given default behavior, we simply defer to looking at other config mechanisms (properties files, etc.)- Parameters:
mode- - Configures the batch runtime in EE mode or SE mode.
-
registerExecutorServiceProvider
public void registerExecutorServiceProvider(ExecutorServiceProvider provider)
May be called at any point and will be immediately reflected in the singleton, i.e. getExecutorServiceProvider() will return this.- Parameters:
provider- impl
-
registerBatchContainerOverrideProperties
public void registerBatchContainerOverrideProperties(Properties properties)
Override container properties read from META-INF- Parameters:
properties- ThePropertiesto use as overrides.
-
getDataBaseConfigurationBean
public DatabaseConfigurationBean getDataBaseConfigurationBean()
This is not the method that the jbatch implementation will call to get the final configuration, and lock off further updates. This is just a normal getter which is more use while the configuration is still being set, before it is hardened.- Returns:
- the last-set DatabaseConfigurationBean
- See Also:
getFinalDatabaseConfiguration()
-
registerDatabaseConfigurationBean
public void registerDatabaseConfigurationBean(DatabaseConfigurationBean bean) throws DatabaseAlreadyInitializedException
This only will have an impact if the batch container has not already hardened its persistent store database configuration. There is no ability to dynamically update the configuration, so if this call comes in after the lazy initialization, it is too late.- Parameters:
bean- The batch runtime database configuration to use.- Throws:
DatabaseAlreadyInitializedException- If configuration has already been queried by the batch runtime.
-
getFinalDatabaseConfiguration
public DatabaseConfigurationBean getFinalDatabaseConfiguration()
Called by the core batch runtime at the point when it is ready to harden the database configuration.- Returns:
- The batch runtime database configuration, if set, or null if not set.
-
-