Eeek wow that is some pretty ugly XML. Are all the
set-properties really needed? How about having one tag with a
bunch of attributes? For example:
<region name="example"
classname="org.apache.jcs.engine.CompositeCacheAttributes"
maxObjects="10">
etc. Along with some inner tags if nec.
The other way is very verbose.
Perhaps use JAXP to map the XML to java classes as well.
Daniel
--- Aaron Smuts <[EMAIL PROTECTED]> wrote:
> I'm working using Digester to configure JCS using xml. I've
> pasted a
> very rough prototype of a jcs.xml configuration file below.
> I'm hoping
> that someone will have some suggestions on how to improve it
> or
> completely redo it. I tend to make ugly xml. Any ideas would
> be
> appreciated.
>
> If we get a basic format, I'll just have the cachemanager call
> a
> different configuration class if the file ends in .xml. This
> should
> keep it backward compatible.
>
> This file does not include the remote server configuration
> yet.
>
> Aaron
>
>
>
------------------------------------------------------------------------
> ---
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!--
> This is the JCS configuration file.
>
> There are two sections to this file.
>
> 1. Regions -- This section identifies what regions will be
> preconfigured.
> Any regions created at runtime will adopt the default
> configuration.
>
> Default -- This attribute identifies a default configuration.
>
> Regions that are not specified in this file will adopt the
> default
> settings.
> The default configuration specifies what auxiliaries to use,
> the
> default region settings (or cacheattributes), and the default
> element
> settings (or element attributes).
> One default is necessary, and only one is allowed.
>
> System -- This attribute identifies the region by which the
> system will
> handle groups.
> One groupid is necessary, and only one is allowed.
>
>
> 2. Auxiliaries -- This section defines the auxiliaries
> available.
> If a region definition or the default configuration references
> an
> auxiliary, it must be included in this section. Auxiliaries
> not
> referenced in the
> region or default configuration sections are ignored.
> Memory managers can be plugged in and are often called
> auxiliaries, but
> they cannot be defined in this section. Memory managers must
> be defined
> in the region or default configuration sections.
>
> -->
>
> <jcs>
>
> <regions>
>
> <!-- One region, but not more than one, must be marked
> default. -->
> <region>
> <name default="true">example</name>
> <auxiliary-list>DC<auxiliary-list/>
> <cache-attributes>
> <set-property
> name="classname"
>
> value="org.apache.jcs.engine.CompositeCacheAttributes" />
> <set-property
> name="MaxObjects"
> value="10" />
> <set-property
> name="MemoryCacheName"
> value="org.apache.jcs.engine.memory.lru.LRUMemoryCache"
> />
> <set-property
> name="UseMemoryShrinker"
> value="false" />
> <set-property
> name="ShrinkerIntervalSeconds"
> value="30" />
> <set-property
> name="MaxMemoryIdleTimeSeconds"
> value="3600000000" />
> </cache-attributes>
> <element-attributes>
> <set-property
> name="classname"
> value="org.apache.jcs.engine.ElementAttributes" />
> <set-property
> name="IsEternal"
> value="true" />
> <set-property
> name="MaxLifeSeconds"
> value="30" />
> <set-property
> name="IsSpool"
> value="true" />
> <set-property
> name="IsRemote"
> value="true" />
> <set-property
> name="IsLateral"
> value="true" />
> </element-attributes>
> </region>
>
>
> <!-- One region, but not more than one, must be marked
> groupid. -->
> <region>
> <name groupid="true">system-group-id</name>
> <auxiliary-list>DC<auxiliary-list/>
> <cache-attributes>
> <set-property
> name="classname"
>
> value="org.apache.jcs.engine.CompositeCacheAttributes" />
> <set-property
> name="MaxObjects"
> value="10" />
> <set-property
> name="MemoryCacheName"
> value="org.apache.jcs.engine.memory.lru.LRUMemoryCache"
> />
> <set-property
> name="UseMemoryShrinker"
> value="false" />
> <set-property
> name="ShrinkerIntervalSeconds"
> value="30" />
> <set-property
> name="MaxMemoryIdleTimeSeconds"
> value="3600000000" />
> </cache-attributes>
> <element-attributes>
> <set-property
> name="classname"
> value="org.apache.jcs.engine.ElementAttributes" />
> <set-property
> name="IsEternal"
> value="true" />
> <set-property
> name="MaxLifeSeconds"
> value="30" />
> <set-property
> name="IsSpool"
> value="true" />
> <set-property
> name="IsRemote"
> value="true" />
> <set-property
> name="IsLateral"
> value="true" />
> </element-attributes>
> </region>
>
>
> <!-- Otptional Regions -->
> <region>
> <name>testCache1</name>
> <auxiliary-list>DC<auxiliary-list/>
> <cache-attributes>
> <set-property
> name="classname"
>
> value="org.apache.jcs.engine.CompositeCacheAttributes" />
> <set-property
> name="MaxObjects"
> value="10" />
> <set-property
> name="MemoryCacheName"
> value="org.apache.jcs.engine.memory.lru.LRUMemoryCache"
> />
> <set-property
> name="UseMemoryShrinker"
> value="false" />
> <set-property
> name="ShrinkerIntervalSeconds"
> value="30" />
> <set-property
> name="MaxMemoryIdleTimeSeconds"
> value="3600000000" />
> </cache-attributes>
> <element-attributes>
> <set-property
> name="classname"
> value="org.apache.jcs.engine.ElementAttributes" />
> <set-property
> name="IsEternal"
> value="true" />
> <set-property
> name="MaxLifeSeconds"
> value="30" />
> <set-property
> name="IsSpool"
> value="true" />
> <set-property
> name="IsRemote"
> value="true" />
> <set-property
> name="IsLateral"
> value="true" />
> </element-attributes>
> </region>
>
> </regions>
>
>
>
> <!-- Auxiliary COnfiguration -->
>
> <auxiliaries>
>
> <!-- Remote RMI cache without failover -->
> <auxiliary>
> <name>RGroup</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.remote.RemoteCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.remote.RemoteCacheAttributes"
> />
> <set-property
> name="RemoteTypeName"
> value="LOCAL" />
> <set-property
> name="RemoteHost"
> value="localhost" />
> <set-property
> name="RemotePort"
> value="1102" />
> <set-property
> name="GetOnly"
> value="true" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <!-- Remote RMI cache with failover -->
> <auxiliary>
> <name>RFailover</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.remote.RemoteCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.remote.RemoteCacheAttributes"
> />
> <set-property
> name="RemoteTypeName"
> value="LOCAL" />
> <set-property
> name="FailoverServers"
> value="localhost:1102" />
> <set-property
> name="GetOnly"
> value="false" />
> </auxiliary-attributes>
> </auxiliary>
>
>
>
> <!-- Primary Disk Cache -->
> <auxiliary>
> <name>DC</name>
> <set-property
> name="classname"
>
>
value="org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
>
value="org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes"
> />
> <set-property
> name="DiskPath"
> value="i:\\dev\\raf" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <!-- HSQL Disk Cache -- too slow -->
> <auxiliary>
> <name>HDC</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.disk.hsql.HSQLCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.disk.hsql.HSQLCacheAttributes"
> />
> <set-property
> name="DiskPath"
> value="i:\\dev\\hsql" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <!-- JISP Disk Cache -- save memory with disk key storage
> -->
> <auxiliary>
> <name>HDC</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.disk.jisp.JISPCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.disk.jisp.JISPCacheAttributes"
> />
> <set-property
> name="DiskPath"
> value="i:\\dev\\jisp" />
> <set-property
> name="ClearOnStart"
> value="false" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <!-- Unreliable Lateral -->
> <auxiliary>
> <name>LUDP</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.lateral.LateralCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
>
value="org.apache.jcs.auxiliary.lateral.LateralCacheAttributes"
> />
> <set-property
> name="TransmissionTypeName"
> value="UDP" />
> <set-property
> name="UdpMulticastAddr"
> value="228.5.6.7" />
> <set-property
> name="UdpMulticastPort"
> value="6789" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <!-- JavaGroups Lateral -->
> <auxiliary>
> <name>LJG</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.lateral.LateralCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
>
value="org.apache.jcs.auxiliary.lateral.LateralCacheAttributes"
> />
> <set-property
> name="TransmissionTypeName"
> value="JAVAGROUPS" />
> <set-property
> name="UdpMulticastAddr"
> value="228.5.6.7" />
> <set-property
> name="UdpMulticastPort"
> value="6789" />
> <set-property
> name="PutOnlyMode"
> value="false" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <!-- Reliable, fast TCP Lateral -->
> <auxiliary>
> <name>LTCP</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.lateral.LateralCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
>
value="org.apache.jcs.auxiliary.lateral.LateralCacheAttributes"
> />
> <set-property
> name="TransmissionTypeName"
> value="TCP" />
> <set-property
> name="TcpServers"
> value="localhost:1111,localhost2:1112" />
> <set-property
> name="TcpListenerPort"
> value="1111" />
> <set-property
> name="PutOnlyMode"
> value="true" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <!-- XMLRPC Lateral -->
> <auxiliary>
> <name>LTCP</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.lateral.LateralCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
>
value="org.apache.jcs.auxiliary.lateral.LateralCacheAttributes"
> />
> <set-property
> name="TransmissionTypeName"
> value="XMLRPC" />
> <set-property
> name="HttpServers"
> value="localhost:8182" />
> <set-property
> name="HttpListenerPort"
> value="8181" />
> <set-property
> name="PutOnlyMode"
> value="false" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <!-- HTTP Lateral -->
> <auxiliary>
> <name>LTCP</name>
> <set-property
> name="classname"
>
> value="org.apache.jcs.auxiliary.lateral.LateralCacheFactory"
> />
> <auxiliary-attributes>
> <set-property
> name="classname"
>
>
value="org.apache.jcs.auxiliary.lateral.LateralCacheAttributes"
> />
> <set-property
> name="TransmissionTypeName"
> value="HTTP" />
> <set-property
> name="HttpServers"
> value="localhost:8080,localhost:7001,localhost:80" />
> <set-property
> name="httpReceiveServlet"
> value="/cache/LateralCacheReceiverServlet" />
> <set-property
> name="httpDeleteServlet"
> value="/cache/DeleteCacheServlet" />
> </auxiliary-attributes>
> </auxiliary>
>
>
> <auxiliaries/>
>
> </jcs>
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�
http://photos.yahoo.com/ph/print_splash
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]