Management of the eXo Platform resources is critical for production usage.
The eXo Platform product is exposed as a manageable set of resources that can be inspected at runtime to monitor and manage servers.
When it comes to Java, the Java Management Extension (also known as JMX) is the de-facto standard to expose managed resources externally.
This chapter explains the various resources provided by the eXo Platform server, and management actions which can be performed, and how to obtain relevant metrics.
Resource management is exposed via the JMX layer. eXo Platform registers a set of MBean entities in an MBeanServer.
At runtime, the MBeans are registered by the eXo Kernel in the MBeanServer, which the application server creates, and the MBeans are directly viewable in the JMX console. However, we do advocate using a better JMX client such as the JVisualVM, available since Java 6.
In order to enable JMX monitoring in Tomcat, you need to pass the following system property to the VM: -Dcom.sun.management.jmxremote
The built-in REST Management Provider of GateIn makes some of the MBeans operations accessible as REST endpoints. Administrators can handle the system simply with a browser without performing any complex configurations.
Only members of the platform/administrators group are given permission to work on the REST management. The authentication requires login/password of the user's account.
The base URL to access the REST endpoints is http://localhost:8080/rest/management, with the last one followed by the parameter parsed in the managed resource's @RESTEndpoint annotation, leading slash then targeted operation. Consider the SkinService, which is annotated @RESTEndpoint("skinservice"); the full URL to access JMX 'getSkinList' method through the REST request is http://localhost:8080/rest/management/skinservice/getSkinList.
PortalContainer manages all objects and configurations for a given portal. The JMX name is exo:container=portal,name="portal".
configurationXML: provides the effective runtime configuration calculated by the loading mechanism. URLs used to load parts are indicated to help.
registeredComponentNames: provides the list of all components registered.
Cache is essential for improving the performance of a server infrastructure.
Each cache is exposed and provides statistics and management operations. The JMX name of each cache MBean uses the template exo:service=cache,name=CacheName where CacheName is the name of the cache.
| Attribute | Description |
|---|---|
Capacity
| the maximum capacity of the cache |
HitCount
| the number of times the cache was successfully queried |
MissCount
| the number of times the cache was queried without success |
Size
| gives the number of entries in the cache |
TimeToLive
| attribute gives the maximum lifetime that an entry is considered valid. A value of {{-1 means that the entries will never become stale
|
| Operation | Description |
|---|---|
clearCache()
| evicts all the entries from the cache. It can be used to force a programmatic flush of the cache |
The cache service manages the different caches. The JMX name is exo:service=cachemanager.
| Operation | Description |
|---|---|
clearCaches()
| force a programmatic flush of all the registered caches |
PicketLink is the default implementation for the organization model. It uses its own cache JMX management interface under the name exo:portal="portal",service=PicketLinkIDMCacheService,name=plidmcache.
invalidateAll(): invalidate all caches invalidate(namespace): invalidates a specific cache namespace
WCM provides a management view for:
The WCM Composer is responsible for assembling the pages, and is key for serving pages efficiently. The JMX name is exo:portal="portal",service=composer,view=portal,type=content
Cached: whether the cache is used or not.
CachedEntries: how many nodes are in the cache.
cleanTemplates(): cleans all templates in the cache.
setCached(cached): enables/disables caching in the composer.
Portlet containers provide a management view that mainly consists of statistic exposure. The JMX name of a portlet container follows this template: exo:application="Application",portlet="Portlet" where Application is the name of web application and Portlet is the portlet name in the web application.
Each portlet container has a corresponding managed resource that exposes statistics as attributes. The Portlet lifecycle has several phases (named action, event, render and resource). These are particular operations that a portlet can execute, and each is monitored.
| Attribute | Description |
|---|---|
ActionCount, EventCount, RenderCount and ResourceCount
| the number of executions of a particular portlet phase |
MeanActionTime, MeanEventTime, MeanRenderCount and MeanResourceCount
| the average time spent during the execution of a particular portlet phase |
MaxActionTime, MaxventTime, MaxRenderCount and MaxResourceCount
| the maximum time spent during the execution of a particular portlet phase |
MinActionTime, MinEventTime, MinRenderCount and MinResourceCount
| the minimum time spent during the execution of a particular portlet phase |
The portal management exposes the portal resources either for management or for obtaining statistics.
The template management exposes the various templates used by the portal and its components to render markup. Various statistics are available for individual templates, and aggregated statistics, such as the list of the slowest templates. Most of the management operations are performed on a single template; those operations take the template identifier as an argument. The JMX name of the template statistics MBean follows the template: exo:view=portal,service=statistic,type=template.
| Attribute | Description |
|---|---|
TemplateList
| the list of the templates loaded |
SlowestTemplates
| the list of the 10 slowest templates |
MostExecutedTemplates
| the list of the 10 most used templates |
FastestTemplates
| list of the 10 fastest templates |
| Operation | Description |
|---|---|
getAverageTime(templateId)
| returns the average time spent in the specified template |
getExecutionCount(templateId)
| returns the number of times the specified template has been executed |
getMinTime(templateId)
| returns the minimum time spent in the specified template |
getMaxTime(templateId)
| returns the maximum time spent in the specified template |
Template management provides the capability to force the reload of a specified template. The JMX name of the template management MBean follows the template exo:view=portal,service=management,type=template.
| Operation | Description |
|---|---|
reload(templateId)
| reloads a specified template. The reload() operation reloads all the templates |
| Attribute | Description |
|---|---|
SkinList
| the list of the loaded skins by the skin service |
| Operation | Description |
|---|---|
reloadAll(skinId)
| forces a reload of the specified skin and the operation reloadSkins() forces a reload of the loaded skins |
Token (sometimes called the security token or authentication token) is an object that caches identity or profiles to authorize users. It will be used in authentication to increase the information security. You, as an administrator, can create, delete, retrieve or clean tokens. For example, instead of signing in with your username and password when accessing a site, you only need to login for the first time with the token. After the client's token has been sent, the authentication will be processed from the server.
eXo Platform provides several token store mechanisms via implementing the TokenStore interface. The TokenStore interface has TWO methods, including createToken and validateToken.
The createToken method is to create and return a token which will be retained until it is removed or its validity period is expired.
The validateToken method is to validate the created token. If the token is valid, this method will return the attached credentials. The token will be removed if the removal argument is set to "true" or if the token is no longer valid.
All token services used in eXo Platform must be implemented by sub-classing AbstractTokenService.
The token service will initialize the validity property by retrieving init-params named as "service.configuration.
<component>
<key>org.exoplatform.web.security.security.CookieTokenService</key>
<type>org.exoplatform.web.security.security.CookieTokenService</type>
<init-params>
<values-param>
<name>service.configuration</name>
<value>jcr-token</value>
<value>7</value>
<value>DAY</value>
<value>autologin</value>
</values-param>
</init-params>
</component>
The token will be deleted when it is invalid or when any removal is set programmatically.
Currently, eXo Platform only provides TWO types of token store services, including CookieTokenService and TransientTokenService.
CookieTokenService provides a mechanism of token store to JCR via the Chromattic project. This service stores a token into the defined node in JCR. Thus, you must put the Chromattic lifecycle name when initializing this service. The token is only removed if the database, where the token is stored, is cleaned.
TransientTokenService puts a token into the temporary memory. The token will be removed once the server has been stopped.
All services extending AbstractTokenService can become TokenStore services if you define them as components. For example:
<component>
<key>org.exoplatform.web.security.security.TransientTokenService</key>
<type>org.exoplatform.web.security.security.TransientTokenService</type>
<init-params>
<values-param>
<name>service.configuration</name>
<value>memory-token</value> [1]
<value>1</value> [2]
<value>MINUTE</value> [3]
</values-param>
</init-params>
</component>
In which, the token service will initialize by retrieving init-params named as "service.configuration" and the validity property must include THREE values:
1: Service name.
2: Amount of time.
3: Timing unit.
In the above code, the service name is "memory-token" and the token will be expired after ONE minute.
eXo Platform supports FOUR timing units, including SECOND, MINUTE, HOUR, DAY.
The AbstractTokenService has some methods, such as:
"getToken(K id) : T" returns the token with the token id.
"deleteToken(K id) : T" deletes the token with the id and returns the deleted token value.
"getAllTokens() : K[ ]" returns all tokens stored in data.
"createToken(Credentials credentials) : void" creates a token with the defined credential which is an immutable object containing username and password.
"validateToken(String tokenKey, boolean remove) : Credentials" validates a token. If the token is valid, it returns the attached credential.
The JMX name of the portal statistics MBean follows the template exo:view=portal,service=statistic,type=portal.
| Attribute | Description |
|---|---|
PortalList
| returns the list of the loaded portals |
| Operation | Description |
|---|---|
getThroughput(portalId)
| returns the number of request per second for a specified portal |
getAverageTime(portalId)
| returns the average time spent in a specified portal |
getExecutionCount(portalId)
| returns the number of times a specified portal has been executed |
getMinTime(portalId)
| returns the minimum time spent in the specified portal |
getMaxTime(portalId)
| returns the maximum time spent in the specified portal |
Various applications are exposed to provide relevant statistics. The JMX name of the application statistics MBean follows the template: exo:view=portal,service=statistics,type=application.
| Attribute | Description |
|---|---|
ApplicationList
| returns the list of the loaded applications |
SlowestApplications
| returns the list of the 10 slowest applications |
MostExecutedApplications
| returns the list of the 10 most executed applications |
FastestApplications
| returns the list of the 10 fastest applications |
| Operation | Description |
|---|---|
getAverageTime(applicationId)
| returns the average time spent in the specified application |
getExecutionCount(applicationId)
| returns the number of times the specified application has been executed |
getMinTime(applicationId)
| returns the minimum time spent in the specified application |
getMaxTime(applicationId)
| returns the maximum time spent in the specified application |