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
Constructors Constructor Description 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, com.atlassian.bandana.BandanaManager bandanaManager, SynchronyEnvironmentBuilder synchronyEnvironmentBuilder, SynchronyProcessBuilder synchronyProcessBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
destroy()
Map<String,String>
getConfiguration()
Returns a map containing various configuration information.String
getSynchronyProperty(SynchronyEnv env)
Returns the configured environment value for the provided key.boolean
isSynchronyClusterManuallyManaged()
Returnstrue
if external Synchrony cluster is used, andfalse
if Confluence manages Synchrony cluster on its own.boolean
isSynchronyOff()
Returnstrue
if synchrony is switched off (for example, by admin), andfalse
otherwise.boolean
isSynchronyStartingUp()
Determines if the Synchrony that Confluence uses to connect to is in the process of starting up.void
onCollabEditingModeChangedEvent(ClusterEventWrapper eventWrapper)
io.atlassian.util.concurrent.Promise<Boolean>
restart()
Shuts down and then starts up the Synchrony process.void
setSynchronyOff(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.boolean
stop()
Terminates the Synchrony process.
-
-
-
Constructor Detail
-
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, com.atlassian.bandana.BandanaManager bandanaManager, SynchronyEnvironmentBuilder synchronyEnvironmentBuilder, SynchronyProcessBuilder synchronyProcessBuilder)
-
-
Method Detail
-
getConfiguration
public Map<String,String> getConfiguration()
Description copied from interface:SynchronyProcessManager
Returns a map containing various configuration information.- Specified by:
getConfiguration
in interfaceSynchronyProcessManager
-
getSynchronyProperty
public String getSynchronyProperty(SynchronyEnv env)
Description copied from interface:SynchronyProcessManager
Returns the configured environment value for the provided key.- Specified by:
getSynchronyProperty
in interfaceSynchronyProcessManager
- Parameters:
env
- the key that will be looked up- Returns:
- the configured environment property
-
isSynchronyStartingUp
public boolean isSynchronyStartingUp()
Description copied from interface:SynchronyProcessManager
Determines if the Synchrony that Confluence uses to connect to is in the process of starting up.- Specified by:
isSynchronyStartingUp
in interfaceSynchronyProcessManager
- Returns:
- true iff Synchrony is starting up and has not encountered an error.
-
isSynchronyClusterManuallyManaged
public boolean isSynchronyClusterManuallyManaged()
Description copied from interface:SynchronyProcessManager
Returnstrue
if external Synchrony cluster is used, andfalse
if Confluence manages Synchrony cluster on its own. External Synchrony cluster can run only for Confluence DC, whensynchrony.service.url
environmental variable is set.- Specified by:
isSynchronyClusterManuallyManaged
in interfaceSynchronyProcessManager
- Returns:
true
if external Synchrony cluster is used, andfalse
if Confluence manage Synchrony cluster on its own.
-
isSynchronyOff
public boolean isSynchronyOff()
Description copied from interface:SynchronyProcessManager
Returnstrue
if synchrony is switched off (for example, by admin), andfalse
otherwise. This method only checks on/off settings, and ignores state returned bySynchronyProcessManager.isSynchronyClusterManuallyManaged()
- Specified by:
isSynchronyOff
in interfaceSynchronyProcessManager
- Returns:
true
if synchrony is switched off, andfalse
otherwise.
-
setSynchronyOff
public void setSynchronyOff(boolean off)
Description copied from interface:SynchronyProcessManager
Sets flag to the database, which indicates if synchrony should run as external process, and represents results of the admin actions.- Specified by:
setSynchronyOff
in interfaceSynchronyProcessManager
- Parameters:
off
-true
if Synchrony should be disabled, andfalse
if Synchrony should be enabled.
-
startup
public io.atlassian.util.concurrent.Promise<Boolean> startup()
Description copied from interface:SynchronyProcessManager
Starts 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:
startup
in interfaceSynchronyProcessManager
- Returns:
- a promise which resolves to a boolean indicating if startup was successful or not.
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-
stop
public boolean stop()
Description copied from interface:SynchronyProcessManager
Terminates the Synchrony process.- Specified by:
stop
in interfaceSynchronyProcessManager
-
restart
public io.atlassian.util.concurrent.Promise<Boolean> restart()
Description copied from interface:SynchronyProcessManager
Shuts 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:
restart
in interfaceSynchronyProcessManager
- Returns:
- a promise which resolves to a boolean indicating if restart was successful or not.
-
onCollabEditingModeChangedEvent
@EventListener public void onCollabEditingModeChangedEvent(ClusterEventWrapper eventWrapper)
-
-