KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > logger > factory > AbstractTargetFactory


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.logger.factory;
9
10 import org.apache.avalon.excalibur.logger.LogTargetFactory;
11
12 import org.apache.avalon.framework.configuration.Configuration;
13 import org.apache.avalon.framework.configuration.Configurable;
14 import org.apache.avalon.framework.configuration.ConfigurationException;
15 import org.apache.avalon.framework.context.Contextualizable;
16 import org.apache.avalon.framework.context.ContextException;
17 import org.apache.avalon.framework.context.Context;
18 import org.apache.avalon.framework.logger.AbstractLogEnabled;
19
20 import org.apache.log.LogTarget;
21
22 /**
23  * AbstractTargetFactory class.
24  *
25  * This factory implements basic functionality for LogTargetFactories
26  *
27  * @author <a HREF="mailto:giacomo@apache,org">Giacomo Pati</a>
28  * @version CVS $Revision: 1.3 $ $Date: 2001/12/11 09:53:30 $
29  * @since 4.0
30  */

31 public abstract class AbstractTargetFactory
32     extends AbstractLogEnabled
33     implements LogTargetFactory,
34                Configurable,
35                Contextualizable
36 {
37     public abstract LogTarget createTarget( Configuration configuration )
38         throws ConfigurationException;
39
40     /** The Configuration object */
41     protected Configuration m_configuration;
42
43     /** The Context object */
44     protected Context m_context;
45
46     /**
47      * Get the Configuration object
48      */

49     public void configure( Configuration configuration )
50         throws ConfigurationException
51     {
52         this.m_configuration = configuration;
53     }
54
55     /**
56      * Get the Context object
57      */

58     public void contextualize( Context context )
59         throws ContextException
60     {
61         this.m_context = context;
62     }
63 }
64
Popular Tags