Package org.eclnt.jsfserver.session
Class UsageWithoutSessionContext
java.lang.Object
org.eclnt.jsfserver.session.UsageWithoutSessionContext
In case of e.g. testing server side functions you want the CaptainCasa
Server side framework to behave "tolerant" when it comes to accessing
information that normally resides within the session environment of the
server side processing.
Example: the
By using method
Please pay attention: you NEVER should use this function within a normal server environment, because it hides certain error messages, that by default indicate problems you should be aware of!
Example: the
Statusbar
processing depends on the availablilty of
a central status bar instance within the current session.By using method
initUsageWithoutSessionContext()
you can switch
on this "tolerance".Please pay attention: you NEVER should use this function within a normal server environment, because it hides certain error messages, that by default indicate problems you should be aware of!
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Find webcontent directory.static javax.servlet.http.HttpSession
getDummyHttpSession
(boolean createIfNotExists) Internal use only.static DefaultScreens.SessionAccess
Internal use only.static SessionInfo
Internal use only.static SubpageContext
static String
Functions may require access to files that are stored in the servlet temp directory at runtime.static String
Functions may require access to files that are part of the webcontent at runtime.static void
Initializes the Java environment, so that it is "tolerant" against missing information, that normally resides on session level.static void
Switch back method forinitCurrentThreadWithoutSessionContext()
.static void
Initializes the Java environment, so that it is "tolerant" against missing information, that normally resides on session level.static void
Ends the special mode, that was opened withinitUsageWithoutSessionContext()
.static boolean
Check if current processing runs without session context - which means: current processing runs in test mode.static boolean
Check if current processing runs with session context - which means: current processing runs in normal server mode.static void
Internal use only.
Delegates the error by default - and hides it if running in mode "usage without session context".static void
setServletTempDirectory
(String servletTempDirectory) static void
Functions may require access to the session info also when being used/tested outside the session context.static void
setWebcontentDirectory
(String webcontentDirectory)
-
Constructor Details
-
UsageWithoutSessionContext
public UsageWithoutSessionContext()
-
-
Method Details
-
initUsageWithoutSessionContext
public static void initUsageWithoutSessionContext()Initializes the Java environment, so that it is "tolerant" against missing information, that normally resides on session level. The information is stored in some static variable, so that the whole Java process now is used without session context. -
initUsageWithSessionContext
public static void initUsageWithSessionContext()Ends the special mode, that was opened withinitUsageWithoutSessionContext()
. -
initCurrentThreadWithoutSessionContext
public static void initCurrentThreadWithoutSessionContext()Initializes the Java environment, so that it is "tolerant" against missing information, that normally resides on session level. The information is stored on thread level. -
initCurrentThreadWithSessionContext
public static void initCurrentThreadWithSessionContext()Switch back method forinitCurrentThreadWithoutSessionContext()
. -
isUsedWithSessionContext
public static boolean isUsedWithSessionContext()Check if current processing runs with session context - which means: current processing runs in normal server mode. There is no test processing. -
isUsedWithoutSessionContext
public static boolean isUsedWithoutSessionContext()Check if current processing runs without session context - which means: current processing runs in test mode. -
getDummySessionInfo
Internal use only. -
setSessionInfo
Functions may require access to the session info also when being used/tested outside the session context. With this function you can set the SessionInfo-instance that is used is session information is requested. -
getDummySessionAccess
Internal use only. -
getDummyHttpSession
public static javax.servlet.http.HttpSession getDummyHttpSession(boolean createIfNotExists) Internal use only. -
getDummySubpageContext
-
processThrowable
Internal use only.
Delegates the error by default - and hides it if running in mode "usage without session context". -
getWebcontentDirectory
Functions may require access to files that are part of the webcontent at runtime. You can pass here the name of a directory in which to look for these files directly.- Returns:
-
setWebcontentDirectory
-
getServletTempDirectory
Functions may require access to files that are stored in the servlet temp directory at runtime. You can pass here a name of a directory in which to look for these files directly.- Returns:
-
setServletTempDirectory
-
findWebcontentDirectory
Find webcontent directory. If an explicit directory is set viasetWebcontentDirectory(String)
, then this is the one returned.
Otherwise: if a system property value is available via "usagewithoutsessioncontext.webcontent.dir" then this directory is used.
Otherwise: null is returned
-