bloritsch 01/12/06 10:48:13
Modified: src/documentation/xdocs/developing framework.xml
implementing.xml introduction.xml
Log:
update developer's docs with LogEnabled
Revision Changes Path
1.5 +16 -5
jakarta-avalon/src/documentation/xdocs/developing/framework.xml
Index: framework.xml
===================================================================
RCS file:
/home/cvs/jakarta-avalon/src/documentation/xdocs/developing/framework.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- framework.xml 2001/10/30 16:16:43 1.4
+++ framework.xml 2001/12/06 18:48:13 1.5
@@ -194,8 +194,8 @@
<orderedlist>
<listitem>
<para>
- <function>setLogger</function>
- [<classname>Loggable</classname>]
+ <function>enableLogging</function>
+ [<classname>LogEnabled</classname>]
</para>
</listitem>
<listitem>
@@ -585,7 +585,7 @@
<para>
The contract surrounding this interface is that the
<function>contextualize</function> method is called once during
the
- life of a Component, after <classname>Loggable</classname> but
+ life of a Component, after <classname>LogEnabled</classname> but
before any other initialization method.
</para>
</section>
@@ -624,17 +624,28 @@
Inversion of Control pattern.
</para>
<section>
- <title>Loggable</title>
+ <title>LogEnabled</title>
<para>
Every Component that needs a Logger instance implements this
interface. The interface has one method named
- <function>setLogger</function> and passes Avalon LogKit's
+ <function>enableLogging</function> and passes Avalon Framework's
<classname>Logger</classname> instance to the Component.
</para>
<para>
The contract surrounding this method is that it is called only
once during the Component's lifecycle before any other
initialization step.
+ </para>
+ </section>
+ <section>
+ <title>Logger</title>
+ <para>
+ The <classname>Logger</classname> interface is used to abstract
+ away the differences in logging libraries. It provides only a
+ client API. Avalon Framework provides three wrapper classes that
+ implement this interface: <classname>LogKitLogger</classname> for
+ LogKit, <classname>Log4jLogger</classname> for Log4J, and
+ <classname>Jdk14Logger</classname> for JDK 1.4 logging.
</para>
</section>
</section>
1.9 +26 -19
jakarta-avalon/src/documentation/xdocs/developing/implementing.xml
Index: implementing.xml
===================================================================
RCS file:
/home/cvs/jakarta-avalon/src/documentation/xdocs/developing/implementing.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- implementing.xml 2001/11/02 22:14:44 1.8
+++ implementing.xml 2001/12/06 18:48:13 1.9
@@ -93,7 +93,7 @@
<programlisting>
<![CDATA[
public class DatabaseDocumentRepository
-extends AbstractLoggable
+extends AbstractLogEnabled
implements DocumentRepository , Configurable, Composable, Initializable,
Disposable, Component, ThreadSafe
{
@@ -125,7 +125,7 @@
{
this.dbResource = conf.getChild("dbpool").getValue();
getLogger().debug("Using database pool: " + this.dbResource);
- // Notice the getLogger()? This is from AbstractLoggable
+ // Notice the getLogger()? This is from AbstractLogEnabled
// which I extend for just about all my components.
}
}
@@ -251,17 +251,21 @@
public void initialize()
throws Exception
{
- this.docs.setLogger(Heirarchy.getLoggerFor("document.repository"));
+ Logger docLogger = new LogKitLogger( Hierarchy.defaultHierarchy()
+ .getLoggerFor( "document" ) );
+ this.docs.enableLogging( docLogger.childLogger( "repository" ) );
+ this.guard.enableLogging( docLogger.childLogger( "security" ) );
+
DefaultConfiguration pool = new DefaultConfiguration("dbpool");
pool.setValue("main-pool");
DefaultConfiguration conf = new DefaultConfiguration("");
conf.addChild(pool);
- this.manager.addComponent(DocumentRepository.ROLE, this.docs);
- this.manager.addComponent(GuardianComponent.ROLE, this.guard);
- this.docs.compose(this.manager);
- this.guard.compose(this.manager);
+ this.manager.addComponent( DocumentRepository.ROLE, this.docs );
+ this.manager.addComponent( GuardianComponent.ROLE, this.guard );
+ this.docs.compose( this.manager );
+ this.guard.compose( this.manager );
this.docs.configure(conf);
@@ -428,9 +432,12 @@
this.guard = ComponentHandler.getComponentHandler(
DocumentGuardianComponent.class,
null, this.manager, null, null);
+
+ Logger docLogger = new LogKitLogger( Hierarchy.defaultHierarchy()
+ .getLoggerFor( "document" ) );
- this.docs.setLogger(Heirarchy.getLoggerFor("document.repository"));
- this.guard.setLogger(Heirarchy.getLoggerFor("document.security"));
+ this.docs.enableLogging( docLogger.childLogger( "repository" ) );
+ this.guard.enableLogging( docLogger.childLogger( "security" ) );
this.manager.addComponent(DocumentRepository.ROLE, this.docs);
this.manager.addComponent(GuardianComponent.ROLE, this.guard);
@@ -533,10 +540,10 @@
DefaultConfigurationBuilder builder = new
DefaultConfigurationBuilder();
Configuration sysConfig =
builder.buildFromFile("./conf/system.xconf");
- this.manager.setLogger(Hierarchy.getDefaultHierarchy()
- .getLoggerFor("document"));
- this.manager.contextualize(new DefaultContext());
- this.manager.configure(sysConfig);
+ this.manager.setLogger( Hierarchy.getDefaultHierarchy()
+ .getLoggerFor("document") );
+ this.manager.contextualize( new DefaultContext() );
+ this.manager.configure( sysConfig );
this.manager.initialize();
}
@@ -647,14 +654,14 @@
.getResourceAsStream("/org/apache/bizserver/docs/document.roles"));
DefaultRoleManager roles = new DefaultRoleManager();
-roles.setLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("document.roles"));
+roles.enableLogging(Hierarchy.getDefaultHierarchy().getLoggerFor("document.roles"));
roles.configure(roleConfig);
-this.manager.setLogger(Hierarchy.getDefaultHierarchy()
- .getLoggerFor("document"));
-this.manager.contextualize(new DefaultContext());
-this.manager.setRoleManager(roles);
-this.manager.configure(sysConfig);
+this.manager.setLogger( Hierarchy.getDefaultHierarchy()
+ .getLoggerFor("document") );
+this.manager.contextualize( new DefaultContext() );
+this.manager.setRoleManager( roles );
+this.manager.configure( sysConfig );
this.manager.initialize();
]]>
</programlisting>
1.9 +7 -0
jakarta-avalon/src/documentation/xdocs/developing/introduction.xml
Index: introduction.xml
===================================================================
RCS file:
/home/cvs/jakarta-avalon/src/documentation/xdocs/developing/introduction.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- introduction.xml 2001/10/30 13:55:00 1.8
+++ introduction.xml 2001/12/06 18:48:13 1.9
@@ -139,6 +139,13 @@
focused projects. Avalon can be described as a framework that
includes implementations of the framework.
</para>
+ <para>
+ While Avalon is focused on server side solutions, many people have
+ found it to be useful for regular applications. The concepts used in
+ Framework, Excalibur, and LogKit are general enough to be used for
+ any project. The two projects that are more squarely focused on
+ the server are Cornerstone and Phoenix.
+ </para>
<blockquote>
<title>Framework</title>
<orderedlist>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>