Pay attention to the following points when considering using Terracotta collaboration to reference an external Terracotta cache from complex event processing rules:
Initial data of the cache
Initial data must be provided for the cache as required.
Select a data format according to the specifications of the Terracotta application for update to be used.
Format of the Terracotta cache
A Terracotta cache must follow a prescribed format.
If an existing cache is to be used, check that it is consistent with "5.5.3.1 Terracotta Cache Compatible Formats".
A Terracotta cache consists of key-value pairs. The cache referenced by BDCEP must have the following configuration:
Type used for the key | Type used for the value |
---|---|
java.lang.String | java.util.HashMap<java.lang.String, java.lang.Object> |
Each property to be specified in a complex event processing rule corresponds to each "HashMap" element above.
The table below shows the type that is compatible for the value of each "HashMap" element and the corresponding type in complex event processing rules.
Type used in each "HashMap" element | Corresponding type in complex event processing rules |
---|---|
java.lang.String | string |
java.lang.Character | char/character |
java.lang.Boolean | bool/boolean |
java.lang.Byte | byte |
java.lang.Short | short |
java.lang.Integer | int/integer |
java.lang.Long | long |
java.lang.Float | float |
java.lang.Double | double |
The Terracotta cache key and "HashMap" to be specified for the value must have the following relationship:
Ensure that the name of the property to be specified as the cache key is the same as the key of the corresponding "HashMap" element.
Set the value of the above "HashMap" element as the value of the cache key.
The following figure illustrates this relationship.
Refer to "5.6.5 Designing a Terracotta Application" for information on the actual method of use.