Package com.vaadin.collaborationengine
Class CollaborationEngineConfiguration
java.lang.Object
com.vaadin.collaborationengine.CollaborationEngineConfiguration
Configuration object for
CollaborationEngine. When running in
production mode, it is required to set this configuration for the
Collaboration Engine associated with the current VaadinService. This
should be done by calling
CollaborationEngine.configure(VaadinService, CollaborationEngineConfiguration)
in a VaadinServiceInitListener.- Since:
- 3.0
- Author:
- Vaadin Ltd
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Collaboration Engine configuration. -
Method Summary
Modifier and TypeMethodDescriptionGets the configured backend implementation.Gets the configured beacon path.Gets the configuredExecutorServicewhich will be used to dispatch actions asynchronously.booleanChecks whether automatic push activation is enabled.voidsetAutomaticallyActivatePush(boolean automaticallyActivatePush) Sets whether server push should be automatically activated if needed.voidsetBackend(Backend backend) Sets the backend implementation to use.voidsetBeaconPath(String beaconPath) Sets the path that is used for the beacon handler.voidsetExecutorService(ExecutorService executorService) Sets theExecutorServicewhich will be used to dispatch actions asynchronously.
-
Constructor Details
-
CollaborationEngineConfiguration
public CollaborationEngineConfiguration()Creates a new Collaboration Engine configuration.
-
-
Method Details
-
getBeaconPath
Gets the configured beacon path.- Returns:
- the beacon path
-
setBeaconPath
Sets the path that is used for the beacon handler. This is used to detect when the user has closed a tab.The beacon path can also be configured by setting the
vaadin.ce.beaconPathsystem property either in the command line or withSystem.setProperty(String, String). If a system property is set, it will take precedence over this setting.- Parameters:
beaconPath- path used by the beacon handler
-
setAutomaticallyActivatePush
public void setAutomaticallyActivatePush(boolean automaticallyActivatePush) Sets whether server push should be automatically activated if needed. When enabled, which is the default, Collaboration Engine will automatically activatePushMode.AUTOMATICif neither push nor polling is active for a UI where CollaborationEngine is used. When disabled, no automatic changes are made to the application's push configuration.- Parameters:
automaticallyActivatePush-trueto automatically activate server push if needed,falseto not make any automatic changes to the push configuration- Since:
- 3.0
-
isAutomaticallyActivatePush
public boolean isAutomaticallyActivatePush()Checks whether automatic push activation is enabled.- Returns:
trueif automatic server push configuration is enabled,falseif it's no enabled- Since:
- 3.0
- See Also:
-
setBackend
Sets the backend implementation to use. A backend can be used to distribute changes between multiple nodes in a cluster. By default, a local in-memory backend is used.This is currently an experimental feature and needs to be explicitly enabled using the Vaadin dev-mode Gizmo, in the experimental features tab, or by adding a
src/main/resources/vaadin-featureflags.propertiesfile with the following content:com.vaadin.experimental.collaborationEngineBackend=true- Parameters:
backend- the backend to use, notnull
-
getBackend
Gets the configured backend implementation.- Returns:
- the backend implementation, not
null - See Also:
-
getExecutorService
Gets the configuredExecutorServicewhich will be used to dispatch actions asynchronously. A custom executor service can be configured withsetExecutorService(ExecutorService).- Returns:
- the configured executor service, or
nullif not set
-
setExecutorService
Sets theExecutorServicewhich will be used to dispatch actions asynchronously. An executor service set with this method won't be shutdown automatically, so the developer should take care of that if needed. If not configured, Collaboration Engine will use a thread pool with a fixed number of threads equal to the number of available processors and will take care of shutting it down.- Parameters:
executorService- the executor service, ornullto remove a previously configured one
-