Package org.apache.ofbiz.webapp
Class WebAppCache
java.lang.Object
org.apache.ofbiz.webapp.WebAppCache
Cache for web applications information retrieved from
component configurations.
This improves performance by avoiding to retrieve web applications from component configurations each time.
This is a cache which doesn't implement any invalidation mechanism. Once a web applications is defined, it is memoized because it is not meant to change while OFBiz is running.
- See Also:
-
Constructor Summary
ConstructorDescriptionWebAppCache
(Supplier<Collection<ComponentConfig>> supplier) Constructs an empty web application cache. -
Method Summary
Modifier and TypeMethodDescriptiongetAppBarWebInfos
(String serverName) Retrieves the web applications information that must be visible in the context of the serverserverName
.getAppBarWebInfos
(String serverName, String menuName) Retrieves the web applications information that must be visible inside the menumenuName
in the context of the serverserverName
.static WebAppCache
Provides access to a shared instance of the webapp cache.getWebappInfo
(String serverName, String webAppName) Retrieves the first web application information which mount point correspond towebAppName
in the context of the serverserverName
.
-
Constructor Details
-
WebAppCache
Constructs an empty web application cache.- Parameters:
supplier
- the source from which components configurations are retrieved
-
-
Method Details
-
getAppBarWebInfos
Retrieves the web applications information that must be visible in the context of the serverserverName
.- Parameters:
serverName
- the name of the server to match- Returns:
- the corresponding web applications information
-
getAppBarWebInfos
Retrieves the web applications information that must be visible inside the menumenuName
in the context of the serverserverName
.When an empty string or
null
is used formenuName
, all the web application information corresponding toserverName
are matched.- Parameters:
serverName
- the name of server to matchmenuName
- the name of the menu to match- Returns:
- the corresponding web applications information
- Throws:
NullPointerException
- whenserverName
isnull
-
getWebappInfo
Retrieves the first web application information which mount point correspond towebAppName
in the context of the serverserverName
.- Parameters:
serverName
- the name of the server to matchwebAppName
- the name of the web application to match- Returns:
- the corresponding web application information
- Throws:
NullPointerException
- whenserverName
isnull
-