Return-Path: Delivered-To: apmail-avalon-cvs-archive@www.apache.org Received: (qmail 28274 invoked from network); 4 Dec 2003 00:23:22 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Dec 2003 00:23:22 -0000 Received: (qmail 23838 invoked by uid 500); 4 Dec 2003 00:22:55 -0000 Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 23761 invoked by uid 500); 4 Dec 2003 00:22:55 -0000 Mailing-List: contact cvs-help@avalon.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 cvs@avalon.apache.org Received: (qmail 23748 invoked from network); 4 Dec 2003 00:22:54 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 4 Dec 2003 00:22:54 -0000 Received: (qmail 28222 invoked by uid 1438); 4 Dec 2003 00:23:21 -0000 Date: 4 Dec 2003 00:23:21 -0000 Message-ID: <20031204002321.28221.qmail@minotaur.apache.org> From: mcconnell@apache.org To: avalon-cvs@apache.org Subject: cvs commit: avalon/merlin/kernel/plugin/src/java/org/apache/avalon/merlin/tools MerlinBean.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mcconnell 2003/12/03 16:23:21 Modified: merlin/activation/api/src/java/org/apache/avalon/activation/appliance Block.java merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl AbstractBlock.java merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl DefaultContainmentModel.java merlin/kernel/plugin/src/java/org/apache/avalon/merlin/tools MerlinBean.java Log: Update plugin to repo 2.1. Revision Changes Path 1.2 +27 -1 avalon/merlin/activation/api/src/java/org/apache/avalon/activation/appliance/Block.java Index: Block.java =================================================================== RCS file: /home/cvs/avalon/merlin/activation/api/src/java/org/apache/avalon/activation/appliance/Block.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Block.java 12 Oct 2003 15:34:49 -0000 1.1 +++ Block.java 4 Dec 2003 00:23:21 -0000 1.2 @@ -50,6 +50,10 @@ package org.apache.avalon.activation.appliance; +import java.net.URL; + +import org.apache.avalon.composition.model.Model; +import org.apache.avalon.composition.model.ContainmentModel; /** * A block is an appliance that manages a set of subsidiary @@ -60,4 +64,26 @@ */ public interface Block extends Appliance, Engine { + /** + * Return the containment metamodel associated with the block. + * @return the containment model + */ + ContainmentModel getContainmentModel(); + + /** + * Add a model as a child to this block. + * @param model the model to add as a child of the block + * @return the appliance established to handle the model + * @exception ApplianceException if a error occurs + */ + Appliance addModel( Model model ) throws ApplianceException; + + /** + * Add a model as a child to this block. + * @param url the model url + * @return the appliance established to handle the model + * @exception ApplianceException if a error occurs + */ + Appliance addModel( URL url ) throws ApplianceException; + } 1.6 +56 -4 avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/AbstractBlock.java Index: AbstractBlock.java =================================================================== RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/AbstractBlock.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AbstractBlock.java 28 Nov 2003 11:58:46 -0000 1.5 +++ AbstractBlock.java 4 Dec 2003 00:23:21 -0000 1.6 @@ -50,6 +50,7 @@ package org.apache.avalon.activation.appliance.impl; +import java.net.URL; import java.util.ArrayList; import java.util.Hashtable; @@ -150,11 +151,62 @@ m_self.setEnabled( true ); Model[] models = m_context.getContainmentModel().getModels(); - for( int i=models.length-1; i>-1; i-- ) + for( int i=0; i-1; i-- ) + //{ + // Appliance appliance = createAppliance( models[i] ); + // m_repository.addAppliance( appliance ); + //} + } + + //------------------------------------------------------------------- + // Block + //------------------------------------------------------------------- + + /** + * Return the containment metamodel associated with the block. + * @return the containment model + */ + public ContainmentModel getContainmentModel() + { + return m_context.getContainmentModel(); + } + + /** + * Add a model as a child to this block. + * @param url the model url + * @return the appliance established to handle the model + * @exception ApplianceException if a error occurs + */ + public Appliance addModel( URL url ) throws ApplianceException + { + try + { + return addModel( + getContainmentModel().addModel( url ) ); + } + catch( Throwable e ) + { + final String error = + "Cannot add model due to a model related error."; + throw new ApplianceException( error, e ); + } + } + + /** + * Add a model as a child to this block. + * @param model the model to add as a child of the block + * @return the appliance established to handle the model + * @exception ApplianceException if a error occurs + */ + public Appliance addModel( Model model ) throws ApplianceException + { + Appliance appliance = createAppliance( model ); + m_repository.addAppliance( appliance ); + return appliance; } //------------------------------------------------------------------- 1.8 +7 -1 avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java Index: DefaultContainmentModel.java =================================================================== RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- DefaultContainmentModel.java 3 Dec 2003 19:04:53 -0000 1.7 +++ DefaultContainmentModel.java 4 Dec 2003 00:23:21 -0000 1.8 @@ -271,6 +271,12 @@ m_categories = categories; // TODO: merge with existing categories } + /** + * Add a model referenced by a url to this model. + * @param url the url of the model to include + * @return the model + * @exception ModelException if a model related error occurs + */ public Model addModel( URL url ) throws ModelException { return addContainmentModel( url, null ); 1.3 +16 -2 avalon/merlin/kernel/plugin/src/java/org/apache/avalon/merlin/tools/MerlinBean.java Index: MerlinBean.java =================================================================== RCS file: /home/cvs/avalon/merlin/kernel/plugin/src/java/org/apache/avalon/merlin/tools/MerlinBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MerlinBean.java 28 Oct 2003 20:21:02 -0000 1.2 +++ MerlinBean.java 4 Dec 2003 00:23:21 -0000 1.3 @@ -53,7 +53,9 @@ import java.net.URL; import org.apache.avalon.repository.Repository; -import org.apache.avalon.repository.impl.DefaultFileRepository; +import org.apache.avalon.repository.impl.DefaultRepository; +import org.apache.avalon.repository.impl.DefaultCacheManager; +import org.apache.avalon.repository.provider.CacheManager; import org.apache.avalon.composition.util.ExceptionHelper; import org.apache.avalon.merlin.kernel.Kernel; import org.apache.avalon.merlin.kernel.KernelException; @@ -69,6 +71,13 @@ public class MerlinBean { + //------------------------------------------------------------------ + // static + //------------------------------------------------------------------ + + private static final String[] DEFAULT_HOSTS = + new String[]{ "http://dpml.net", "http://ibiblio.org/maven" }; + //----------------------------------------------------- // state //----------------------------------------------------- @@ -322,9 +331,14 @@ { DefaultKernelContext context = null; + // + // TODO: update to use the maven remote hosts + // and proxy settings + try { - Repository repository = new DefaultFileRepository( m_repository ); + CacheManager manager = new DefaultCacheManager( m_repository, null ); + Repository repository = new DefaultRepository( manager, DEFAULT_HOSTS ); context = new DefaultKernelContext( repository, --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org