Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 33725 invoked from network); 4 Jun 2002 07:46:50 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 4 Jun 2002 07:46:50 -0000 Received: (qmail 13795 invoked by uid 97); 4 Jun 2002 07:47:02 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 13755 invoked by uid 97); 4 Jun 2002 07:47:01 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 13744 invoked by uid 97); 4 Jun 2002 07:47:01 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 4 Jun 2002 07:46:53 -0000 Message-ID: <20020604074653.73818.qmail@icarus.apache.org> From: donaldp@apache.org To: jakarta-avalon-excalibur-cvs@apache.org Subject: cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata ComponentMetaData.java DependencyMetaData.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N donaldp 2002/06/04 00:46:53 Added: containerkit/src/java/org/apache/excalibur/containerkit/metadata ComponentMetaData.java DependencyMetaData.java Log: Add in some generic metadata for components Revision Changes Path 1.1 jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/ComponentMetaData.java Index: ComponentMetaData.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.excalibur.containerkit.metadata; import org.apache.excalibur.containerkit.metainfo.ComponentInfo; /** * Each Component delcared in the application is represented by * a ComponentMetaData. Note that this does not necessarily imply * that there is only one instance of actual Component. The * ComponentMetaData could represent a pool of components, a single * component or a component prototype that is reused to create * new Components as needed. * * @author Peter Donald * @version $Revision: 1.1 $ $Date: 2002/06/04 07:46:53 $ */ public class ComponentMetaData { /** * The name of the Component. This is an abstract name * used during assembly. */ private final String m_name; /** * The resolution of any dependencies required by * the component. */ private final DependencyMetaData[] m_dependencies; /** * The info object for component. */ private final ComponentInfo m_info; /** * Create a ComponentMetaData. * * @param name the name of component * @param dependencies the meta data for any dependencies * @param info the info for component */ public ComponentMetaData( final String name, final DependencyMetaData[] dependencies, final ComponentInfo info ) { m_name = name; m_dependencies = dependencies; m_info = info; } /** * Return the name of component. * * @return the name of the component. */ public String getName() { return m_name; } /** * Utility method to return the classname of component. * This is equivelent to * getComponentInfo().getComponentDescriptor().getClassname(). * * @return the classname of the component. */ public String getClassname() { return getComponentInfo().getComponentDescriptor().getClassname(); } /** * Return the info for component. * * @return the info for component. */ public ComponentInfo getComponentInfo() { return m_info; } /** * Return the dependency metadata for component. * * @return the dependency metadata for component. */ public DependencyMetaData[] getDependencies() { return m_dependencies; } /** * Return the dependency metadata for component with specified role. * * @return the dependency metadata for component with specified role. */ public DependencyMetaData getDependency( final String role ) { for( int i = 0; i < m_dependencies.length; i++ ) { if( m_dependencies[ i ].getRole().equals( role ) ) { return m_dependencies[ i ]; } } return null; } } 1.1 jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/DependencyMetaData.java Index: DependencyMetaData.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.excalibur.containerkit.metadata; /** * The DependencyMetaData is the mapping of a component as a dependency * of another component. Each component declares dependencies (via ComponentInfo) * and for each dependency there must be a coressponding DependencyMetaData which * has a matching role. The name value in DependencyMetaData object must refer * to another Component that implements Service as specified in DependencyInfo. * *

Note that it is invalid to have circular dependencies.

* * @author Peter Donald * @version $Revision: 1.1 $ $Date: 2002/06/04 07:46:53 $ */ public final class DependencyMetaData { /** * The name that the client component will use to access dependency. */ private final String m_role; /** * the name of the Component that will provide the dependency. */ private final String m_name; /** * Create MetaData with specified name and role. * * @param role the name client uses to access component * @param name the name of provider */ public DependencyMetaData( final String role, final String name ) { m_role = role; m_name = name; } /** * Return the name that the client component will use to access dependency. * * @return the name that the client component will use to access dependency. */ public String getRole() { return m_role; } /** * Return the name of the Component that will provide the dependency. * * @return the name of the Component that will provide the dependency. */ public String getName() { return m_name; } } -- To unsubscribe, e-mail: For additional commands, e-mail: