Configuring Application Framework
You can configure the CentraSite Application Framework via the Configuration object (com.softwareag.centrasite.appl.framework.Configuration).
The following can be configured here:
Bean types managed by CSAF
Persistence mode
Bean mode
Maximum concept cache size
Cache scope
Re-reading of outdated objects
Additionally, the configuration object supports a generic property: key/name pair. It can used to configure any of the above mentioned properties generically.
After the Configuration object has been initialized, it can be passed to the com.softwareag.centrasite.appl.framework.SessionContext.createInstance() method, which creates a SessionContext instance.
This instance can then create com.softwareag.centrasite.appl.framework.persistence.BeanPool instances and can be used for the lifetime of the application.
Bean Types Managed by CSAF
The framework keeps an internal data model for user-defined bean classes, for example, bean classes that extend the com.softwareag.centrasite.appl.framework.beans.RegistryBean interface.
After the bean interfaces have been defined as Java classes having the @RegistryObject annotation, they must be registered by calling the Configuration.addBeanType(java.util.Class) method.
In principle, calling Configuration.addBeanType(java.util.Class) for each bean class is not mandatory, since CSAF tries to process this information (configuration) at runtime when required. Nevertheless, it is still highly recommended because there are cases in which it is not possible to obtain the mapping information at runtime, for example, when performing a search in the registry.
Bean Modes
The framework supports two bean modes: BACKED and SIMPLE (com.softwareag.centrasite.appl.framework.persistence.BeanMode). This mode specifies how the beans interact with the underlying implementation of the API supporting JAXR.
When using the SIMPLE mode, data from the bean is transferred to the registry object only when the user explicitly requests this by calling one of the BeanPool methods (update(), flush(),delete()).
When using the BACKED mode, data from the bean is transferred to the registry object immediately after it is set in the bean. The advantage of this is that extra features such as locking and caching can be used.
Note: SIMPLE mode is deprecated; BACKED mode should always be preferred.
Persistence Modes
The framework supports two persistence modes: FULL and MAP_ONLY. This mode specifies how and whether the data will be persisted in the registry.
When using the FULL mode, the data is entirely persisted in the registry. This is the default mode.
When using the MAP_ONLY mode, the data is not persisted in the registry at all; it is just mapped from the bean to the registry object. It is assumed that the persistence is done outside of the framework. This is used, for example, in a Pluggable UI environment, and applies to any custom extension of the CentraSite UI. In this, the Pluggable UI takes care of storing the object in the registry.
Cache Configuration
Two properties of the caching can be configured: the maximum concept cache size and the cache scope. Both parameters configure the concept mapping cache within the framework.
The default value for the cache size is 1000.
There are two available scopes for the cache:
APPLICATION: There is one cache for the whole application.
SESSION: Each session has its own cache.
Re-reading Outdated Objects
The framework provides support to re-read outdated registry beans automatically. This is controlled by the Configuration.PROP_AUTO_REREAD_OUTDATED_OBJECTS property. Possible values are true and false.
If the property value is set to true then when an outdated object is modified by the system it is automatically re-read from the registry, that is, reverted to the latest state in the database, before applying any changes. Otherwise the user receives the following exception when performing the modification:
com.softwareag.centrasite.appl.framework.persistence.ObjectOutdatedException
Note: If this feature is turned on the current client of CSAF overrides any changes made by another client.