Class DefaultSynchronyProcessManager
java.lang.Object
com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager
- All Implemented Interfaces:
SynchronyProcessManager,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean
@Component("synchronyProcessManager")
public class DefaultSynchronyProcessManager
extends Object
implements SynchronyProcessManager, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
- Since:
- 6.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.confluence.plugins.synchrony.api.SynchronyProcessManager
SynchronyProcessManager.ExternalProcessState -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSynchronyProcessManager(BootstrapManager bootstrapManager, SystemInformationService systemInformationService, com.atlassian.confluence.plugins.synchrony.config.SynchronyConfigurationManager synchronyConfigurationManager, SynchronyMonitor synchronyMonitor, com.atlassian.confluence.plugins.synchrony.bootstrap.SynchronyExecutorServiceProvider executorServiceProvider, ClusterManager clusterManager, SynchronyProxyMonitor synchronyProxyMonitor, com.atlassian.event.api.EventPublisher eventPublisher, BandanaManager bandanaManager, SynchronyEnvironmentBuilder synchronyEnvironmentBuilder, SynchronyProcessBuilder synchronyProcessBuilder) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()Returns a map containing various configuration information.Returns the configured environment value for the provided key.booleanReturnstrueif external Synchrony cluster is used, andfalseif Confluence manages Synchrony cluster on its own.booleanReturnstrueif synchrony is switched off (for example, by admin), andfalseotherwise.booleanDetermines if the Synchrony that Confluence uses to connect to is in the process of starting up.voidonCollabEditingModeChangedEvent(ClusterEventWrapper eventWrapper) io.atlassian.util.concurrent.Promise<Boolean>restart()Shuts down and then starts up the Synchrony process.voidsetSynchronyOff(boolean off) Sets flag to the database, which indicates if synchrony should run as external process, and represents results of the admin actions.io.atlassian.util.concurrent.Promise<Boolean>startup()Starts the Synchrony process and returns aPromise<Boolean>which indicates a if startup was successful or not.booleanstop()Terminates the Synchrony process.
-
Constructor Details
-
DefaultSynchronyProcessManager
@Autowired public DefaultSynchronyProcessManager(BootstrapManager bootstrapManager, SystemInformationService systemInformationService, com.atlassian.confluence.plugins.synchrony.config.SynchronyConfigurationManager synchronyConfigurationManager, SynchronyMonitor synchronyMonitor, com.atlassian.confluence.plugins.synchrony.bootstrap.SynchronyExecutorServiceProvider executorServiceProvider, ClusterManager clusterManager, SynchronyProxyMonitor synchronyProxyMonitor, com.atlassian.event.api.EventPublisher eventPublisher, BandanaManager bandanaManager, SynchronyEnvironmentBuilder synchronyEnvironmentBuilder, SynchronyProcessBuilder synchronyProcessBuilder)
-
-
Method Details
-
getConfiguration
Description copied from interface:SynchronyProcessManagerReturns a map containing various configuration information.- Specified by:
getConfigurationin interfaceSynchronyProcessManager
-
getSynchronyProperty
Description copied from interface:SynchronyProcessManagerReturns the configured environment value for the provided key.- Specified by:
getSynchronyPropertyin interfaceSynchronyProcessManager- Parameters:
env- the key that will be looked up- Returns:
- the configured environment property
-
isSynchronyStartingUp
public boolean isSynchronyStartingUp()Description copied from interface:SynchronyProcessManagerDetermines if the Synchrony that Confluence uses to connect to is in the process of starting up.- Specified by:
isSynchronyStartingUpin interfaceSynchronyProcessManager- Returns:
- true iff Synchrony is starting up and has not encountered an error.
-
isSynchronyClusterManuallyManaged
public boolean isSynchronyClusterManuallyManaged()Description copied from interface:SynchronyProcessManagerReturnstrueif external Synchrony cluster is used, andfalseif Confluence manages Synchrony cluster on its own. External Synchrony cluster can run only for Confluence DC, whensynchrony.service.urlenvironmental variable is set.- Specified by:
isSynchronyClusterManuallyManagedin interfaceSynchronyProcessManager- Returns:
trueif external Synchrony cluster is used, andfalseif Confluence manage Synchrony cluster on its own.
-
isSynchronyOff
public boolean isSynchronyOff()Description copied from interface:SynchronyProcessManagerReturnstrueif synchrony is switched off (for example, by admin), andfalseotherwise. This method only checks on/off settings, and ignores state returned bySynchronyProcessManager.isSynchronyClusterManuallyManaged()- Specified by:
isSynchronyOffin interfaceSynchronyProcessManager- Returns:
trueif synchrony is switched off, andfalseotherwise.
-
setSynchronyOff
public void setSynchronyOff(boolean off) Description copied from interface:SynchronyProcessManagerSets flag to the database, which indicates if synchrony should run as external process, and represents results of the admin actions.- Specified by:
setSynchronyOffin interfaceSynchronyProcessManager- Parameters:
off-trueif Synchrony should be disabled, andfalseif Synchrony should be enabled.
-
startup
Description copied from interface:SynchronyProcessManagerStarts the Synchrony process and returns aPromise<Boolean>which indicates a if startup was successful or not. If the promise resolves to true, the Synchrony process should be ready to serve requests.- Specified by:
startupin interfaceSynchronyProcessManager- Returns:
- a promise which resolves to a boolean indicating if startup was successful or not.
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
stop
public boolean stop()Description copied from interface:SynchronyProcessManagerTerminates the Synchrony process.- Specified by:
stopin interfaceSynchronyProcessManager
-
restart
Description copied from interface:SynchronyProcessManagerShuts down and then starts up the Synchrony process. This is effectively the same as callingSynchronyProcessManager.stop()and thenSynchronyProcessManager.startup(). However, this method waits forExternalProcess.isAlive()to return false in between stopping and starting.- Specified by:
restartin interfaceSynchronyProcessManager- Returns:
- a promise which resolves to a boolean indicating if restart was successful or not.
-
onCollabEditingModeChangedEvent
-