public abstract class App
extends java.lang.Object
VaadinSession
.
getInstance()
static method to obtain the reference to the current App instance.Constructor and Description |
---|
App() |
Modifier and Type | Method and Description |
---|---|
void |
addBackgroundTask(java.util.concurrent.Future task) |
void |
addCookie(java.lang.String name,
java.lang.String value) |
void |
addCookie(java.lang.String name,
java.lang.String value,
int maxAge) |
protected void |
applyTheme(java.lang.String appWindowTheme) |
void |
cleanupBackgroundTasks() |
protected void |
clearSettingsCache() |
protected Connection |
createConnection() |
void |
createTopLevelWindow() |
void |
createTopLevelWindow(AppUI ui)
Called on each browser tab initialization.
|
protected void |
forceLogout() |
AppLog |
getAppLog() |
AppUI |
getAppUI()
Deprecated.
Use
AppUI.getCurrent() instead. |
java.util.List<AppUI> |
getAppUIs() |
Connection |
getConnection() |
int |
getCookieMaxAge(java.lang.String name) |
java.lang.String |
getCookieValue(java.lang.String name) |
ExceptionHandlers |
getExceptionHandlers() |
static App |
getInstance() |
java.util.Locale |
getLocale() |
ThemeConstants |
getThemeConstants() |
RootWindow |
getTopLevelWindow()
Deprecated.
Use
AppUI.getTopLevelWindow() instead |
WebScreens |
getWindowManager()
Deprecated.
Get screens API from
AppUI instead. |
protected void |
init(java.util.Locale requestLocale)
Called when the first UI of the session is initialized.
|
protected void |
initExceptionHandlers(boolean isConnected)
Initializes exception handlers immediately after login and logout.
|
static boolean |
isBound() |
protected ThemeConstants |
loadTheme() |
abstract void |
loginOnStart() |
OperationResult |
logout()
Try to perform logout.
|
void |
logout(java.lang.Runnable runWhenLoggedOut)
Deprecated.
Use
logout() instead. |
void |
navigateTo(java.lang.String topLevelWindowId)
Deprecated.
|
void |
onHeartbeat()
Called from heartbeat request.
|
protected void |
performStandardLogout(AppUI ui) |
void |
recreateUi(AppUI ui)
Sets UserSession from
Connection.getSession()
and re-initializes the given ui . |
void |
removeAllWindows()
Removes all windows from all UIs.
|
protected void |
removeAllWindows(java.util.List<AppUI> uis)
Removes all windows in the given
uis . |
void |
removeBackgroundTask(java.util.concurrent.Future task) |
void |
removeCookie(java.lang.String name) |
protected void |
removeRememberMeTokens() |
protected java.util.Locale |
resolveLocale(java.util.Locale requestLocale) |
protected abstract java.lang.String |
routeTopLevelWindowId() |
void |
setLocale(java.util.Locale locale) |
void |
setUserAppTheme(java.lang.String themeName) |
public static final java.lang.String NAME
public static final java.lang.String USER_SESSION_ATTR
public static final java.lang.String APP_THEME_COOKIE_PREFIX
public static final java.lang.String COOKIE_LOCALE
public static final java.lang.String COOKIE_REMEMBER_ME
public static final java.lang.String COOKIE_LOGIN
public static final java.lang.String COOKIE_PASSWORD
protected AppLog appLog
protected Connection connection
protected ExceptionHandlers exceptionHandlers
@Inject protected GlobalConfig globalConfig
@Inject protected WebConfig webConfig
@Inject protected WebAuthConfig webAuthConfig
@Inject protected WindowConfig windowConfig
@Inject protected ThemeConstantsRepository themeConstantsRepository
@Inject protected UserSessionService userSessionService
@Inject protected UserSessionSource userSessionSource
@Inject protected MessageTools messageTools
@Inject protected SettingsClient settingsClient
@Inject protected Events events
@Inject protected BeanLocator beanLocator
protected AppCookies cookies
protected LinkHandler linkHandler
protected BackgroundTaskManager backgroundTaskManager
protected ThemeConstants themeConstants
protected ThemeConstants loadTheme()
protected void applyTheme(java.lang.String appWindowTheme)
protected void initExceptionHandlers(boolean isConnected)
isConnected
- true after login, false after logout@Deprecated public RootWindow getTopLevelWindow()
AppUI.getTopLevelWindow()
instead@Nullable @Deprecated public AppUI getAppUI()
AppUI.getCurrent()
instead.public ThemeConstants getThemeConstants()
public java.util.List<AppUI> getAppUIs()
public abstract void loginOnStart() throws LoginException
LoginException
protected Connection createConnection()
protected void init(java.util.Locale requestLocale)
protected java.util.Locale resolveLocale(@Nullable java.util.Locale requestLocale)
public void createTopLevelWindow(AppUI ui)
protected abstract java.lang.String routeTopLevelWindowId()
public void createTopLevelWindow()
@Deprecated public void navigateTo(java.lang.String topLevelWindowId)
Screens.create(Class, Screens.LaunchMode)
with OpenMode.ROOT
topLevelWindowId
- target top level window idpublic void onHeartbeat()
public static App getInstance()
java.lang.IllegalStateException
- if no application instance is bound to the current VaadinSession
public static boolean isBound()
App
instance is currently bound and can be safely obtained by getInstance()
public Connection getConnection()
@Deprecated @Nullable public WebScreens getWindowManager()
AppUI
instead.public AppLog getAppLog()
public ExceptionHandlers getExceptionHandlers()
public java.lang.String getCookieValue(java.lang.String name)
public int getCookieMaxAge(java.lang.String name)
public void addCookie(java.lang.String name, java.lang.String value, int maxAge)
public void addCookie(java.lang.String name, java.lang.String value)
public void removeCookie(java.lang.String name)
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public void setUserAppTheme(java.lang.String themeName)
public void addBackgroundTask(java.util.concurrent.Future task)
public void removeBackgroundTask(java.util.concurrent.Future task)
public void cleanupBackgroundTasks()
public void removeAllWindows()
protected void removeAllWindows(java.util.List<AppUI> uis)
uis
.uis
- AppUI
instancespublic void recreateUi(AppUI ui)
Connection.getSession()
and re-initializes the given ui
.protected void clearSettingsCache()
@Deprecated public void logout(@Nullable java.lang.Runnable runWhenLoggedOut)
logout()
instead.runWhenLoggedOut
- runnable that will be invoked if user decides to logoutpublic OperationResult logout()
protected void performStandardLogout(AppUI ui)
protected void forceLogout()
protected void removeRememberMeTokens()