[CVS jcontainer] Clarify some docs
Peter Donald <pdonald-yCVjj/[email protected]> Wed, 31 Mar 2004 00:44:24 -0600
| Newsgroups | gmane.comp.java.jcontainer.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>jcontainer/loom/site/xdocs/reference</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">environment-xml-specification.xml</a></tt></td><td align="right" id="added">+92</td><td align="right" id="removed">-81</td><td nowrap="nowrap" align="center"><a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site/xdocs/reference/environment-xml-specification.xml?rev=1.4&content-type=text/vnd.viewcvs-markup">1.4</a> <a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site/xdocs/reference/environment-xml-specification.xml.diff?r1=1.4&r2=1.5">-></a> <a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site/xdocs/reference/environment-xml-specification.xml?rev=1.5&content-type=text/vnd.viewcvs-markup">1.5</a></td></tr>
</table>
<pre class="comment">
Clarify some docs
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://xstream.cvs.codehaus.org/jcontainer">jcontainer</a>/<a href="http://xstream.cvs.codehaus.org/jcontainer/loom">loom</a>/<a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site">site</a>/<a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site/xdocs">xdocs</a>/<a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site/xdocs/reference">reference</a><br /></span>
<div class="fileheader"><big><b>environment-xml-specification.xml</b></big> <small id="info"><a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site/xdocs/reference/environment-xml-specification.xml?rev=1.4&content-type=text/vnd.viewcvs-markup">1.4</a> <a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site/xdocs/reference/environment-xml-specification.xml.diff?r1=1.4&r2=1.5">-></a> <a href="http://xstream.cvs.codehaus.org/jcontainer/loom/site/xdocs/reference/environment-xml-specification.xml?rev=1.5&content-type=text/vnd.viewcvs-markup">1.5</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.4 -r1.5
--- environment-xml-specification.xml 28 Feb 2004 19:46:07 -0000 1.4
+++ environment-xml-specification.xml 31 Mar 2004 06:44:24 -0000 1.5
@@ -8,113 +8,124 @@
</small></pre><pre class="diff" id="context"> <section name="Introduction">
<p>
The purpose of the
</pre><pre class="diff" id="removed">- <code>environment.xml</code> file is to configure environmental
- or Server Application wide settings. Currently this means being able to set the
- security policy and configure logging settings. A sample
- <code>environment.xml</code>
- follows. Previously thread pool settings were also configured in this
- section but this has been deprecated.
</pre><pre class="diff" id="added">+ <code>environment.xml</code> file is to configure
+ environmental or Server Application wide settings. Currently this means
+ being able to set the security policy and configure logging settings.
+ A sample
+ <code>environment.xml</code> follows.
</pre><pre class="diff" id="context"> </p>
</section>
<section name="Sample environment.xml file">
<source>
</pre><pre class="diff" id="removed">-&lt;?xml version="1.0"?>
</pre><pre class="diff" id="added">+ <![CDATA[
+<?xml version="1.0"?>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">-<span id="removedchars">&lt;</span>environment>
</pre><pre class="diff" id="added">+<span id="addedchars"><</span>environment>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- &lt;logs>
- &lt;category name="" target="default" priority="DEBUG" />
- &lt;category name="myAuthorizer" target="myAuthorizer-target"
</pre><pre class="diff" id="added">+ <logs>
+ <category name="" target="default" priority="DEBUG" />
+ <category name="myAuthorizer" target="myAuthorizer-target"
</pre><pre class="diff" id="context"> priority="DEBUG" />
</pre><pre class="diff" id="removed">-
- &lt;log-target name="default"
</pre><pre class="diff" id="added">+
+ <log-target name="default"
</pre><pre class="diff" id="context"> location="/logs/default.log" />
</pre><pre class="diff" id="removed">- <span id="removedchars">&lt;</span>log-target name="myAuthorizer-target"
</pre><pre class="diff" id="added">+ <span id="addedchars"><</span>log-target name="myAuthorizer-target"
</pre><pre class="diff" id="context"> location="/logs/authorizer.log" />
</pre><pre class="diff" id="removed">- &lt;/logs>
-
- &lt;policy>
- &lt;keystore name="foo-keystore"
- location="sar:/conf/keystore"
- type="JKS" />
-
- &lt;grant code-base="file:${app.home}${/}some-dir${/}*"
- key-store="foo-keystore" >
- &lt;permission class="java.io.FilePermission"
- target="${/}tmp${/}*"
- action="read,write" />
- &lt;/grant>
-
- &lt;grant signed-by="Bob"
- code-base="sar:/SAR-INF/lib/*"
- key-store="foo-keystore" >
- &lt;permission class="java.io.FilePermission"
- target="${/}tmp${/}*"
- action="read,write" />
- &lt;/grant>
- &lt;/policy>
</pre><pre class="diff" id="added">+ </logs>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">-&lt;/environment>
-
- </source>
- <p>
</pre><pre class="diff" id="added">+ <policy>
+ <!-- define the keystore that is used to load signers from -->
+ <keystore name="myKeystore"
+ location="sar:/conf/keystore"
+ type="JKS"/>
+
+ <!-- grant the java classes defined in
+ /SAR-INF/classes/ directory the permission
+ to read and write files to temp directory. -->
+ <grant code-base="sar:/SAR-INF/classes/">
+ <permission class="java.io.FilePermission"
+ target="${/}tmp${/}*"
+ action="read,write"/>
+ </grant>
+
+ <!-- grant the secure.jar the permission to connect
+ a socket to localhost ports 1024 and above,
+ as long as code has been signed by "Fred". -->
+ <grant code-base="sar:/SAR-INF/lib/secure.jar"
+ signed-by="Fred"
+ key-store="myKeystore" >
+ <permission class="java.io.FilePermission"
+ target="localhost:1024-"
+ action="accept,connect,listen"/>
+ </grant>
+ </policy>
+
+</environment>
+
+ ]]></source>
+ <subsection name="Policy Descriptor Section">
+ <p>
</pre><pre class="diff" id="context"> The format of the policy section should be largely self evident if the assembler
</pre><pre class="diff" id="removed">- has experience with standard policy files. It should be noted that if no
- policy section is given then the Server Application runs at full permissions.
- The evaluation of properties occurs in a similar manner to standard
</pre><pre class="diff" id="added">+ has experience with standard policy files. If no policy section is
+ specified then the Server Application runs with full access. The
+ evaluation of properties occurs in a similar manner to standard
</pre><pre class="diff" id="context"> policy file property expansion. There are a number of extra properties that
will be evaluated. These include;
</pre><pre class="diff" id="removed">- <code>app.home</code> and
- <code>app.name</code>.
- </p>
- <p>
</pre><pre class="diff" id="added">+ <code>app.home</code> and
+ <code>app.name</code>.
+ </p>
+ <p>
</pre><pre class="diff" id="context"> One special thing to not is that the user can use URLs of the form,
"sar:/SAR-INF/lib/*". This will apply the permissions to the jars
contained in the .SAR file. Note that these urls must start with
"sar:/" and must use the "/" character as file separator, regardless
</pre><pre class="diff" id="removed">- of current operating system.
- </p>
- <p>
</pre><pre class="diff" id="added">+ of the host operating system.
+ </p>
+ </subsection>
+ <subsection name="Log Descriptor Section">
+ <p>
</pre><pre class="diff" id="context"> The logs section can currently have two types of elements;
</pre><pre class="diff" id="removed">- <em>log-target</em>s
</pre><pre class="diff" id="added">+ <span id="addedchars"> </span><em>log-target</em>s
</pre><pre class="diff" id="context"> which represent destinations for logging and
</pre><pre class="diff" id="removed">- <em>category</em>s. There must be a
</pre><pre class="diff" id="added">+ <span id="addedchars"> </span><em>category</em>s. There must be a
</pre><pre class="diff" id="context"> log-target with the name "default". Categories are hierarchial in nature, have a
priority and are associated with one or more log-targets. See the logging
documentation for a further description of this section.
</pre><pre class="diff" id="removed">- </p>
- <p>
</pre><pre class="diff" id="added">+ </p>
+ <p>
</pre><pre class="diff" id="context"> There is another type of log configuration. It is more configurable.
Specify version attribute with logs elements. See javadoc of
org.apache.avalon.excalibur.logger package for detailed description.
Below is example configuration.
</pre><pre class="diff" id="removed">- </p>
- <source>
-&lt;?xml version="1.0"?>
-&lt;environment>
- &lt;logs version="1.1">
- &lt;factories>
- &lt;factory type="file" class="org.apache.avalon.excalibur.logger.factory.FileTargetFactory"/>
- &lt;/factories>
-
- &lt;categories>
- &lt;category name="" log-level="INFO">
- &lt;log-target id-ref="default"/>
- &lt;/category>
- &lt;/categories>
-
- &lt;targets>
- &lt;file id="default">
- &lt;filename>${app.home}/logs/default-&lt;/filename>
- &lt;append>true&lt;/append>
- &lt;rotation type="unique" pattern="yyyyMMdd" suffix=".log">
- &lt;date>yyyyMMdd&lt;/date>
- &lt;/rotation>
- &lt;/file>
- &lt;/targets>
- &lt;/logs>
-&lt;/environment>
- </source>
</pre><pre class="diff" id="added">+ </p>
+ <source>
+ <![CDATA[
+<?xml version="1.0"?>
+<environment>
+ <logs version="1.1">
+ <factories>
+ <factory type="file" class="org.apache.avalon.excalibur.logger.factory.FileTargetFactory"/>
+ </factories>
+
+ <categories>
+ <category name="" log-level="INFO">
+ <log-target id-ref="default"/>
+ </category>
+ </categories>
+
+ <targets>
+ <file id="default">
+ <filename>${app.home}/logs/default-</filename>
+ <append>true</append>
+ <rotation type="unique" pattern="yyyyMMdd" suffix=".log">
+ <date>yyyyMMdd</date>
+ </rotation>
+ </file>
+ </targets>
+ </logs>
+</environment>
+ ]]></source>
+ </subsection>
</pre><pre class="diff" id="context"> </section>
</body>
</document>
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.8</small></center>
</body></html>