Package de.hybris.platform.core
Class SlaveTenant
- java.lang.Object
-
- de.hybris.platform.core.AbstractTenant
-
- de.hybris.platform.core.SlaveTenant
-
- All Implemented Interfaces:
DataSourceProvider
,Tenant
,java.io.Serializable
- Direct Known Subclasses:
TestSlaveTenantStub
public class SlaveTenant extends AbstractTenant
The slave tenant represents any other tenant exept the master tenant. Each hybris installation contains one master tenant and none/some slave tenants. TODO: apidoc - add missing informations- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.core.AbstractTenant
AbstractTenant.CodeWrapper, AbstractTenant.DataSourceHolder, AbstractTenant.DataSourceSelection, AbstractTenant.ShutDownMode, AbstractTenant.State, AbstractTenant.TenantNotYetStartedException
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ITEM_CREATION_LIFECYCLE_LISTENER
static java.lang.String
JUNIT_TENANT_ID
-
Fields inherited from class de.hybris.platform.core.AbstractTenant
ALT_DATASOURCE, MASTER_DATASOURCE_ID, SLAVE_DATASOURCE
-
-
Constructor Summary
Constructors Constructor Description SlaveTenant(java.lang.String systemName, java.util.Properties props)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
changeSystemSpecificProps(java.lang.String key, java.lang.String value)
boolean
changeSystemSpecificProps(java.util.Map<java.lang.String,java.lang.String> params)
protected java.util.List<AbstractTenant.DataSourceHolder>
createAlternativeDataSources(DataSourceFactory factory, ConfigIntf cfg, java.util.Collection<HybrisDataSource> createdForRollback)
protected Cache
createCache()
protected java.util.List<java.lang.String>
extractExtNames(java.lang.String cfg)
java.util.List<ItemLifecycleListener>
getAllItemLifecycleListeners()
ConfigIntf
getConfig()
java.lang.String
getDatabaseDriver()
java.lang.String
getDatabaseFromJNDI()
java.lang.String
getDatabasePassword()
java.lang.String
getDatabaseTablePrefix()
java.lang.String
getDatabaseURL()
java.lang.String
getDatabaseUser()
protected MasterTenant
getMasterTenant()
ConfigIntf
getOwnConfig()
java.util.List<java.lang.String>
getTenantSpecificExtensionNames()
java.util.Locale
getTenantSpecificLocale()
Uses either the locale specified in theConfig.SystemSpecificParams.LOCALE
config parameter or, if not set, the vm default locale.java.util.TimeZone
getTenantSpecificTimeZone()
Uses either the time zone specified in theConfig.SystemSpecificParams.TIME_ZONE
config parameter or, if not set, the vm default time zone.boolean
isActive()
boolean
isInitialized()
boolean
isValid()
protected void
relaseAdministrationLockIfNeeded(HybrisDataSource masterDataSource)
Tries to release administration lock if lock was acquired by thisAbstractTenant.getClusterID()
node.protected void
restartIfActive()
Deprecated.since 5.0 use an off-line tenant configurationvoid
setDatabaseSettings(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String driver, java.lang.String tableprefix, java.lang.String fromJNDI)
protected void
setExtNames(java.util.List<java.lang.String> names_unmod)
Sets with the given extension name list the new extensions of the current tenant.void
setTenantSpecificExtensionNames(java.util.List<java.lang.String> names)
Deprecated.since 5.0 modification of the tenant's extension names on the fly is not available.void
shutDown()
void
startUp()
java.lang.String
toString()
void
unInitialize()
Deprecated.since 5.0 favour offline tenant configuration-
Methods inherited from class de.hybris.platform.core.AbstractTenant
activateAlternativeDataSource, activateAlternativeMasterDataSource, activateSlaveDataSource, activateSlaveDataSource, assertTenant, assureTypeSystemStructureIsUpToDate, backgroundThreadFinished, backgroundThreadStarted, cancelForceMasterMode, cannotAccess, cannotConnect, canSwitch, clearConnectionHasBeenBroken, connectionHasBeenBroken, createAlternativeDataSource, createAndRegisterBackgroundThread, createDataSourceFactory, createDataSourceFactory, createDefaultThreadPool, createMasterDataSource, deactivateAlternativeDataSource, deactivateSlaveDataSource, doInitialize, doShutDown, doStartUp, equals, executeInitsIfNecessary, extractCustomDBParams, extractCustomDBParams, extractCustomDBParams, extractCustomDBParams, forceMasterDataSource, getActiveSession, getActiveSessionContextList, getAllAlternativeDataSources, getAllAlternativeMasterDataSourceIDs, getAllAlternativeMasterDataSources, getAllAlterntiveDataSourceIDs, getAllDataSourceIDs, getAllSlaveDataSourceIDs, getAllSlaveDataSources, getCache, getClusterID, getCurrentTenant, getDataSource, getDataSource, getDynamicClusterNodeID, getInvalidationManager, getJaloConnection, getMasterDataSource, getNextSlave, getPersistenceManager, getPersistencePool, getSerialNumberGenerator, getSingletonCreator, getState, getStateInfo, getSystemEJB, getTenantID, getTenantRestartMarker, getThreadPool, getWorkersThreadPool, hashCode, initializeCache, isAlternativeMasterDataSource, isClusteringEnabled, isForceMaster, isNotifiyingListeners, isSlaveDataSource, isStarting, isStopping, mergeSlaveDataSourceParameter, performWithinOwnSystem, readParameters, resetTenantRestartMarker, setActiveSessionForCurrentThread, setState, setSystemInit, setTenantID, shutdownCache, writeReplace
-
-
-
-
Field Detail
-
JUNIT_TENANT_ID
public static final java.lang.String JUNIT_TENANT_ID
- See Also:
- Constant Field Values
-
ITEM_CREATION_LIFECYCLE_LISTENER
public static final java.lang.String ITEM_CREATION_LIFECYCLE_LISTENER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMasterTenant
protected MasterTenant getMasterTenant()
-
createAlternativeDataSources
protected java.util.List<AbstractTenant.DataSourceHolder> createAlternativeDataSources(DataSourceFactory factory, ConfigIntf cfg, java.util.Collection<HybrisDataSource> createdForRollback)
- Overrides:
createAlternativeDataSources
in classAbstractTenant
-
relaseAdministrationLockIfNeeded
protected void relaseAdministrationLockIfNeeded(HybrisDataSource masterDataSource)
Description copied from class:AbstractTenant
Tries to release administration lock if lock was acquired by thisAbstractTenant.getClusterID()
node.- Overrides:
relaseAdministrationLockIfNeeded
in classAbstractTenant
-
extractExtNames
protected java.util.List<java.lang.String> extractExtNames(java.lang.String cfg)
-
setExtNames
protected void setExtNames(java.util.List<java.lang.String> names_unmod)
Sets with the given extension name list the new extensions of the current tenant. If the current tenant is already initialized than the given list must contain all installed extensions and maybe new extensions. If an extension name is missing (meaning the extension should be removed and the tenant is initialized) an IllegalStateException is thrown. Any required but missing extension is added automatically.- Parameters:
names_unmod
- the list of extension names
-
createCache
protected Cache createCache()
- Overrides:
createCache
in classAbstractTenant
-
unInitialize
@Deprecated public void unInitialize()
Deprecated.since 5.0 favour offline tenant configuration
-
isInitialized
public boolean isInitialized()
- Returns:
- true if the slave system is initialized
-
changeSystemSpecificProps
public boolean changeSystemSpecificProps(java.lang.String key, java.lang.String value)
-
changeSystemSpecificProps
public boolean changeSystemSpecificProps(java.util.Map<java.lang.String,java.lang.String> params)
- Parameters:
params
-
-
isActive
public boolean isActive()
-
isValid
public boolean isValid()
-
shutDown
public void shutDown()
- Specified by:
shutDown
in classAbstractTenant
-
startUp
public void startUp()
- Specified by:
startUp
in classAbstractTenant
-
setDatabaseSettings
public void setDatabaseSettings(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String driver, java.lang.String tableprefix, java.lang.String fromJNDI)
-
restartIfActive
@Deprecated protected void restartIfActive()
Deprecated.since 5.0 use an off-line tenant configuration
-
getDatabaseURL
public java.lang.String getDatabaseURL()
-
getDatabaseUser
public java.lang.String getDatabaseUser()
-
getDatabaseDriver
public java.lang.String getDatabaseDriver()
-
getDatabasePassword
public java.lang.String getDatabasePassword()
-
getDatabaseTablePrefix
public java.lang.String getDatabaseTablePrefix()
-
getDatabaseFromJNDI
public java.lang.String getDatabaseFromJNDI()
-
getOwnConfig
public ConfigIntf getOwnConfig()
-
getTenantSpecificExtensionNames
public java.util.List<java.lang.String> getTenantSpecificExtensionNames()
- Specified by:
getTenantSpecificExtensionNames
in interfaceTenant
- Specified by:
getTenantSpecificExtensionNames
in classAbstractTenant
-
setTenantSpecificExtensionNames
@Deprecated public void setTenantSpecificExtensionNames(java.util.List<java.lang.String> names)
Deprecated.since 5.0 modification of the tenant's extension names on the fly is not available.
-
getTenantSpecificLocale
public java.util.Locale getTenantSpecificLocale()
Uses either the locale specified in theConfig.SystemSpecificParams.LOCALE
config parameter or, if not set, the vm default locale.- See Also:
Tenant.getTenantSpecificLocale()
-
getTenantSpecificTimeZone
public java.util.TimeZone getTenantSpecificTimeZone()
Uses either the time zone specified in theConfig.SystemSpecificParams.TIME_ZONE
config parameter or, if not set, the vm default time zone.- See Also:
Tenant.getTenantSpecificTimeZone()
-
getConfig
public ConfigIntf getConfig()
- Specified by:
getConfig
in interfaceTenant
- Specified by:
getConfig
in classAbstractTenant
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractTenant
-
getAllItemLifecycleListeners
public java.util.List<ItemLifecycleListener> getAllItemLifecycleListeners()
-
-