GateIn WCM is deployed as a web application using wcm.war artifact.
GateIn WCM is a Java EE application, so it needs JBoss AS to be deployed.
Storage requeriments are:
- DataSource for all wcm domain information and metadata.
- Filesystem for binary uploads.
This chapter will describe configuration aspects introduced earlier in 1. Getting Started.
GateIn WCM uses EJB3 entities as technology to access backend.
It uses standard javax.persistence.* classes configured via persistence.xml file.
By default, jndi-name for wcm datasource should be "java:jboss/datasources/wcmDS" as described in the following example:
But, this name can be changed modifying expected datasource in the persistence.xml file defined under
GateIn WCM has been developed against H2 database included in GateIn / JBoss Portal for demo porpuses.
There is not specific code related to database as all org.gatein.wcm.domain.* classes uses EJB3 entities to access backend, so other databases should work without issues.
Package org.gatein.wcm.domain contains main ORM mapping annotations, all annotations used are standard and supported in major databases.
Persistence unit configuration defines datasource name and cache configuration.
GateIn WCM has an extensive use of second level cache.
Ratio read / per write operations can be very high, so for performance reason, cache helps to not impact on database access for mostly reading operations.
Also cache configuration is managed by JBoss AS instead to be managed by application.
JBoss AS uses Infinispan as cache subsystem.
Cache configuration for EJB3 entities are defined in the following fragment:
GateIn WCM also needs a wcm.properties file placed in JBoss AS configuration folder with the following options:
GateIn WCM can be deployed in a clustering environment as well as any Java EE application.
There are three aspects to take into consideration:
- Database should be shared accross JBoss AS nodes.
- Filesystem used should be shared accross JBoss AS nodes.
- Infinispan used for 2nd level cache of EJB3 entities should be configured in clustered/distributed mode instead of local to avoid non-sync data between database and cache.