// Copyright 2003-2004 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.
namespace Apache.Avalon.Composition.Data
{
using System;
/// A block reference directive contains an identifier and verion of
/// a local resource to be included by reference into
/// a container.
///
///
/// Stephen McConnell
///
/// $Revision: 1.2 $ $Date: 2004/02/28 22:15:36 $
///
public class BlockCompositionDirective : DeploymentProfile
{
/// The version identifier.
private ResourceDirective m_resource;
/// Nested targets.
private TargetDirective[] m_targets;
/// Creation of a new resource directive.
/// the name to assign to the container
/// established by the composition directive
///
/// a resource reference from which a block
/// description can be resolved
///
public BlockCompositionDirective(System.String name, ResourceDirective resource):this(name, resource, new TargetDirective[0])
{
}
/// Creation of a new resource directive.
/// the name to assign to the container
/// established by the composition directive
///
/// a resource reference from which a block
/// description can be resolved
///
public BlockCompositionDirective(System.String name, ResourceDirective resource, TargetDirective[] targets) :
base(name, ActivationPolicy.Startup, Mode.Explicit)
{
if (resource == null)
{
throw new System.NullReferenceException("resource");
}
m_resource = resource;
m_targets = targets;
}
/// Return the resource reference.
/// the resource
///
public virtual ResourceDirective Resource
{
get
{
return m_resource;
}
}
/// Return the relative targets.
/// the targets
///
public virtual TargetDirective[] TargetDirectives
{
get
{
return m_targets;
}
}
}
}