Search in sources :

Example 11 with WebConfig

use of com.haulmont.cuba.web.WebConfig in project cuba by cuba-platform.

the class WebBackgroundWorker method createThreadPoolExecutor.

protected void createThreadPoolExecutor() {
    if (executorService != null) {
        return;
    }
    WebConfig webConfig = configuration.getConfig(WebConfig.class);
    this.executorService = new ThreadPoolExecutor(webConfig.getMinBackgroundThreadsCount(), webConfig.getMaxActiveBackgroundTasksCount(), 10L, TimeUnit.MINUTES, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder().setNameFormat(THREAD_NAME_PREFIX + "%d").build());
}
Also used : WebConfig(com.haulmont.cuba.web.WebConfig) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder)

Example 12 with WebConfig

use of com.haulmont.cuba.web.WebConfig in project cuba by cuba-platform.

the class WebAbstractTable method setClientCaching.

protected void setClientCaching(T component) {
    Configuration configuration = AppBeans.get(Configuration.NAME);
    WebConfig webConfig = configuration.getConfig(WebConfig.class);
    double cacheRate = webConfig.getTableCacheRate();
    if (cacheRate >= 0) {
        component.setCacheRate(cacheRate);
    }
    int pageLength = webConfig.getTablePageLength();
    if (pageLength >= 0) {
        component.setPageLength(pageLength);
    }
}
Also used : WebConfig(com.haulmont.cuba.web.WebConfig)

Aggregations

WebConfig (com.haulmont.cuba.web.WebConfig)12 Configuration (com.haulmont.cuba.core.global.Configuration)6 ThemeConstants (com.haulmont.cuba.gui.theme.ThemeConstants)3 VersionedThemeResource (com.haulmont.cuba.web.toolkit.VersionedThemeResource)3 FileResource (com.vaadin.server.FileResource)2 Resource (com.vaadin.server.Resource)2 File (java.io.File)2 IOException (java.io.IOException)2 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 FileStorageException (com.haulmont.cuba.core.global.FileStorageException)1 GlobalConfig (com.haulmont.cuba.core.global.GlobalConfig)1 Messages (com.haulmont.cuba.core.global.Messages)1 ThemeConstantsRepository (com.haulmont.cuba.gui.theme.ThemeConstantsRepository)1 FileUploadingAPI (com.haulmont.cuba.gui.upload.FileUploadingAPI)1 WebWindowManager (com.haulmont.cuba.web.WebWindowManager)1 CubaAuthProvider (com.haulmont.cuba.web.auth.CubaAuthProvider)1 WebAuthConfig (com.haulmont.cuba.web.auth.WebAuthConfig)1 HttpRequestFilter (com.haulmont.cuba.web.security.HttpRequestFilter)1 CubaFileDownloader (com.haulmont.cuba.web.toolkit.ui.CubaFileDownloader)1 CubaMultiUpload (com.haulmont.cuba.web.toolkit.ui.CubaMultiUpload)1