From 0cab9c1f29b2189d302d6b2e626595290dfef611 Mon Sep 17 00:00:00 2001 From: adammurdoch Date: Fri, 15 Feb 2002 07:36:06 +0000 Subject: [PATCH] * Added exec-manager and file-system-manager roles. * Added a very basic VFS manager service implementation. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271359 13f79535-47bb-0310-9956-ffa450edef68 --- .../framework/factorys/Resources.properties | 3 +- .../framework/factorys/VfsManagerFactory.java | 45 +++++++++++++++++++ .../src/manifest/builtin-ant-roles.xml | 16 ++++--- .../myrmidon/src/manifest/core-services.xml | 13 ++++-- 4 files changed, 65 insertions(+), 12 deletions(-) create mode 100644 proposal/myrmidon/src/java/org/apache/myrmidon/framework/factorys/VfsManagerFactory.java diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/factorys/Resources.properties b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/factorys/Resources.properties index 275097c8f..9d1e2fbf5 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/factorys/Resources.properties +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/factorys/Resources.properties @@ -1 +1,2 @@ -missing-home-dir.error=Cannot locate antRun scripts: Property 'myrmidon.home' not specified \ No newline at end of file +missing-home-dir.error=Cannot locate antRun scripts: Property 'myrmidon.home' not specified +create-vfs-manager.error=Could not create the VFS manager. \ No newline at end of file diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/factorys/VfsManagerFactory.java b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/factorys/VfsManagerFactory.java new file mode 100644 index 000000000..62476a6be --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/factorys/VfsManagerFactory.java @@ -0,0 +1,45 @@ +/* + * 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.myrmidon.framework.factorys; + +import org.apache.aut.vfs.FileSystemManager; +import org.apache.aut.vfs.impl.DefaultFileSystemManager; +import org.apache.myrmidon.interfaces.service.ServiceFactory; +import org.apache.myrmidon.interfaces.service.ServiceException; +import org.apache.avalon.excalibur.i18n.Resources; +import org.apache.avalon.excalibur.i18n.ResourceManager; + +/** + * A factory that creates the {@link FileSystemManager} service. + * + * @author Adam Murdoch + * @version $Revision$ $Date$ + */ +public class VfsManagerFactory + implements ServiceFactory +{ + private final static Resources REZ + = ResourceManager.getPackageResources( VfsManagerFactory.class ); + + /** + * Create a service that coresponds to this factory. + */ + public Object createService() + throws ServiceException + { + try + { + return new DefaultFileSystemManager(); + } + catch( Exception e ) + { + final String message = REZ.getString( "create-vfs-manager.error" ); + throw new ServiceException( message ); + } + } +} diff --git a/proposal/myrmidon/src/manifest/builtin-ant-roles.xml b/proposal/myrmidon/src/manifest/builtin-ant-roles.xml index cce5f92fa..0165be62c 100644 --- a/proposal/myrmidon/src/manifest/builtin-ant-roles.xml +++ b/proposal/myrmidon/src/manifest/builtin-ant-roles.xml @@ -1,9 +1,11 @@ - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/proposal/myrmidon/src/manifest/core-services.xml b/proposal/myrmidon/src/manifest/core-services.xml index 9cc54aefd..fa8076bae 100644 --- a/proposal/myrmidon/src/manifest/core-services.xml +++ b/proposal/myrmidon/src/manifest/core-services.xml @@ -1,4 +1,9 @@ - - - \ No newline at end of file + + + + + + + + +