#region Copyright & License
//
// Copyright 2001-2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion
using log4net.Repository;
namespace log4net.Plugin
{
///
/// Base implementation of
///
///
///
/// Default abstract implementation of the
/// interface. This base class can be used by implementors
/// of the interface.
///
///
/// Nicko Cadell
/// Gert Driesen
public abstract class PluginSkeleton : IPlugin
{
#region Protected Instance Constructors
///
/// Constructor
///
/// the name of the plugin
///
/// Initializes a new Plugin with the specified name.
///
protected PluginSkeleton(string name)
{
m_name = name;
}
#endregion Protected Instance Constructors
#region Implementation of IPlugin
///
/// Gets or sets the name of the plugin.
///
///
/// The name of the plugin.
///
///
///
/// Plugins are stored in the
/// keyed by name. Each plugin instance attached to a
/// repository must be a unique name.
///
///
/// The name of the plugin must not change one the
/// plugin has been attached to a repository.
///
///
public virtual string Name
{
get { return m_name; }
set { m_name = value; }
}
///
/// Attaches this plugin to a .
///
/// The that this plugin should be attached to.
///
///
/// A plugin may only be attached to a single repository.
///
///
/// This method is called when the plugin is attached to the repository.
///
///
public virtual void Attach(ILoggerRepository repository)
{
m_repository = repository;
}
///
/// Is called when the plugin is to shutdown.
///
///
///
/// This method is called to notify the plugin that
/// it should stop operating and should detach from
/// the repository.
///
///
public virtual void Shutdown()
{
}
#endregion Implementation of IPlugin
#region Protected Instance Properties
///
/// The repository for this plugin
///
///
/// The that this plugin is attached to.
///
///
///
/// Gets or sets the that this plugin is
/// attached to.
///
///
protected virtual ILoggerRepository LoggerRepository
{
get { return this.m_repository; }
set { this.m_repository = value; }
}
#endregion Protected Instance Properties
#region Private Instance Fields
///
/// The name of this plugin.
///
private string m_name;
///
/// The repository this plugin is attached to.
///
private ILoggerRepository m_repository;
#endregion Private Instance Fields
}
}