You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by gk...@apache.org on 2021/09/08 13:19:02 UTC

[turbine-fulcrum-factory] branch master created (now 2ba3c28)

This is an automated email from the ASF dual-hosted git repository.

gk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git.


      at 2ba3c28  - Remove .cvsignore, replace with .gitignore (mostly identical)

This branch includes the following new commits:

     new 4a3b1ba  +) using fulcrum-yaafi-1.0.5 +) getting it to run with maven 1.1
     new ee38dd0  Cleanup
     new 34a461d  (Hopefully) improve documentation
     new 9458abd  Moving to M2 build
     new a7f5c05  Fixed site id to comply with settings.xml as explained in the wiki
     new 7464fea  Use current snapshot dependency (1.0.7) for fulcrum-yaafi
     new ce68762  Use release version 1.0.6 of YAAFI for test environment
     new c3bf09a  Use released version of fulcrum-testcontainer
     new 46100cd  Prepare release
     new 5ceed66  [maven-release-plugin] prepare release FULCRUM_FACTORY_1_0_4
     new 5dbd3e8  Fix failed mvn release
     new b871c94  [maven-release-plugin] prepare release FULCRUM_FACTORY_1_0_4
     new 9242469  [maven-release-plugin] prepare for next development iteration
     new f644468  Fix POM
     new 78b4b16  Remove Maven-1 control files for Maven-2-released components to avoid confusion.
     new f379993  Added eclipse generated files to svn:ignore for all remaining fulcrum components.
     new 145b8d8  Fix site building errors: - Updating to Turbine Parent Version 3 - Unknown attribute 'href' for tag 'project'.. - UTF-8 Encoding in XmlRpc Java files
     new d98ede3  Replace viewcvs with viewvc. Fixes TRB-95
     new 10f5006  Ignoring the remaining IntelliJ project files in SVN
     new 948c6a7  - update groupId to fulcrum if parent is turbine.
     new 92a880c  Document changes
     new 6505555  Add generics and use concurrent collections
     new ccbf436  Adjust project layout to new Fulcrum standard
     new dde4c3d  Adjust project layout to new Fulcrum standard
     new d656a1d  Update docs
     new e4fd291  Some cleanup before release
     new a77f363  [maven-release-plugin] prepare release fulcrum-factory-1.1.0
     new f22528f  [maven-release-plugin] prepare for next development iteration
     new 1f40b0b  Use Turbine parent POM 4-SNAPSHOT
     new 3faf89d  Inherit assembly descriptors from parent
     new c6ea79b  - Fulcrum factory fix parent pom version - Fulcrum json jackson2 commons-lang align - Fulcrum parser and upload JUnit 4 - Fulcrum Testcontainer endow with Mockito (default request mock copied from Turbine test) - Fulcrum uplad with duplicate mock until not upgraded to testcontainer 1.0.8
     new 082b5a5  global replace StringBuffer with StringBuilder
     new 8bfe0d9  Update yaafi to snapshot
     new 76ad66d  Wrapping up a few more findbug complaints
     new c52eb6f  Point fulcrum components to new turbine parent 5
     new a848435  Fix JavaDocs for factory
     new a9c563a  Code cleanup, more Java 8 syntax, cleared all Findbugs and PMD reports, update changes.xml
     new 152627c  Update all components to fulcrum-yaafi 1.0.8 release
     new 5fd0ac3  Update all fulcrum components to use release 1.0.8 of yaafi and testcontainer
     new ce263e0  Turbine coding standards compliance, update tests with annotations
     new e2f49f1  Cleanup formatting and update to junit5 testing
     new c6b49b4  [maven-release-plugin] prepare release fulcrum-factory-1.1.1
     new 513afc0  [maven-release-plugin] prepare for next development iteration
     new 555a81f  Update release versions for changes.xml
     new 03debd7  Add distribution management configuration to fulcrum modules
     new 1960e07  - Update Fulcrum Testcontainer 1.0.9 and Turbine Parent 7 - Fix Mock Encoding in Fulcrum Update Test - Format Yaafi Tests - Remove JUnitPlatform in json, crypto module
     new 5dcdcce  - update most Fulcrum parent to version 8 and update Fulcrum site + use md format for README
     new aa003a4  Add missing NOTICE.txt files and update copyright year to 2021
     new 2ba3c28  - Remove .cvsignore, replace with .gitignore (mostly identical)

The 49 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[turbine-fulcrum-factory] 02/49: Cleanup

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit ee38dd07640db88f66591b91e64da7e31e0c723f
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Jun 22 09:32:41 2008 +0000

    Cleanup
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@670327 13f79535-47bb-0310-9956-ffa450edef68
---
 src/java/org/apache/fulcrum/factory/DefaultFactoryService.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
index 86472ca..3034c19 100644
--- a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -101,12 +101,7 @@ public class DefaultFactoryService
     {
         return (Class) primitiveClasses.get(type);
     }
-    /**
-     * Constructs a Factory Service.
-     */
-    public DefaultFactoryService()
-    {
-    }
+
     /**
      * Gets an instance of a named class.
      *
@@ -419,6 +414,7 @@ public class DefaultFactoryService
                 }
                 catch (ClassNotFoundException xx)
                 {
+                    // continue
                 }
             }
             /* Give up. */

[turbine-fulcrum-factory] 41/49: Cleanup formatting and update to junit5 testing

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit e2f49f1510cb18d62f6705fc956ea04756f86583
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Fri Jan 11 12:41:34 2019 +0000

    Cleanup formatting and update to junit5 testing
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1851033 13f79535-47bb-0310-9956-ffa450edef68
---
 src/changes/changes.xml                            |  3 ++
 .../fulcrum/factory/DefaultFactoryService.java     | 19 ++++++++-----
 .../apache/fulcrum/factory/FactoryServiceTest.java | 33 ++++++++++------------
 .../utils/ObjectInputStreamForContextTest.java     | 19 ++++---------
 4 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index f55c121..f58ffcb 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -26,6 +26,9 @@
   <body>
     <release version="1.1.1" date="in SVN">
 		<action dev="painter" type="update">
+			Update to junit 5 test cases
+		</action>
+		<action dev="painter" type="update">
 			Addressed all PMD static code analyzer issues and corrected where appropriate
 		</action>
 		<action dev="painter" type="update">
diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
index 69532f0..3fd26a6 100644
--- a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -45,8 +45,7 @@ import org.apache.fulcrum.factory.utils.ObjectInputStreamForContext;
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
  * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
- * @version $Id: DefaultFactoryService.java 1844842 2018-10-25 15:33:42Z painter
- *          $
+ * @version $Id$
  *
  */
 public class DefaultFactoryService extends AbstractLogEnabled
@@ -247,7 +246,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws FactoryException if test fails.
 	 */
 	@Override
-	public boolean isLoaderSupported(String className) throws FactoryException {
+	public boolean isLoaderSupported(String className) throws FactoryException 
+	{
 		Factory<?> factory = getFactory(className);
 		return factory != null ? factory.isLoaderSupported() : true;
 	}
@@ -261,7 +261,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws FactoryException if instantiation fails.
 	 */
 	@Override
-	public <T> T getInstance(Class<T> clazz) throws FactoryException {
+	public <T> T getInstance(Class<T> clazz) throws FactoryException 
+	{
 		try {
 			return clazz.newInstance();
 		} catch (Exception x) {
@@ -281,7 +282,9 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @return the instance
 	 * @throws FactoryException if instantiation fails.
 	 */
-	protected <T> T getInstance(Class<T> clazz, Object params[], String signature[]) throws FactoryException {
+	protected <T> T getInstance(Class<T> clazz, Object params[], String signature[]) 
+			throws FactoryException 
+	{
 		/* Try to construct. */
 		try {
 			Class<?>[] sign = getSignature(clazz, params, signature);
@@ -303,7 +306,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws ClassNotFoundException if any of the classes is not found.
 	 */
 	@Override
-	public Class<?>[] getSignature(Class<?> clazz, Object params[], String signature[]) throws ClassNotFoundException 
+	public Class<?>[] getSignature(Class<?> clazz, Object params[], String signature[]) 
+			throws ClassNotFoundException 
 	{
 		if (signature != null) {
 			/* We have parameters. */
@@ -568,7 +572,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * Avalon component lifecycle method Clear lists and maps
 	 */
 	@Override
-	public void dispose() {
+	public void dispose() 
+	{
 		objectFactories.clear();
 		objectFactoryClasses.clear();
 		classLoaders.clear();
diff --git a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
index 1a85700..c2b04c7 100644
--- a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
+++ b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
@@ -1,5 +1,7 @@
 package org.apache.fulcrum.factory;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -20,11 +22,14 @@ package org.apache.fulcrum.factory;
  */
 
 
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 import java.util.ArrayList;
 
-import org.apache.fulcrum.testcontainer.BaseUnitTest;
-import org.junit.Before;
-import org.junit.Test;
+import org.apache.fulcrum.testcontainer.BaseUnit5Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 /**
  * Basic tests of the fulcrum factory service
@@ -34,25 +39,17 @@ import org.junit.Test;
  * 
  * @version $Id$ 
  */
-public class FactoryServiceTest extends BaseUnitTest
+public class FactoryServiceTest extends BaseUnit5Test
 {
+	/** Default factory service **/
     private FactoryService factoryService = null;
-    
-    /**
-     * Defines the testcase name for JUnit.
-     *
-     * @param name the testcase's name.
-     */
-    public FactoryServiceTest(String name)
-    {
-        super(name);
-    }
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception
     {
-        super.setUp();
-        factoryService = (FactoryService) this.resolve( FactoryService.class.getName() );
+        setConfigurationFileName("src/test/TestComponentConfig.xml");
+        setRoleFileName("src/test/TestRoleConfig.xml");
+        factoryService = (FactoryService) this.lookup(FactoryService.class.getName());    	
     }
     
     /**
@@ -151,6 +148,6 @@ public class FactoryServiceTest extends BaseUnitTest
         signature[0] = "java.lang.Integer";
         results = factoryService.getSignature(ArrayList.class, params, signature);
         assertEquals(1, results.length);
-        assertTrue("Result:" + results[0].getName(),results[0].equals(Integer.class));
+        assertTrue(results[0].equals(Integer.class));
     }
 }
diff --git a/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java b/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
index e533e03..a08ace0 100644
--- a/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
+++ b/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
@@ -1,5 +1,7 @@
 package org.apache.fulcrum.factory.utils;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -23,8 +25,9 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.ObjectOutputStream;
 
-import org.apache.fulcrum.testcontainer.BaseUnitTest;
-import org.junit.Test;
+import org.apache.fulcrum.testcontainer.BaseUnit5Test;
+import org.junit.jupiter.api.Test;
+
 
 /**
  * Basic test for object input stream for fulcrum factory
@@ -32,18 +35,8 @@ import org.junit.Test;
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @version $Id$ 
  */
-public class ObjectInputStreamForContextTest extends BaseUnitTest
+public class ObjectInputStreamForContextTest extends BaseUnit5Test
 {
-	 
-    /**
-     * Defines the testcase name for JUnit.
-     *
-     * @param name the testcase's name.
-     */
-    public ObjectInputStreamForContextTest(String name)
-    {
-        super(name);
-    }
 	
     /**
      * 

[turbine-fulcrum-factory] 19/49: Ignoring the remaining IntelliJ project files in SVN

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 10f50060ed756eed2394320639d8cb62dfe2b678
Author: Siegfried Goeschl <sg...@apache.org>
AuthorDate: Mon Jun 22 21:03:10 2015 +0000

    Ignoring the remaining IntelliJ project files in SVN
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1686939 13f79535-47bb-0310-9956-ffa450edef68

[turbine-fulcrum-factory] 06/49: Use current snapshot dependency (1.0.7) for fulcrum-yaafi

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 7464fea44fda659595b4849cfa8a0ad67b902c66
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Fri Mar 27 14:08:59 2009 +0000

    Use current snapshot dependency (1.0.7) for fulcrum-yaafi
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@759141 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index dad627a..f6747ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -98,7 +98,7 @@
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-yaafi</artifactId>
-      <version>1.0.6-SNAPSHOT</version>
+      <version>1.0.7-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

[turbine-fulcrum-factory] 07/49: Use release version 1.0.6 of YAAFI for test environment

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit ce68762fc3a314eaa5201b5de88bc8bc4d7c6c77
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun May 3 18:55:34 2009 +0000

    Use release version 1.0.6 of YAAFI for test environment
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@771100 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index f6747ae..a94e7a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -98,7 +98,7 @@
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-yaafi</artifactId>
-      <version>1.0.7-SNAPSHOT</version>
+      <version>1.0.6</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

[turbine-fulcrum-factory] 21/49: Document changes

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 92a880c1b37a416514a29e7cb5e680c463cc626d
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Nov 27 11:40:55 2016 +0000

    Document changes
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1771564 13f79535-47bb-0310-9956-ffa450edef68
---
 xdocs/changes.xml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 72784bc..b86d5ba 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -24,6 +24,14 @@
   </properties>
 
   <body>
+    <release version="1.0.5" date="in SVN">
+      <action dev="tv" type="add">
+        Added generics
+      </action>
+      <action dev="tv" type="update">
+        Employ more standard Maven layout
+      </action>
+    </release>
     <release version="1.0.4" date="2009-06-16">
       <action dev="tv" type="add">
         Added a Maven-2 build

[turbine-fulcrum-factory] 24/49: Adjust project layout to new Fulcrum standard

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit dde4c3d2cf5606fd0efd63511c930289f13d6957
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Nov 27 13:05:44 2016 +0000

    Adjust project layout to new Fulcrum standard
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1771582 13f79535-47bb-0310-9956-ffa450edef68
---
 {xdocs => src/changes}/changes.xml |  0
 xdocs/navigation.xml               | 38 --------------------------------------
 2 files changed, 38 deletions(-)

diff --git a/xdocs/changes.xml b/src/changes/changes.xml
similarity index 100%
rename from xdocs/changes.xml
rename to src/changes/changes.xml
diff --git a/xdocs/navigation.xml b/xdocs/navigation.xml
deleted file mode 100644
index 0fead1d..0000000
--- a/xdocs/navigation.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you 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.
--->
-
-<!DOCTYPE project [
-<!ENTITY site-nav SYSTEM "../../incl_site_nav.xml">
-]>
-
-<project
-  name="Fulcrum Factory"
-  href="http://turbine.apache.org/fulcrum/fulcrum-factory/">
-
-  <body>
-
-&site-nav;
-
-    <menu name="Overview">
-      <item name="Main"                 href="/index.html"/>
-      <item name="Tasks"                href="/tasks.html"/>
-    </menu>
-  </body>
-</project>

[turbine-fulcrum-factory] 33/49: Update yaafi to snapshot

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 8bfe0d9323ae258b306780e90229dfe9e9f85fc5
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Thu Oct 4 13:18:58 2018 +0000

    Update yaafi to snapshot
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1842808 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1fbf228..1656157 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,13 +83,13 @@
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-testcontainer</artifactId>
-      <version>1.0.6</version>
+      <version>1.0.8-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-yaafi</artifactId>
-      <version>1.0.6</version>
+      <version>1.0.8-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

[turbine-fulcrum-factory] 25/49: Update docs

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit d656a1d3a6793d5198a8111d107e24d54e6846b2
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Nov 27 13:31:01 2016 +0000

    Update docs
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1771588 13f79535-47bb-0310-9956-ffa450edef68
---
 xdocs/index.xml | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/xdocs/index.xml b/xdocs/index.xml
index b17ff14..c3a4cf8 100644
--- a/xdocs/index.xml
+++ b/xdocs/index.xml
@@ -120,13 +120,13 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.apache.fulcrum.ServiceException;
+import org.apache.fulcrum.factroy.FactoryException;
 import org.apache.fulcrum.factory.Factory;
 
 /**
  * A factory for instantiating DOM parsers.
  */
-public class DomBuilderFactory implements Factory
+public class DomBuilderFactory implements Factory<DocumentBuilder>
 {
     /**
      * The implementation of the factory.
@@ -137,7 +137,7 @@ public class DomBuilderFactory implements Factory
      * Initializes the factory.
      */
     public void init(String className)
-        throws ServiceException
+        throws FactoryException
     {
         factory = DocumentBuilderFactory.newInstance();
     }
@@ -145,8 +145,8 @@ public class DomBuilderFactory implements Factory
     /**
      * Gets a DocumentBuilder instance.
      */
-    public Object getInstance()
-        throws ServiceException
+    public DocumentBuilder getInstance()
+        throws FactoryException
     {
         try
         {
@@ -154,7 +154,7 @@ public class DomBuilderFactory implements Factory
         }
         catch (ParserConfigurationException x)
         {
-            throw new TurbineException(x);
+            throw new FactoryException(x);
         }
     }
 
@@ -162,8 +162,8 @@ public class DomBuilderFactory implements Factory
      * Gets a DocumentBuilder instance.
      * The given loader is ignored.
      */
-    public Object getInstance(ClassLoader loader)
-        throws ServiceException
+    public DocumentBuilder getInstance(ClassLoader loader)
+        throws FactoryException
     {
         return getInstance();
     }
@@ -172,9 +172,8 @@ public class DomBuilderFactory implements Factory
      * Gets a DocumentBuilder instance.
      * Constructor parameters are ignored.
      */
-    public Object getInstance(Object[] params,
-                              String[] signature)
-        throws ServiceException
+    public DocumentBuilder getInstance(Object[] params, String[] signature)
+        throws FactoryException
     {
         return getInstance();
     }
@@ -183,10 +182,10 @@ public class DomBuilderFactory implements Factory
      * Gets a DocumentBuilder instance.
      * The given loader and constructor parameters are ignored.
      */
-    public Object getInstance(ClassLoader loader,
-                              Object[] params,
-                              String[] signature)
-        throws ServiceException
+    public DocumentBuilder getInstance(ClassLoader loader,
+        Object[] params,
+        String[] signature)
+        throws FactoryException
     {
         return getInstance();
     }

[turbine-fulcrum-factory] 09/49: Prepare release

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 46100cdb0fa79aee6e69e2a834cf3beaa499b8f3
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Jun 15 18:07:00 2009 +0000

    Prepare release
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@784892 13f79535-47bb-0310-9956-ffa450edef68
---
 LICENSE.txt                            | 202 +++++++++++++++++++++++++++++++++
 NOTICE.txt                             |   6 +
 pom.xml                                |  28 ++++-
 xdocs/changes.xml => src/site/site.xml |  30 ++---
 xdocs/changes.xml                      |   5 +
 5 files changed, 245 insertions(+), 26 deletions(-)

diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 0000000..25533de
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,6 @@
+Turbine Fulcrum Factory Component
+Copyright 2005-2009 The Apache Software Foundation.
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/pom.xml b/pom.xml
index 0c81a50..5e1bc7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,10 +15,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.fulcrum</groupId>
     <artifactId>fulcrum-parent</artifactId>
@@ -107,5 +104,26 @@
     <sourceDirectory>${basedir}/src/java</sourceDirectory>
     <testSourceDirectory>${basedir}/src/test</testSourceDirectory>
   </build>
+
+  <profiles>
+    <profile>
+      <id>rc</id>
+      <distributionManagement>
+        <!-- Cannot define in parent ATM, see COMMONSSITE-26 -->
+        <site>
+          <id>apache.website</id>
+          <name>Apache Fulcrum Release Candidate Staging Site</name>
+          <url>${fulcrum.deployment.protocol}://people.apache.org/www/turbine.apache.org/builds/fulcrum/${fulcrum.componentid}/${fulcrum.release.version}/${fulcrum.rc.version}/site</url>
+        </site>
+      </distributionManagement>
+    </profile>
+  </profiles>
+  
+  <properties>
+    <!-- This bits are used for the staging directory -->
+    <fulcrum.release.version>1.0.4</fulcrum.release.version>
+    <fulcrum.rc.version>RC1</fulcrum.rc.version>  
+    <fulcrum.deployment.protocol>scpexe</fulcrum.deployment.protocol>
+  </properties>  
 	
 </project>
diff --git a/xdocs/changes.xml b/src/site/site.xml
similarity index 55%
copy from xdocs/changes.xml
copy to src/site/site.xml
index bcc5886..6f94bd6 100644
--- a/xdocs/changes.xml
+++ b/src/site/site.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="ISO-8859-1"?>
 <!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -17,26 +17,14 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<document>
-  <properties>
-    <title>Fulcrum Factory</title>
-    <author email="epugh@opensourceconnections.com">Eric Pugh</author>
-  </properties>
+<project
+  name="Fulcrum Factory"
+  href="http://turbine.apache.org/fulcrum/fulcrum-factory/">
 
   <body>
-    <release version="1.0.3" date="2004-11-24">
-      <action dev="epugh" type="update" due-to="Kostyantyn Shchekotykhin">
-        Merge api and impl jars into one project.
-      </action>
-      <action dev="epugh" type="update">
-      	Clean up dependencies.  Use TestContainer.
-      </action>
-    </release>
-	<release version="1.0.2" date="">
-      <action dev="epugh" type="update">
-      	Update to use Merlin 3.3.0
-      </action>
-    </release>
+    <menu name="Overview">
+      <item name="Main"                 href="/index.html"/>
+      <item name="ToDos"                href="/tasks.html" />
+    </menu>
   </body>
-</document>
-
+</project>
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index bcc5886..72784bc 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -24,6 +24,11 @@
   </properties>
 
   <body>
+    <release version="1.0.4" date="2009-06-16">
+      <action dev="tv" type="add">
+        Added a Maven-2 build
+      </action>
+    </release>
     <release version="1.0.3" date="2004-11-24">
       <action dev="epugh" type="update" due-to="Kostyantyn Shchekotykhin">
         Merge api and impl jars into one project.

[turbine-fulcrum-factory] 27/49: [maven-release-plugin] prepare release fulcrum-factory-1.1.0

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit a77f3634aae42a3313dd764fa4feee23d1e033ec
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Nov 27 13:37:52 2016 +0000

    [maven-release-plugin] prepare release fulcrum-factory-1.1.0
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1771591 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 431f7d6..d0670c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,16 +25,16 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.fulcrum</groupId>
   <artifactId>fulcrum-factory</artifactId>
-  <version>1.0.5-SNAPSHOT</version>
+  <version>1.1.0</version>
   <name>Fulcrum Factory</name>
   <inceptionYear>2005</inceptionYear>
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
-    <url>http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-factory-1.1.0</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-factory-1.1.0</developerConnection>
+    <url>http://svn.apache.org/viewvc/turbine/fulcrum/tags/fulcrum-factory-1.1.0</url>
   </scm>
 
   <developers>

[turbine-fulcrum-factory] 12/49: [maven-release-plugin] prepare release FULCRUM_FACTORY_1_0_4

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit b871c949bbe7aee57faab8e269b98be58a9e578e
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Jun 15 19:47:48 2009 +0000

    [maven-release-plugin] prepare release FULCRUM_FACTORY_1_0_4
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@784943 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 31 +++++++------------------------
 1 file changed, 7 insertions(+), 24 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5e1bc7b..9aaef39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,20 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You 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.
--->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.fulcrum</groupId>
@@ -24,16 +7,16 @@
 
   <modelVersion>4.0.0</modelVersion>
   <artifactId>fulcrum-factory</artifactId>
-  <version>1.0.4-SNAPSHOT</version>
+  <version>1.0.4</version>
   <name>Fulcrum Factory</name>
   <inceptionYear>2005</inceptionYear>
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
-    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/trunk/factory/</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</developerConnection>
+    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</url>
   </scm>
 
   <distributionManagement>
@@ -63,7 +46,7 @@
       <name>Siegfried Goeschl</name>
       <id>sgoeschl</id>
       <email>sgoeschl@apache.org</email>
-      <organization></organization>
+      <organization />
       <roles>
         <role>Java Developer</role>
       </roles>
@@ -72,7 +55,7 @@
       <name>Thomas Vandahl</name>
       <id>tv</id>
       <email>tv@apache.org</email>
-      <organization></organization>
+      <organization />
       <roles>
         <role>Java Developer</role>
       </roles>
@@ -126,4 +109,4 @@
     <fulcrum.deployment.protocol>scpexe</fulcrum.deployment.protocol>
   </properties>  
 	
-</project>
+</project>
\ No newline at end of file

[turbine-fulcrum-factory] 15/49: Remove Maven-1 control files for Maven-2-released components to avoid confusion.

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 78b4b16177f7ab0e56530009aab8e24fabc163f5
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Jun 21 19:04:29 2009 +0000

    Remove Maven-1 control files for Maven-2-released components to avoid confusion.
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@787068 13f79535-47bb-0310-9956-ffa450edef68
---
 maven.xml   | 26 --------------------------
 project.xml | 50 --------------------------------------------------
 2 files changed, 76 deletions(-)

diff --git a/maven.xml b/maven.xml
deleted file mode 100644
index 8c6e127..0000000
--- a/maven.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you 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.
--->
-<project default="jar:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util">
-
-  <!--preGoal name="java:compile">
-    <attainGoal name="avalon:meta"/>
-  </preGoal-->
-
-</project>
diff --git a/project.xml b/project.xml
deleted file mode 100644
index 47be3fe..0000000
--- a/project.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you 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.
--->
-<project>
-  <extend>${basedir}/../project.xml</extend>
-  <id>fulcrum-factory</id>
-  <name>Fulcrum Factory Component</name>
-  <currentVersion>1.0.3</currentVersion>
-  <versions>
-    <version>
-      <id>1.0.3</id>
-      <name>1.0.3</name>
-      <tag>FULCRUM_FACTORY_1_0_3</tag>
-    </version>
-  </versions>
-  <dependencies>
-
-    <!--  Needed only for testing -->
-    <dependency>
-      <groupId>fulcrum</groupId>
-      <artifactId>fulcrum-testcontainer</artifactId>
-      <version>1.0.5</version>
-    </dependency>
-
-    <dependency>
-      <groupId>fulcrum</groupId>
-      <artifactId>fulcrum-yaafi</artifactId>
-      <version>1.0.5</version>
-    </dependency>
-
-  </dependencies>
-
-</project>
-

[turbine-fulcrum-factory] 16/49: Added eclipse generated files to svn:ignore for all remaining fulcrum components.

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit f379993e7c506d6d32226e19991ea16b89243023
Author: Ludwig Magnusson <lu...@apache.org>
AuthorDate: Mon Oct 10 12:34:37 2011 +0000

    Added eclipse generated files to svn:ignore for all remaining fulcrum components.
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1180920 13f79535-47bb-0310-9956-ffa450edef68

[turbine-fulcrum-factory] 30/49: Inherit assembly descriptors from parent

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 3faf89d9bfff749a09b71b4fe5b3e8530a616a08
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Fri Dec 9 15:25:12 2016 +0000

    Inherit assembly descriptors from parent
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1773414 13f79535-47bb-0310-9956-ffa450edef68
---
 src/assembly/binaries.xml | 52 ----------------------------------------------
 src/assembly/source.xml   | 53 -----------------------------------------------
 2 files changed, 105 deletions(-)

diff --git a/src/assembly/binaries.xml b/src/assembly/binaries.xml
deleted file mode 100644
index 2eda8b7..0000000
--- a/src/assembly/binaries.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you 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.
--->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-  <id>bin</id>
-  <formats>
-    <format>tar.gz</format>
-    <format>zip</format>
-  </formats>
-  <fileSets>
-    <fileSet>
-      <directory>${project.basedir}</directory>
-      <outputDirectory>/</outputDirectory>
-      <includes>
-        <include>README*</include>
-      </includes>
-    </fileSet>
-    <fileSet>
-      <directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
-      <outputDirectory>/</outputDirectory>
-      <includes>
-        <include>LICENSE*</include>
-        <include>NOTICE*</include>
-      </includes>
-    </fileSet>
-    <fileSet>
-      <directory>${project.build.directory}</directory>
-      <outputDirectory>/</outputDirectory>
-      <includes>
-        <include>*.jar</include>
-      </includes>
-    </fileSet>
-  </fileSets>
-</assembly>
diff --git a/src/assembly/source.xml b/src/assembly/source.xml
deleted file mode 100644
index c06deb6..0000000
--- a/src/assembly/source.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you 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.
--->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-  <id>src</id>
-  <formats>
-    <format>tar.gz</format>
-    <format>zip</format>
-  </formats>
-  <fileSets>
-    <fileSet>
-      <directory>${project.basedir}</directory>
-      <includes>
-        <include>README*</include>
-        <include>pom.xml</include>
-      </includes>
-      <useDefaultExcludes>true</useDefaultExcludes>
-    </fileSet>
-    <fileSet>
-      <directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
-      <outputDirectory>/</outputDirectory>
-      <includes>
-        <include>LICENSE*</include>
-        <include>NOTICE*</include>
-      </includes>
-    </fileSet>
-    <fileSet>
-      <directory>${project.basedir}/src</directory>
-      <useDefaultExcludes>true</useDefaultExcludes>
-    </fileSet>
-    <fileSet>
-      <directory>${project.basedir}/xdocs</directory>
-    </fileSet>
-  </fileSets>
-</assembly>
\ No newline at end of file

[turbine-fulcrum-factory] 45/49: Add distribution management configuration to fulcrum modules

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 03debd7dd1e66317ff1e5bea3ca84c802563a8c4
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Mon May 20 15:49:44 2019 +0000

    Add distribution management configuration to fulcrum modules
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1859569 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pom.xml b/pom.xml
index 5b186af..61c7af5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,14 @@
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
+  <!-- Required for staging to work -->
+  <distributionManagement>
+    <site>
+      <id>turbine.apache.org</id>
+      <url>https://turbine.apache.org/fulcrum/fulcrum-factory/</url>
+    </site>
+  </distributionManagement>
+
   <scm>
     <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
     <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
@@ -101,6 +109,9 @@
 
   <properties>
     <turbine.site.path>fulcrum/fulcrum-factory</turbine.site.path>
+    <turbine.scmPubCheckoutDirectory>${turbine.site.cache}/fulcrum/factory</turbine.scmPubCheckoutDirectory>
+    <turbine.site.cache>${project.build.directory}/turbine-sites</turbine.site.cache>
+    <siteContent.path>${project.build.directory}/staging</siteContent.path><!-- default stagingSiteURL -->
   </properties>  
 	
 </project>

[turbine-fulcrum-factory] 18/49: Replace viewcvs with viewvc. Fixes TRB-95

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit d98ede32e9687261c60fb9e0db8c3b1c87a69765
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Feb 8 19:03:53 2015 +0000

    Replace viewcvs with viewvc. Fixes TRB-95
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1658246 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 741dde6..3ff9796 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
   <scm>
     <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
     <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
-    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/trunk/factory/</url>
+    <url>http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/</url>
   </scm>
 
   <distributionManagement>

[turbine-fulcrum-factory] 04/49: Moving to M2 build

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 9458abdbc5547326d7485c5bc1c1524300ac7698
Author: Siegfried Goeschl <sg...@apache.org>
AuthorDate: Mon Mar 23 18:19:03 2009 +0000

    Moving to M2 build
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@757484 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 111 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..0384bd0
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You 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.
+-->
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.apache.fulcrum</groupId>
+    <artifactId>fulcrum-parent</artifactId>
+    <version>1</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>fulcrum-factory</artifactId>
+  <version>1.0.4-SNAPSHOT</version>
+  <name>Fulcrum Factory</name>
+  <inceptionYear>2005</inceptionYear>
+  <description>Fulcrum Factory Service</description>
+  <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
+		
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
+    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/trunk/factory/</url>
+  </scm>
+
+  <distributionManagement>
+    <site>
+      <id>fulcrum.website</id>
+      <name>Fulcrum Website</name>
+      <url>${fulcrum.deployment.protocol}://people.apache.org/www/turbine.apache.org/fulcrum/fulcrum-factory/</url>
+    </site>    
+  </distributionManagement>
+	
+  <developers>
+    <developer>
+      <name>Eric Pugh</name>
+      <id>epugh</id>
+      <email>epugh@upstate.com</email>
+    </developer>  
+    <developer>
+      <name>Henning P. Schmiedehausen</name>
+      <id>henning</id>
+      <email>hps@intermeta.de</email>
+      <organization>INTERMETA - Gesellschaft fuer Mehrwertdienste mbH</organization>
+      <roles>
+        <role>Java Developer</role>
+      </roles>      
+    </developer>  
+    <developer>
+      <name>Siegfried Goeschl</name>
+      <id>sgoeschl</id>
+      <email>sgoeschl@apache.org</email>
+      <organization></organization>
+      <roles>
+        <role>Java Developer</role>
+      </roles>
+    </developer>
+    <developer>
+      <name>Thomas Vandahl</name>
+      <id>tv</id>
+      <email>tv@apache.org</email>
+      <organization></organization>
+      <roles>
+        <role>Java Developer</role>
+      </roles>
+    </developer>
+  </developers>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.avalon.framework</groupId>
+      <artifactId>avalon-framework-api</artifactId>
+      <version>4.3.1</version>
+    </dependency>    
+    <!-- testing dependencies -->
+    <dependency>
+      <groupId>org.apache.fulcrum</groupId>
+      <artifactId>fulcrum-testcontainer</artifactId>
+      <version>1.0.6-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.fulcrum</groupId>
+      <artifactId>fulcrum-yaafi</artifactId>
+      <version>1.0.6-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <sourceDirectory>${basedir}/src/java</sourceDirectory>
+    <testSourceDirectory>${basedir}/src/test</testSourceDirectory>
+  </build>
+	
+</project>

[turbine-fulcrum-factory] 37/49: Code cleanup, more Java 8 syntax, cleared all Findbugs and PMD reports, update changes.xml

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit a9c563a583570e11571d634bf76f06c2cabaad6a
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Thu Dec 13 21:50:53 2018 +0000

    Code cleanup, more Java 8 syntax, cleared all Findbugs and PMD reports, update changes.xml
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1848903 13f79535-47bb-0310-9956-ffa450edef68
---
 src/changes/changes.xml                            |    9 +
 .../fulcrum/factory/DefaultFactoryService.java     | 1048 +++++++++-----------
 .../apache/fulcrum/factory/FactoryException.java   |   76 +-
 3 files changed, 519 insertions(+), 614 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index c471df9..f55c121 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -25,6 +25,15 @@
 
   <body>
     <release version="1.1.1" date="in SVN">
+		<action dev="painter" type="update">
+			Addressed all PMD static code analyzer issues and corrected where appropriate
+		</action>
+		<action dev="painter" type="update">
+			Derive from Turbine parent POM 5
+		</action>
+		<action dev="painter" type="update">
+			Require Java 8
+		</action>
     </release>
     <release version="1.1.0" date="2016-11-27">
       <action dev="tv" type="add">
diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
index 15df0f5..0e6d599 100644
--- a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -36,585 +36,485 @@ import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.fulcrum.factory.utils.ObjectInputStreamForContext;
 
 /**
- * The Factory Service instantiates objects using specified
- * class loaders. If none is specified, the default one
- * will be used.
+ * The Factory Service instantiates objects using specified class loaders. If
+ * none is specified, the default one will be used.
  * 
- * avalon.component name="factory" lifestyle="singleton"
- * avalon.service   type="org.apache.fulcrum.factory.FactoryService"
+ * avalon.component name="factory" lifestyle="singleton" avalon.service
+ * type="org.apache.fulcrum.factory.FactoryService"
  *
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
  * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
- * @version $Id$
+ * @version $Id: DefaultFactoryService.java 1844842 2018-10-25 15:33:42Z painter
+ *          $
  *
  */
-public class DefaultFactoryService
-    extends AbstractLogEnabled
-    implements FactoryService, Configurable, Initializable, Disposable
-{
-    protected boolean initialized = false;
-
-    /**
-     * The property specifying a set of additional class loaders.
-     */
-    private static final String CLASS_LOADER = "classloader";
-    
-    /**
-     * The property prefix specifying additional object factories.
-     */
-    private static final String OBJECT_FACTORY = "object-factory";
-    
-    /**
-     * The name of the default factory.
-     */
-    protected static final String DEFAULT_FACTORY = "default";
-    
-    /**
-     * Primitive classes for reflection of constructors.
-     */
-    private static HashMap<String, Class<?>> primitiveClasses = new HashMap<String, Class<?>>(8);
-
-    {
-        primitiveClasses.put(Boolean.TYPE.toString(), Boolean.TYPE);
-        primitiveClasses.put(Character.TYPE.toString(), Character.TYPE);
-        primitiveClasses.put(Byte.TYPE.toString(), Byte.TYPE);
-        primitiveClasses.put(Short.TYPE.toString(), Short.TYPE);
-        primitiveClasses.put(Integer.TYPE.toString(), Integer.TYPE);
-        primitiveClasses.put(Long.TYPE.toString(), Long.TYPE);
-        primitiveClasses.put(Float.TYPE.toString(), Float.TYPE);
-        primitiveClasses.put(Double.TYPE.toString(), Double.TYPE);
-    }
-
-    /**
-     * temporary storage of class names between configure and initialize
-     */
-    private String[] loaderNames;
-    /**
-     * Additional class loaders.
-     */
-    private ArrayList<ClassLoader> classLoaders = new ArrayList<ClassLoader>();
-    /**
-     * Customized object factories.
-     */
-    private ConcurrentHashMap<String, Factory<?>> objectFactories =
-            new ConcurrentHashMap<String, Factory<?>>();
-    /**
-     * Customized object factory classes.
-     */
-    private ConcurrentHashMap<String, String> objectFactoryClasses =
-            new ConcurrentHashMap<String, String>();
-
-    /**
-     * Gets the class of a primitive type.
-     *
-     * @param type a primitive type.
-     * @return the corresponding class, or null.
-     */
-    protected static Class<?> getPrimitiveClass(String type)
-    {
-        return primitiveClasses.get(type);
-    }
-
-    /**
-     * Gets an instance of a named class.
-     *
-     * @param className the name of the class.
-     * @return the instance.
-     * @throws FactoryException if instantiation fails.
-     */
-    @Override
-    public <T> T getInstance(String className) throws FactoryException
-    {
-        if (className == null)
-        {
-            throw new FactoryException("Missing String className");
-        }
-        Factory<T> factory = getFactory(className);
-        if (factory == null)
-        {
-            Class<T> clazz;
-            try
-            {
-                clazz = loadClass(className);
-            }
-            catch (ClassNotFoundException x)
-            {
-                throw new FactoryException("Instantiation failed for class " + className, x);
-            }
-            return getInstance(clazz);
-        }
-        else
-        {
-            return factory.getInstance();
-        }
-    }
-    /**
-     * Gets an instance of a named class using a specified class loader.
-     *
-     * <p>Class loaders are supported only if the isLoaderSupported
-     * method returns true. Otherwise the loader parameter is ignored.
-     *
-     * @param className the name of the class.
-     * @param loader the class loader.
-     * @return the instance.
-     * @throws FactoryException if instantiation fails.
-     */
-    @Override
-    public <T> T getInstance(String className, ClassLoader loader) throws FactoryException
-    {
-        Factory<T> factory = getFactory(className);
-        if (factory == null)
-        {
-            if (loader != null)
-            {
-                Class<T> clazz;
-                try
-                {
-                    clazz = loadClass(className, loader);
-                }
-                catch (ClassNotFoundException x)
-                {
-                    throw new FactoryException("Instantiation failed for class " + className, x);
-                }
-                return getInstance(clazz);
-            }
-            else
-            {
-                return getInstance(className);
-            }
-        }
-        else
-        {
-            return factory.getInstance(loader);
-        }
-    }
-    /**
-     * Gets an instance of a named class.
-     * Parameters for its constructor are given as an array of objects,
-     * primitive types must be wrapped with a corresponding class.
-     *
-     * @param className the name of the class.
-     * @param params an array containing the parameters of the constructor.
-     * @param signature an array containing the signature of the constructor.
-     * @return the instance.
-     * @throws FactoryException if instantiation fails.
-     */
-    @Override
-    public <T> T getInstance(String className, Object[] params, String[] signature) throws FactoryException
-    {
-        Factory<T> factory = getFactory(className);
-        if (factory == null)
-        {
-            Class<T> clazz;
-            try
-            {
-                clazz = loadClass(className);
-            }
-            catch (ClassNotFoundException x)
-            {
-                throw new FactoryException("Instantiation failed for class " + className, x);
-            }
-            return getInstance(clazz, params, signature);
-        }
-        else
-        {
-            return factory.getInstance(params, signature);
-        }
-    }
-    /**
-     * Gets an instance of a named class using a specified class loader.
-     * Parameters for its constructor are given as an array of objects,
-     * primitive types must be wrapped with a corresponding class.
-     *
-     * <p>Class loaders are supported only if the isLoaderSupported
-     * method returns true. Otherwise the loader parameter is ignored.
-     *
-     * @param className the name of the class.
-     * @param loader the class loader.
-     * @param params an array containing the parameters of the constructor.
-     * @param signature an array containing the signature of the constructor.
-     * @return the instance.
-     * @throws FactoryException if instantiation fails.
-     */
-    @Override
-    public <T> T getInstance(String className, ClassLoader loader, Object[] params, String[] signature)
-        throws FactoryException
-    {
-        Factory<T> factory = getFactory(className);
-        if (factory == null)
-        {
-            if (loader != null)
-            {
-                Class<T> clazz;
-                try
-                {
-                    clazz = loadClass(className, loader);
-                }
-                catch (ClassNotFoundException x)
-                {
-                    throw new FactoryException("Instantiation failed for class " + className, x);
-                }
-                return getInstance(clazz, params, signature);
-            }
-            else
-            {
-                return getInstance(className, params, signature);
-            }
-        }
-        else
-        {
-            return factory.getInstance(loader, params, signature);
-        }
-    }
-    /**
-     * Tests if specified class loaders are supported for a named class.
-     *
-     * @param className the name of the class.
-     * @return true if class loaders are supported, false otherwise.
-     * @throws FactoryException if test fails.
-     */
-    @Override
-    public boolean isLoaderSupported(String className) throws FactoryException
-    {
-        Factory<?> factory = getFactory(className);
-        return factory != null ? factory.isLoaderSupported() : true;
-    }
-    /**
-     * Gets an instance of a specified class.
-     *
-     * @param clazz the class.
-     * @return the instance.
-     * @throws FactoryException if instantiation fails.
-     */
-    @Override
-    public <T> T getInstance(Class<T> clazz) throws FactoryException
-    {
-        try
-        {
-            return clazz.newInstance();
-        }
-        catch (Exception x)
-        {
-            throw new FactoryException("Instantiation failed for " + clazz.getName(), x);
-        }
-    }
-    /**
-     * Gets an instance of a specified class.
-     * Parameters for its constructor are given as an array of objects,
-     * primitive types must be wrapped with a corresponding class.
-     *
-     * @param clazz the class.
-     * @param params an array containing the parameters of the constructor.
-     * @param signature an array containing the signature of the constructor.
-     * @return the instance.
-     * @throws FactoryException if instantiation fails.
-     */
-    protected <T> T getInstance(Class<T> clazz, Object params[], String signature[]) throws FactoryException
-    {
-        /* Try to construct. */
-        try
-        {
-            Class<?>[] sign = getSignature(clazz, params, signature);
-            return clazz.getConstructor(sign).newInstance(params);
-        }
-        catch (Exception x)
-        {
-            throw new FactoryException("Instantiation failed for " + clazz.getName(), x);
-        }
-    }
-    /**
-     * Gets the signature classes for parameters of a method of a class.
-     *
-     * @param clazz the class.
-     * @param params an array containing the parameters of the method.
-     * @param signature an array containing the signature of the method.
-     * @return an array of signature classes. Note that in some cases
-     * objects in the parameter array can be switched to the context
-     * of a different class loader.
-     * @throws ClassNotFoundException if any of the classes is not found.
-     */
-    @Override
-    public Class<?>[] getSignature(Class<?> clazz, Object params[], String signature[]) throws ClassNotFoundException
-    {
-        if (signature != null)
-        {
-            /* We have parameters. */
-            ClassLoader tempLoader;
-            ClassLoader loader = clazz.getClassLoader();
-            Class<?>[] sign = new Class[signature.length];
-            for (int i = 0; i < signature.length; i++)
-            {
-                /* Check primitive types. */
-                sign[i] = getPrimitiveClass(signature[i]);
-                if (sign[i] == null)
-                {
-                    /* Not a primitive one, continue building. */
-                    if (loader != null)
-                    {
-                        /* Use the class loader of the target object. */
-                        sign[i] = loader.loadClass(signature[i]);
-                        tempLoader = sign[i].getClassLoader();
-                        if ((params[i] != null)
-                            && (tempLoader != null)
-                            && !tempLoader.equals(params[i].getClass().getClassLoader()))
-                        {
-                            /*
-                             * The class uses a different class loader,
-                             * switch the parameter.
-                             */
-                            params[i] = switchObjectContext(params[i], loader);
-                        }
-                    }
-                    else
-                    {
-                        /* Use the default class loader. */
-                        sign[i] = loadClass(signature[i]);
-                    }
-                }
-            }
-            return sign;
-        }
-        else
-        {
-            return null;
-        }
-    }
-    /**
-     * Switches an object into the context of a different class loader.
-     *
-     * @param object an object to switch.
-     * @param loader the ClassLoader to use
-     * @param loader the loader of the new context.
-     * @return the object
-     */
-    protected Object switchObjectContext(Object object, ClassLoader loader)
-    {
-        ByteArrayOutputStream bout = new ByteArrayOutputStream();
-
-        try
-        {
-            ObjectOutputStream out = new ObjectOutputStream(bout);
-            out.writeObject(object);
-            out.flush();
-        }
-        catch (IOException x)
-        {
-            return object;
-        }
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStreamForContext in = null;
-
-        try
-        {
-            in = new ObjectInputStreamForContext(bin, loader);
-            return in.readObject();
-        }
-        catch (Exception x)
-        {
-            return object;
-        }
-        finally
-        {
-            if (in != null)
-            {
-                try
-                {
-                    in.close();
-                }
-                catch (IOException e)
-                {
-                    // close quietly
-                }
-            }
-        }
-    }
-    /**
-     * Loads the named class using the default class loader.
-     *
-     * @param className the name of the class to load.
-     * @return {@inheritDoc} the loaded class.
-     * @throws ClassNotFoundException if the class was not found.
-     */
-    @SuppressWarnings("unchecked")
-    protected <T> Class<T> loadClass(String className) throws ClassNotFoundException
-    {
-        ClassLoader loader = this.getClass().getClassLoader();
-        try
-        {
-            Class<T> clazz;
-
-            if (loader != null)
-            {
-                clazz = (Class<T>) loader.loadClass(className);
-            }
-            else
-            {
-                clazz = (Class<T>) Class.forName(className);
-            }
-
-            return clazz;
-        }
-        catch (ClassNotFoundException x)
-        {
-            /* Go through additional loaders. */
-            for (ClassLoader l : classLoaders)
-            {
-                try
-                {
-                    return (Class<T>) l.loadClass(className);
-                }
-                catch (ClassNotFoundException xx)
-                {
-                    // continue
-                }
-            }
-            /* Give up. */
-            throw x;
-        }
-    }
-    /**
-     * Loads the named class using a specified class loader.
-     *
-     * @param className the name of the class to load.
-     * @param loader the loader to use.
-     * @return {@inheritDoc} the loaded class.
-     * @throws ClassNotFoundException if the class was not found.
-     */
-    @SuppressWarnings("unchecked")
-    protected <T> Class<T> loadClass(String className, ClassLoader loader) throws ClassNotFoundException
-    {
-        if (loader != null)
-        {
-            return (Class<T>) loader.loadClass(className);
-        }
-        else
-        {
-            return loadClass(className);
-        }
-    }
-    /**
-     * Gets a customized factory for a named class. If no class-specific
-     * factory is specified but a default factory is, will use the default
-     * factory.
-     *
-     * @param className the name of the class to load.
-     * @return {@inheritDoc} the factory, or null if not specified and no default.
-     * @throws FactoryException if instantiation of the factory fails.
-     */
-    @SuppressWarnings("unchecked")
-    protected <T> Factory<T> getFactory(String className) throws FactoryException
-    {
-        Factory<T> factory = (Factory<T>) objectFactories.get(className);
-        if (factory == null)
-        {
-            //No named factory for this; try the default, if one
-            //exists.
-            factory = (Factory<T>) objectFactories.get(DEFAULT_FACTORY);
-        }
-        if (factory == null)
-        {
-            /* Not yet instantiated... */
-            String factoryClass = objectFactoryClasses.get(className);
-            if (factoryClass == null)
-            {
-                factoryClass = objectFactoryClasses.get(DEFAULT_FACTORY);
-            }
-            if (factoryClass == null)
-            {
-                return null;
-            }
-
-            try
-            {
-                factory = getInstance(factoryClass);
-                factory.init(className);
-            }
-            catch (ClassCastException x)
-            {
-                throw new FactoryException("Incorrect factory " + factoryClass + " for class " + className, x);
-            }
-            Factory<T> _factory = (Factory<T>) objectFactories.putIfAbsent(className, factory);
-            if (_factory != null)
-            {
-                // Already created - take first instance
-                factory = _factory;
-            }
-        }
-
-        return factory;
-    }
-
-    // ---------------- Avalon Lifecycle Methods ---------------------
-    /**
-     * Avalon component lifecycle method
-     */
-    @Override
-    public void configure(Configuration conf) throws ConfigurationException
-    {
-        final Configuration[] loaders = conf.getChildren(CLASS_LOADER);
-        if (loaders != null)
-        {
-            loaderNames = new String[loaders.length];
-            for (int i = 0; i < loaders.length; i++)
-            {
-                loaderNames[i] = loaders[i].getValue();
-            }
-        }
-        final Configuration factories = conf.getChild(OBJECT_FACTORY, false);
-        if (factories != null)
-        {
-            Configuration[] nameVal = factories.getChildren();
-            for (int i = 0; i < nameVal.length; i++)
-            {
-                String key = nameVal[i].getName();
-                String factory = nameVal[i].getValue();
-                // Store the factory to the table as a string and
-                // instantiate it by using the service when needed.
-                objectFactoryClasses.put(key, factory);
-            }
-        }
-    }
-
-    /**
-     * Avalon component lifecycle method
-     * Initializes the service by loading default class loaders
-     * and customized object factories.
-     *
-     * @throws Exception if initialization fails.
-     */
-    @Override
-    public void initialize() throws Exception
-    {
-        if (loaderNames != null)
-        {
-            for (int i = 0; i < loaderNames.length; i++)
-            {
-                try
-                {
-                    ClassLoader loader = (ClassLoader) loadClass(loaderNames[i]).newInstance();
-                    classLoaders.add(loader);
-                }
-                catch (Exception x)
-                {
-                    throw new Exception(
-                        "No such class loader '" + loaderNames[i] + "' for DefaultFactoryService", x);
-                }
-            }
-            loaderNames = null;
-        }
-    }
-
-    /**
-     * Avalon component lifecycle method
-     * Clear lists and maps
-     */
-    @Override
-    public void dispose()
-    {
-        objectFactories.clear();
-        objectFactoryClasses.clear();
-        classLoaders.clear();
-    }
+public class DefaultFactoryService extends AbstractLogEnabled
+		implements FactoryService, Configurable, Initializable, Disposable {
+
+	/**
+	 * The property specifying a set of additional class loaders.
+	 */
+	private static final String CLASS_LOADER = "classloader";
+
+	/**
+	 * The property prefix specifying additional object factories.
+	 */
+	private static final String OBJECT_FACTORY = "object-factory";
+
+	/**
+	 * The name of the default factory.
+	 */
+	protected static final String DEFAULT_FACTORY = "default";
+
+	/**
+	 * Primitive classes for reflection of constructors.
+	 */
+	private static HashMap<String, Class<?>> primitiveClasses = new HashMap<String, Class<?>>(8);
+
+	{
+		primitiveClasses.put(Boolean.TYPE.toString(), Boolean.TYPE);
+		primitiveClasses.put(Character.TYPE.toString(), Character.TYPE);
+		primitiveClasses.put(Byte.TYPE.toString(), Byte.TYPE);
+		primitiveClasses.put(Short.TYPE.toString(), Short.TYPE);
+		primitiveClasses.put(Integer.TYPE.toString(), Integer.TYPE);
+		primitiveClasses.put(Long.TYPE.toString(), Long.TYPE);
+		primitiveClasses.put(Float.TYPE.toString(), Float.TYPE);
+		primitiveClasses.put(Double.TYPE.toString(), Double.TYPE);
+	}
+
+	/**
+	 * temporary storage of class names between configure and initialize
+	 */
+	private String[] loaderNames;
+	/**
+	 * Additional class loaders.
+	 */
+	private ArrayList<ClassLoader> classLoaders = new ArrayList<ClassLoader>();
+	/**
+	 * Customized object factories.
+	 */
+	private ConcurrentHashMap<String, Factory<?>> objectFactories = new ConcurrentHashMap<String, Factory<?>>();
+	/**
+	 * Customized object factory classes.
+	 */
+	private ConcurrentHashMap<String, String> objectFactoryClasses = new ConcurrentHashMap<String, String>();
+
+	/**
+	 * Gets the class of a primitive type.
+	 *
+	 * @param type a primitive type.
+	 * @return the corresponding class, or null.
+	 */
+	protected static Class<?> getPrimitiveClass(String type) {
+		return primitiveClasses.get(type);
+	}
+
+	/**
+	 * Gets an instance of a named class.
+	 *
+	 * @param className the name of the class.
+	 * @return the instance.
+	 * @throws FactoryException if instantiation fails.
+	 */
+	@Override
+	public <T> T getInstance(String className) throws FactoryException {
+		if (className == null) {
+			throw new FactoryException("Missing String className");
+		}
+		Factory<T> factory = getFactory(className);
+		if (factory == null) {
+			Class<T> clazz;
+			try {
+				clazz = loadClass(className);
+			} catch (ClassNotFoundException x) {
+				throw new FactoryException("Instantiation failed for class " + className, x);
+			}
+			return getInstance(clazz);
+		} else {
+			return factory.getInstance();
+		}
+	}
+
+	/**
+	 * Gets an instance of a named class using a specified class loader.
+	 *
+	 * <p>
+	 * Class loaders are supported only if the isLoaderSupported method returns
+	 * true. Otherwise the loader parameter is ignored.
+	 *
+	 * @param className the name of the class.
+	 * @param loader    the class loader.
+	 * @return the instance.
+	 * @throws FactoryException if instantiation fails.
+	 */
+	@Override
+	public <T> T getInstance(String className, ClassLoader loader) throws FactoryException {
+		Factory<T> factory = getFactory(className);
+		if (factory == null) {
+			if (loader != null) {
+				Class<T> clazz;
+				try {
+					clazz = loadClass(className, loader);
+				} catch (ClassNotFoundException x) {
+					throw new FactoryException("Instantiation failed for class " + className, x);
+				}
+				return getInstance(clazz);
+			} else {
+				return getInstance(className);
+			}
+		} else {
+			return factory.getInstance(loader);
+		}
+	}
+
+	/**
+	 * Gets an instance of a named class. Parameters for its constructor are given
+	 * as an array of objects, primitive types must be wrapped with a corresponding
+	 * class.
+	 *
+	 * @param className the name of the class.
+	 * @param params    an array containing the parameters of the constructor.
+	 * @param signature an array containing the signature of the constructor.
+	 * @return the instance.
+	 * @throws FactoryException if instantiation fails.
+	 */
+	@Override
+	public <T> T getInstance(String className, Object[] params, String[] signature) throws FactoryException {
+		Factory<T> factory = getFactory(className);
+		if (factory == null) {
+			Class<T> clazz;
+			try {
+				clazz = loadClass(className);
+			} catch (ClassNotFoundException x) {
+				throw new FactoryException("Instantiation failed for class " + className, x);
+			}
+			return getInstance(clazz, params, signature);
+		} else {
+			return factory.getInstance(params, signature);
+		}
+	}
+
+	/**
+	 * Gets an instance of a named class using a specified class loader. Parameters
+	 * for its constructor are given as an array of objects, primitive types must be
+	 * wrapped with a corresponding class.
+	 *
+	 * <p>
+	 * Class loaders are supported only if the isLoaderSupported method returns
+	 * true. Otherwise the loader parameter is ignored.
+	 *
+	 * @param className the name of the class.
+	 * @param loader    the class loader.
+	 * @param params    an array containing the parameters of the constructor.
+	 * @param signature an array containing the signature of the constructor.
+	 * @return the instance.
+	 * @throws FactoryException if instantiation fails.
+	 */
+	@Override
+	public <T> T getInstance(String className, ClassLoader loader, Object[] params, String[] signature)
+			throws FactoryException {
+		Factory<T> factory = getFactory(className);
+		if (factory == null) {
+			if (loader != null) {
+				Class<T> clazz;
+				try {
+					clazz = loadClass(className, loader);
+				} catch (ClassNotFoundException x) {
+					throw new FactoryException("Instantiation failed for class " + className, x);
+				}
+				return getInstance(clazz, params, signature);
+			} else {
+				return getInstance(className, params, signature);
+			}
+		} else {
+			return factory.getInstance(loader, params, signature);
+		}
+	}
+
+	/**
+	 * Tests if specified class loaders are supported for a named class.
+	 *
+	 * @param className the name of the class.
+	 * @return true if class loaders are supported, false otherwise.
+	 * @throws FactoryException if test fails.
+	 */
+	@Override
+	public boolean isLoaderSupported(String className) throws FactoryException {
+		Factory<?> factory = getFactory(className);
+		return factory != null ? factory.isLoaderSupported() : true;
+	}
+
+	/**
+	 * Gets an instance of a specified class.
+	 *
+	 * @param clazz the class.
+	 * @return the instance.
+	 * @throws FactoryException if instantiation fails.
+	 */
+	@Override
+	public <T> T getInstance(Class<T> clazz) throws FactoryException {
+		try {
+			return clazz.newInstance();
+		} catch (Exception x) {
+			throw new FactoryException("Instantiation failed for " + clazz.getName(), x);
+		}
+	}
+
+	/**
+	 * Gets an instance of a specified class. Parameters for its constructor are
+	 * given as an array of objects, primitive types must be wrapped with a
+	 * corresponding class.
+	 *
+	 * @param           <T> Type of the class
+	 * @param clazz     the class
+	 * @param params    an array containing the parameters of the constructor
+	 * @param signature an array containing the signature of the constructor
+	 * @return the instance
+	 * @throws FactoryException if instantiation fails.
+	 */
+	protected <T> T getInstance(Class<T> clazz, Object params[], String signature[]) throws FactoryException {
+		/* Try to construct. */
+		try {
+			Class<?>[] sign = getSignature(clazz, params, signature);
+			return clazz.getConstructor(sign).newInstance(params);
+		} catch (Exception x) {
+			throw new FactoryException("Instantiation failed for " + clazz.getName(), x);
+		}
+	}
+
+	/**
+	 * Gets the signature classes for parameters of a method of a class.
+	 *
+	 * @param clazz     the class.
+	 * @param params    an array containing the parameters of the method.
+	 * @param signature an array containing the signature of the method.
+	 * @return an array of signature classes. Note that in some cases objects in the
+	 *         parameter array can be switched to the context of a different class
+	 *         loader.
+	 * @throws ClassNotFoundException if any of the classes is not found.
+	 */
+	@Override
+	public Class<?>[] getSignature(Class<?> clazz, Object params[], String signature[]) throws ClassNotFoundException {
+		if (signature != null) {
+			/* We have parameters. */
+			ClassLoader tempLoader;
+			ClassLoader loader = clazz.getClassLoader();
+			Class<?>[] sign = new Class[signature.length];
+			for (int i = 0; i < signature.length; i++) {
+				/* Check primitive types. */
+				sign[i] = getPrimitiveClass(signature[i]);
+				if (sign[i] == null) {
+					/* Not a primitive one, continue building. */
+					if (loader != null) {
+						/* Use the class loader of the target object. */
+						sign[i] = loader.loadClass(signature[i]);
+						tempLoader = sign[i].getClassLoader();
+						if (params[i] != null && tempLoader != null
+								&& !tempLoader.equals(params[i].getClass().getClassLoader())) {
+							/*
+							 * The class uses a different class loader, switch the parameter.
+							 */
+							params[i] = switchObjectContext(params[i], loader);
+						}
+					} else {
+						/* Use the default class loader. */
+						sign[i] = loadClass(signature[i]);
+					}
+				}
+			}
+			return sign;
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Switches an object into the context of a different class loader.
+	 *
+	 * @param object an object to switch.
+	 * @param loader the ClassLoader to use
+	 * @param loader the loader of the new context.
+	 * @return the object
+	 */
+	protected Object switchObjectContext(Object object, ClassLoader loader) {
+		ByteArrayOutputStream bout = new ByteArrayOutputStream();
+
+		try {
+			ObjectOutputStream out = new ObjectOutputStream(bout);
+			out.writeObject(object);
+			out.flush();
+		} catch (IOException x) {
+			return object;
+		}
+
+		ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
+		ObjectInputStreamForContext in = null;
+
+		try {
+			in = new ObjectInputStreamForContext(bin, loader);
+			return in.readObject();
+		} catch (Exception x) {
+			return object;
+		} finally {
+			if (in != null) {
+				try {
+					in.close();
+				} catch (IOException e) {
+					// close quietly
+				}
+			}
+		}
+	}
+
+	/**
+	 * Loads the named class using the default class loader.
+	 *
+	 * @param className the name of the class to load.
+	 * @return {@inheritDoc} the loaded class.
+	 * @throws ClassNotFoundException if the class was not found.
+	 */
+	@SuppressWarnings("unchecked")
+	protected <T> Class<T> loadClass(String className) throws ClassNotFoundException {
+		ClassLoader loader = this.getClass().getClassLoader();
+		try {
+			Class<T> clazz;
+
+			if (loader != null) {
+				clazz = (Class<T>) loader.loadClass(className);
+			} else {
+				clazz = (Class<T>) Class.forName(className);
+			}
+
+			return clazz;
+		} catch (ClassNotFoundException x) {
+			/* Go through additional loaders. */
+			for (ClassLoader l : classLoaders) {
+				try {
+					return (Class<T>) l.loadClass(className);
+				} catch (ClassNotFoundException xx) {
+					// continue
+				}
+			}
+			/* Give up. */
+			throw x;
+		}
+	}
+
+	/**
+	 * Loads the named class using a specified class loader.
+	 *
+	 * @param className the name of the class to load.
+	 * @param loader    the loader to use.
+	 * @return {@inheritDoc} the loaded class.
+	 * @throws ClassNotFoundException if the class was not found.
+	 */
+	@SuppressWarnings("unchecked")
+	protected <T> Class<T> loadClass(String className, ClassLoader loader) throws ClassNotFoundException {
+		if (loader != null) {
+			return (Class<T>) loader.loadClass(className);
+		} else {
+			return loadClass(className);
+		}
+	}
+
+	/**
+	 * Gets a customized factory for a named class. If no class-specific factory is
+	 * specified but a default factory is, will use the default factory.
+	 *
+	 * @param className the name of the class to load.
+	 * @return {@inheritDoc} the factory, or null if not specified and no default.
+	 * @throws FactoryException if instantiation of the factory fails.
+	 */
+	@SuppressWarnings("unchecked")
+	protected <T> Factory<T> getFactory(String className) throws FactoryException {
+		Factory<T> factory = (Factory<T>) objectFactories.get(className);
+		if (factory == null) {
+			// No named factory for this; try the default, if one
+			// exists.
+			factory = (Factory<T>) objectFactories.get(DEFAULT_FACTORY);
+		}
+		if (factory == null) {
+			/* Not yet instantiated... */
+			String factoryClass = objectFactoryClasses.get(className);
+			if (factoryClass == null) {
+				factoryClass = objectFactoryClasses.get(DEFAULT_FACTORY);
+			}
+			if (factoryClass == null) {
+				return null;
+			}
+
+			try {
+				factory = getInstance(factoryClass);
+				factory.init(className);
+			} catch (ClassCastException x) {
+				throw new FactoryException("Incorrect factory " + factoryClass + " for class " + className, x);
+			}
+			Factory<T> _factory = (Factory<T>) objectFactories.putIfAbsent(className, factory);
+			if (_factory != null) {
+				// Already created - take first instance
+				factory = _factory;
+			}
+		}
+
+		return factory;
+	}
+
+	// ---------------- Avalon Lifecycle Methods ---------------------
+
+	/* (non-Javadoc)
+	 * Avalon component lifecycle method
+	 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
+	 */
+	@Override
+	public void configure(Configuration conf) throws ConfigurationException {
+		final Configuration[] loaders = conf.getChildren(CLASS_LOADER);
+		if (loaders != null) {
+			loaderNames = new String[loaders.length];
+			for (int i = 0; i < loaders.length; i++) {
+				loaderNames[i] = loaders[i].getValue();
+			}
+		}
+
+		final Configuration factories = conf.getChild(OBJECT_FACTORY, false);
+		if (factories != null) {
+			// Store the factory to the table as a string and
+			// instantiate it by using the service when needed.
+			Configuration[] nameVal = factories.getChildren();
+			for (Configuration entry : nameVal)
+				objectFactoryClasses.put(entry.getName(), entry.getValue());
+
+		}
+	}
+
+	/**
+	 * Avalon component lifecycle method Initializes the service by loading default
+	 * class loaders and customized object factories.
+	 *
+	 * @throws Exception if initialization fails.
+	 */
+	@Override
+	public void initialize() throws Exception {
+		if (loaderNames != null) {
+			for (String className : loaderNames) {
+				try {
+					ClassLoader loader = (ClassLoader) loadClass(className).newInstance();
+					classLoaders.add(loader);
+				} catch (Exception x) {
+					throw new Exception("No such class loader '" + className + "' for DefaultFactoryService", x);
+				}
+			}
+			loaderNames = null;
+		}
+	}
+
+	/**
+	 * Avalon component lifecycle method Clear lists and maps
+	 */
+	@Override
+	public void dispose() {
+		objectFactories.clear();
+		objectFactoryClasses.clear();
+		classLoaders.clear();
+	}
 }
diff --git a/src/java/org/apache/fulcrum/factory/FactoryException.java b/src/java/org/apache/fulcrum/factory/FactoryException.java
index ed234ae..1e1cae1 100644
--- a/src/java/org/apache/fulcrum/factory/FactoryException.java
+++ b/src/java/org/apache/fulcrum/factory/FactoryException.java
@@ -19,54 +19,50 @@ package org.apache.fulcrum.factory;
  * under the License.
  */
 
-import java.lang.Exception;
-
 /**
  * Exception thrown when there is a problem with the FactoryService
  *
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @version $Id$
  */
-public class FactoryException extends Exception
-{
-    /**
-     * Serial number
-     */
-    private static final long serialVersionUID = 8954422192583295720L;
+public class FactoryException extends Exception {
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 8954422192583295720L;
 
-    /**
-     * Default constructor
-     */
-    public FactoryException()
-    {
-        super();
-    }
+	/**
+	 * Default constructor
+	 */
+	public FactoryException() {
+		super();
+	}
 
-    /**
-     * {@link java.lang.Exception#Exception(String, Throwable)}
-     * @param message the message
-     * @param e the exception
-     */
-    public FactoryException(String message, Throwable e)
-    {
-        super(message, e);
-    }
+	/**
+	 * {@link java.lang.Exception#Exception(String, Throwable)}
+	 * 
+	 * @param message the message
+	 * @param e       the exception
+	 */
+	public FactoryException(String message, Throwable e) {
+		super(message, e);
+	}
 
-    /**
-     * {@link java.lang.Exception#Exception(Throwable)}
-     * @param e the exception to bubble up
-     */
-    public FactoryException(Throwable e)
-    {
-        super(e);
-    }
+	/**
+	 * {@link java.lang.Exception#Exception(Throwable)}
+	 * 
+	 * @param e the exception to bubble up
+	 */
+	public FactoryException(Throwable e) {
+		super(e);
+	}
 
-    /**
-     * {@link java.lang.Exception#Exception(String)}
-     * @param msg the message to bubble up
-     */
-    public FactoryException(String msg)
-    {
-        super(msg);
-    }
+	/**
+	 * {@link java.lang.Exception#Exception(String)}
+	 * 
+	 * @param msg the message to bubble up
+	 */
+	public FactoryException(String msg) {
+		super(msg);
+	}
 }

[turbine-fulcrum-factory] 36/49: Fix JavaDocs for factory

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit a848435c2c275309ff845abfff1597e6a5af5fc9
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Thu Oct 25 15:33:42 2018 +0000

    Fix JavaDocs for factory
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1844842 13f79535-47bb-0310-9956-ffa450edef68
---
 .../fulcrum/factory/DefaultFactoryService.java       | 20 +++++++++++++-------
 .../org/apache/fulcrum/factory/FactoryException.java | 12 +++++++++---
 .../org/apache/fulcrum/factory/FactoryService.java   | 12 ++++++------
 .../factory/utils/ObjectInputStreamForContext.java   | 17 ++++++++++++-----
 .../apache/fulcrum/factory/FactoryServiceTest.java   | 11 ++++++-----
 .../utils/ObjectInputStreamForContextTest.java       |  4 ----
 6 files changed, 46 insertions(+), 30 deletions(-)

diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
index 8d4a361..15df0f5 100644
--- a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -39,33 +39,37 @@ import org.apache.fulcrum.factory.utils.ObjectInputStreamForContext;
  * The Factory Service instantiates objects using specified
  * class loaders. If none is specified, the default one
  * will be used.
+ * 
+ * avalon.component name="factory" lifestyle="singleton"
+ * avalon.service   type="org.apache.fulcrum.factory.FactoryService"
  *
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
  * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
  * @version $Id$
  *
- * @avalon.component name="factory" lifestyle="singleton"
- * @avalon.service type="org.apache.fulcrum.factory.FactoryService"
  */
 public class DefaultFactoryService
     extends AbstractLogEnabled
     implements FactoryService, Configurable, Initializable, Disposable
 {
     protected boolean initialized = false;
-    //private boolean disposed = false;
+
     /**
      * The property specifying a set of additional class loaders.
      */
     private static final String CLASS_LOADER = "classloader";
+    
     /**
      * The property prefix specifying additional object factories.
      */
     private static final String OBJECT_FACTORY = "object-factory";
+    
     /**
      * The name of the default factory.
      */
     protected static final String DEFAULT_FACTORY = "default";
+    
     /**
      * Primitive classes for reflection of constructors.
      */
@@ -380,7 +384,9 @@ public class DefaultFactoryService
      * Switches an object into the context of a different class loader.
      *
      * @param object an object to switch.
+     * @param loader the ClassLoader to use
      * @param loader the loader of the new context.
+     * @return the object
      */
     protected Object switchObjectContext(Object object, ClassLoader loader)
     {
@@ -428,7 +434,7 @@ public class DefaultFactoryService
      * Loads the named class using the default class loader.
      *
      * @param className the name of the class to load.
-     * @return the loaded class.
+     * @return {@inheritDoc} the loaded class.
      * @throws ClassNotFoundException if the class was not found.
      */
     @SuppressWarnings("unchecked")
@@ -473,7 +479,7 @@ public class DefaultFactoryService
      *
      * @param className the name of the class to load.
      * @param loader the loader to use.
-     * @return the loaded class.
+     * @return {@inheritDoc} the loaded class.
      * @throws ClassNotFoundException if the class was not found.
      */
     @SuppressWarnings("unchecked")
@@ -494,7 +500,7 @@ public class DefaultFactoryService
      * factory.
      *
      * @param className the name of the class to load.
-     * @return the factory, or null if not specified and no default.
+     * @return {@inheritDoc} the factory, or null if not specified and no default.
      * @throws FactoryException if instantiation of the factory fails.
      */
     @SuppressWarnings("unchecked")
@@ -576,7 +582,7 @@ public class DefaultFactoryService
      * Initializes the service by loading default class loaders
      * and customized object factories.
      *
-     * @throws InitializationException if initialization fails.
+     * @throws Exception if initialization fails.
      */
     @Override
     public void initialize() throws Exception
diff --git a/src/java/org/apache/fulcrum/factory/FactoryException.java b/src/java/org/apache/fulcrum/factory/FactoryException.java
index 7865d90..ed234ae 100644
--- a/src/java/org/apache/fulcrum/factory/FactoryException.java
+++ b/src/java/org/apache/fulcrum/factory/FactoryException.java
@@ -19,6 +19,8 @@ package org.apache.fulcrum.factory;
  * under the License.
  */
 
+import java.lang.Exception;
+
 /**
  * Exception thrown when there is a problem with the FactoryService
  *
@@ -41,7 +43,9 @@ public class FactoryException extends Exception
     }
 
     /**
-     * @see java.lang.Exception(String, Throwable)
+     * {@link java.lang.Exception#Exception(String, Throwable)}
+     * @param message the message
+     * @param e the exception
      */
     public FactoryException(String message, Throwable e)
     {
@@ -49,7 +53,8 @@ public class FactoryException extends Exception
     }
 
     /**
-     * @see java.lang.Exception(Throwable)
+     * {@link java.lang.Exception#Exception(Throwable)}
+     * @param e the exception to bubble up
      */
     public FactoryException(Throwable e)
     {
@@ -57,7 +62,8 @@ public class FactoryException extends Exception
     }
 
     /**
-     * @see java.lang.Exception(String)
+     * {@link java.lang.Exception#Exception(String)}
+     * @param msg the message to bubble up
      */
     public FactoryException(String msg)
     {
diff --git a/src/java/org/apache/fulcrum/factory/FactoryService.java b/src/java/org/apache/fulcrum/factory/FactoryService.java
index a289bf3..f48ecd4 100644
--- a/src/java/org/apache/fulcrum/factory/FactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/FactoryService.java
@@ -41,7 +41,7 @@ public interface FactoryService
 	* Gets an instance of a class.
 	*
 	* @param clazz the name of the class.
-	* @return the instance.
+	* @return {@inheritDoc} the instance.
 	* @throws FactoryException if instantiation fails.
 	*/
    <T> T getInstance(Class<T> clazz)
@@ -51,7 +51,7 @@ public interface FactoryService
      * Gets an instance of a named class.
      *
      * @param className the name of the class.
-     * @return the instance.
+     * @return {@inheritDoc} the instance.
      * @throws FactoryException if instantiation fails.
      */
     <T> T getInstance(String className)
@@ -65,7 +65,7 @@ public interface FactoryService
      *
      * @param className the name of the class.
      * @param loader the class loader.
-     * @return the instance.
+     * @return {@inheritDoc} the instance.
      * @throws FactoryException if instantiation fails.
      */
     <T> T getInstance(String className,
@@ -80,7 +80,7 @@ public interface FactoryService
      * @param className the name of the class.
      * @param params an array containing the parameters of the constructor.
      * @param signature an array containing the signature of the constructor.
-     * @return the instance.
+     * @return {@inheritDoc} the instance.
      * @throws FactoryException if instantiation fails.
      */
     <T> T getInstance(String className,
@@ -100,7 +100,7 @@ public interface FactoryService
      * @param loader the class loader.
      * @param params an array containing the parameters of the constructor.
      * @param signature an array containing the signature of the constructor.
-     * @return the instance.
+     * @return {@inheritDoc} the instance.
      * @throws FactoryException if instantiation fails.
      */
     <T> T getInstance(String className,
@@ -125,7 +125,7 @@ public interface FactoryService
      * @param clazz the class.
      * @param params an array containing the parameters of the method.
      * @param signature an array containing the signature of the method.
-     * @return an array of signature classes. Note that in some cases
+     * @return {@inheritDoc} an array of signature classes. Note that in some cases
      * objects in the parameter array can be switched to the context
      * of a different class loader.
      * @throws ClassNotFoundException if any of the classes is not found.
diff --git a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
index 21eae4a..bf9338b 100644
--- a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
+++ b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
@@ -1,7 +1,5 @@
 package org.apache.fulcrum.factory.utils;
 
-import java.io.IOException;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -22,6 +20,7 @@ import java.io.IOException;
  */
 
 import java.io.InputStream;
+import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectStreamClass;
 
@@ -38,7 +37,11 @@ public class ObjectInputStreamForContext extends ObjectInputStream
      */
     private ClassLoader classLoader;
 
-    // this is to make the proxy happy.
+    /**
+     * this is to make the proxy happy.
+     * 
+     * @throws IOException Generic exception
+     */
     public ObjectInputStreamForContext()
         throws IOException
     {
@@ -60,9 +63,13 @@ public class ObjectInputStreamForContext extends ObjectInputStream
     }
 
     /**
-     * @see java.io.ObjectInputStream#resolveClass(ObjectStreamClass)
+     * {@link java.io.ObjectInputStream#resolveClass(ObjectStreamClass)}
+     * 
+     * @param v ObjectStreamClass to resolve
+     * @return {@inheritDoc} class to resolve
+     * @throws IOException if object stream not found
+     * @throws ClassNotFoundException if class not found
      */
-    @Override
     protected Class<?> resolveClass(ObjectStreamClass v)
                                  throws IOException,
                                  ClassNotFoundException
diff --git a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
index 0f0fe9e..e86a229 100644
--- a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
+++ b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
@@ -28,8 +28,6 @@ import org.apache.fulcrum.testcontainer.BaseUnitTest;
  * @author Eric Pugh
  * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
  *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
  */
 public class FactoryServiceTest extends BaseUnitTest
 {
@@ -102,15 +100,18 @@ public class FactoryServiceTest extends BaseUnitTest
         assertEquals(sourceValu, object.toString());
 
     }
+    
     /**
-     * @todo Need to run a test where the loader is NOT supported.
-     * @throws Exception
+     * Test if the loader is supported
+     * 
+     * @throws Exception Generic exception
      */
     public void testIsLoaderSupported() throws Exception
     {
+        // TODO Need to run a test where the loader is NOT supported.
         assertTrue(factoryService.isLoaderSupported("java.lang.String"));
-
     }
+    
     public void testGetSignature() throws Exception
     {
         Object params[] = new Object[1];
diff --git a/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java b/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
index f00fa7e..d8010a1 100644
--- a/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
+++ b/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
@@ -26,11 +26,7 @@ import junit.framework.TestCase;
 
 /**
  * @author Eric Pugh
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
  */
-
 public class ObjectInputStreamForContextTest extends TestCase
 {
     public static void main(String[] args)

[turbine-fulcrum-factory] 26/49: Some cleanup before release

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit e4fd291da111aab99b03cb225a59b1dfa15dbc28
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Nov 27 13:36:13 2016 +0000

    Some cleanup before release
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1771590 13f79535-47bb-0310-9956-ffa450edef68
---
 src/changes/changes.xml                            |  4 ++-
 .../fulcrum/factory/DefaultFactoryService.java     |  1 +
 .../apache/fulcrum/factory/FactoryException.java   | 31 +++++++++++++++++++---
 .../org/apache/fulcrum/factory/FactoryService.java | 17 +++++-------
 .../factory/utils/ObjectInputStreamForContext.java |  2 +-
 5 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b86d5ba..c471df9 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,7 +24,9 @@
   </properties>
 
   <body>
-    <release version="1.0.5" date="in SVN">
+    <release version="1.1.1" date="in SVN">
+    </release>
+    <release version="1.1.0" date="2016-11-27">
       <action dev="tv" type="add">
         Added generics
       </action>
diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
index f058372..221f65f 100644
--- a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -82,6 +82,7 @@ public class DefaultFactoryService
         primitiveClasses.put(Float.TYPE.toString(), Float.TYPE);
         primitiveClasses.put(Double.TYPE.toString(), Double.TYPE);
     }
+
     /**
      * temporary storage of class names between configure and initialize
      */
diff --git a/src/java/org/apache/fulcrum/factory/FactoryException.java b/src/java/org/apache/fulcrum/factory/FactoryException.java
index 63c1ee0..7865d90 100644
--- a/src/java/org/apache/fulcrum/factory/FactoryException.java
+++ b/src/java/org/apache/fulcrum/factory/FactoryException.java
@@ -32,12 +32,35 @@ public class FactoryException extends Exception
      */
     private static final long serialVersionUID = 8954422192583295720L;
 
-    public FactoryException(String msg)
+    /**
+     * Default constructor
+     */
+    public FactoryException()
     {
-        super(msg);
+        super();
     }
-    public FactoryException(String msg, Exception ex)
+
+    /**
+     * @see java.lang.Exception(String, Throwable)
+     */
+    public FactoryException(String message, Throwable e)
     {
-        super(msg, ex);
+        super(message, e);
+    }
+
+    /**
+     * @see java.lang.Exception(Throwable)
+     */
+    public FactoryException(Throwable e)
+    {
+        super(e);
+    }
+
+    /**
+     * @see java.lang.Exception(String)
+     */
+    public FactoryException(String msg)
+    {
+        super(msg);
     }
 }
diff --git a/src/java/org/apache/fulcrum/factory/FactoryService.java b/src/java/org/apache/fulcrum/factory/FactoryService.java
index 9c42e19..a289bf3 100644
--- a/src/java/org/apache/fulcrum/factory/FactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/FactoryService.java
@@ -1,8 +1,5 @@
 package org.apache.fulcrum.factory;
 
-import org.apache.avalon.framework.service.ServiceException;
-
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -22,8 +19,6 @@ import org.apache.avalon.framework.service.ServiceException;
  * under the License.
  */
 
-
-
 /**
  * The Factory Service instantiates objects using either default
  * class loaders or a specified one. Whether specified class
@@ -47,7 +42,7 @@ public interface FactoryService
 	*
 	* @param clazz the name of the class.
 	* @return the instance.
-	* @throws ServiceException if instantiation fails.
+	* @throws FactoryException if instantiation fails.
 	*/
    <T> T getInstance(Class<T> clazz)
 	   throws FactoryException;
@@ -57,7 +52,7 @@ public interface FactoryService
      *
      * @param className the name of the class.
      * @return the instance.
-     * @throws ServiceException if instantiation fails.
+     * @throws FactoryException if instantiation fails.
      */
     <T> T getInstance(String className)
         throws FactoryException;
@@ -71,7 +66,7 @@ public interface FactoryService
      * @param className the name of the class.
      * @param loader the class loader.
      * @return the instance.
-     * @throws ServiceException if instantiation fails.
+     * @throws FactoryException if instantiation fails.
      */
     <T> T getInstance(String className,
                               ClassLoader loader)
@@ -86,7 +81,7 @@ public interface FactoryService
      * @param params an array containing the parameters of the constructor.
      * @param signature an array containing the signature of the constructor.
      * @return the instance.
-     * @throws ServiceException if instantiation fails.
+     * @throws FactoryException if instantiation fails.
      */
     <T> T getInstance(String className,
                               Object[] params,
@@ -106,7 +101,7 @@ public interface FactoryService
      * @param params an array containing the parameters of the constructor.
      * @param signature an array containing the signature of the constructor.
      * @return the instance.
-     * @throws ServiceException if instantiation fails.
+     * @throws FactoryException if instantiation fails.
      */
     <T> T getInstance(String className,
                               ClassLoader loader,
@@ -119,7 +114,7 @@ public interface FactoryService
      *
      * @param className the name of the class.
      * @return true if class loaders are supported, false otherwise.
-     * @throws ServiceException if test fails.
+     * @throws FactoryException if test fails.
      */
     boolean isLoaderSupported(String className)
         throws FactoryException;
diff --git a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
index 513448f..21eae4a 100644
--- a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
+++ b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
@@ -60,7 +60,7 @@ public class ObjectInputStreamForContext extends ObjectInputStream
     }
 
     /**
-     * @see java.io.ObjectInputStream#resolveClass()
+     * @see java.io.ObjectInputStream#resolveClass(ObjectStreamClass)
      */
     @Override
     protected Class<?> resolveClass(ObjectStreamClass v)

[turbine-fulcrum-factory] 20/49: - update groupId to fulcrum if parent is turbine.

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 948c6a7d1429179244d94f789cdf1f04cf8794a2
Author: Georg Kallidis <gk...@apache.org>
AuthorDate: Fri Oct 9 12:32:21 2015 +0000

    - update groupId to fulcrum if parent is turbine.
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1707704 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pom.xml b/pom.xml
index 3ff9796..4e86546 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,6 +23,7 @@
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.fulcrum</groupId>
   <artifactId>fulcrum-factory</artifactId>
   <version>1.0.5-SNAPSHOT</version>
   <name>Fulcrum Factory</name>

[turbine-fulcrum-factory] 35/49: Point fulcrum components to new turbine parent 5

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit c52eb6fdfd7257de63828badf87bbe70ec4eca58
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Wed Oct 24 13:24:18 2018 +0000

    Point fulcrum components to new turbine parent 5
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1844771 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1656157..61ebdd6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <artifactId>turbine-parent</artifactId>
        <groupId>org.apache.turbine</groupId>
-       <version>4</version>
+       <version>5</version>
        <relativePath></relativePath>
   </parent>
 

[turbine-fulcrum-factory] 29/49: Use Turbine parent POM 4-SNAPSHOT

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 1f40b0b838380cdb8e1634cc319428a6d256ccde
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Fri Dec 9 15:23:31 2016 +0000

    Use Turbine parent POM 4-SNAPSHOT
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1773413 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 34 +---------------------------------
 1 file changed, 1 insertion(+), 33 deletions(-)

diff --git a/pom.xml b/pom.xml
index 190615b..743c350 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <artifactId>turbine-parent</artifactId>
        <groupId>org.apache.turbine</groupId>
-       <version>3</version>
+       <version>4-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
@@ -98,38 +98,6 @@
     <testSourceDirectory>${basedir}/src/test</testSourceDirectory>
   </build>
 
-  <profiles>
-    <profile>
-      <id>apache-release</id>
-      <build>
-        <plugins>
-          <plugin>
-            <!-- build the source and binary distribution packages -->
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-assembly-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>fulcrum-source-release-assembly</id>
-                <phase>package</phase>
-                <goals>
-                  <goal>single</goal>
-                </goals>
-                <configuration>
-                  <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
-                  <descriptors>
-                    <descriptor>src/assembly/binaries.xml</descriptor>
-                    <descriptor>src/assembly/source.xml</descriptor>
-                  </descriptors>
-                  <tarLongFileFormat>gnu</tarLongFileFormat>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
   <properties>
     <turbine.site.path>fulcrum/fulcrum-factory</turbine.site.path>
   </properties>  

[turbine-fulcrum-factory] 23/49: Adjust project layout to new Fulcrum standard

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit ccbf436d29ed2aa8bb7fd5b8d659566dde30a3c8
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Nov 27 11:46:20 2016 +0000

    Adjust project layout to new Fulcrum standard
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1771566 13f79535-47bb-0310-9956-ffa450edef68
---
 NOTICE.txt                |  6 ------
 pom.xml                   | 51 +++++++++++++++++++++++++--------------------
 src/assembly/binaries.xml | 52 ++++++++++++++++++++++++++++++++++++++++++++++
 src/assembly/source.xml   | 53 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 134 insertions(+), 28 deletions(-)

diff --git a/NOTICE.txt b/NOTICE.txt
deleted file mode 100644
index 25533de..0000000
--- a/NOTICE.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Turbine Fulcrum Factory Component
-Copyright 2005-2009 The Apache Software Foundation.
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/pom.xml b/pom.xml
index 4e86546..431f7d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,14 +37,6 @@
     <url>http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/</url>
   </scm>
 
-  <distributionManagement>
-    <site>
-      <id>apache.website</id>
-      <name>Fulcrum Website</name>
-      <url>${fulcrum.deployment.protocol}://people.apache.org/www/turbine.apache.org/fulcrum/fulcrum-factory/</url>
-    </site>    
-  </distributionManagement>
-	
   <developers>
     <developer>
       <name>Eric Pugh</name>
@@ -108,23 +100,38 @@
 
   <profiles>
     <profile>
-      <id>rc</id>
-      <distributionManagement>
-        <!-- Cannot define in parent ATM, see COMMONSSITE-26 -->
-        <site>
-          <id>apache.website</id>
-          <name>Apache Fulcrum Release Candidate Staging Site</name>
-          <url>${fulcrum.deployment.protocol}://people.apache.org/www/turbine.apache.org/builds/fulcrum/${fulcrum.componentid}/${fulcrum.release.version}/${fulcrum.rc.version}/site</url>
-        </site>
-      </distributionManagement>
+      <id>apache-release</id>
+      <build>
+        <plugins>
+          <plugin>
+            <!-- build the source and binary distribution packages -->
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>fulcrum-source-release-assembly</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
+                  <descriptors>
+                    <descriptor>src/assembly/binaries.xml</descriptor>
+                    <descriptor>src/assembly/source.xml</descriptor>
+                  </descriptors>
+                  <tarLongFileFormat>gnu</tarLongFileFormat>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
     </profile>
   </profiles>
-  
+
   <properties>
-    <!-- This bits are used for the staging directory -->
-    <fulcrum.release.version>1.0.4</fulcrum.release.version>
-    <fulcrum.rc.version>RC1</fulcrum.rc.version>  
-    <fulcrum.deployment.protocol>scpexe</fulcrum.deployment.protocol>
+    <turbine.site.path>fulcrum/fulcrum-factory</turbine.site.path>
   </properties>  
 	
 </project>
\ No newline at end of file
diff --git a/src/assembly/binaries.xml b/src/assembly/binaries.xml
new file mode 100644
index 0000000..2eda8b7
--- /dev/null
+++ b/src/assembly/binaries.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>bin</id>
+  <formats>
+    <format>tar.gz</format>
+    <format>zip</format>
+  </formats>
+  <fileSets>
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>README*</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>LICENSE*</include>
+        <include>NOTICE*</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>*.jar</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/src/assembly/source.xml b/src/assembly/source.xml
new file mode 100644
index 0000000..c06deb6
--- /dev/null
+++ b/src/assembly/source.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>src</id>
+  <formats>
+    <format>tar.gz</format>
+    <format>zip</format>
+  </formats>
+  <fileSets>
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <includes>
+        <include>README*</include>
+        <include>pom.xml</include>
+      </includes>
+      <useDefaultExcludes>true</useDefaultExcludes>
+    </fileSet>
+    <fileSet>
+      <directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>LICENSE*</include>
+        <include>NOTICE*</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>${project.basedir}/src</directory>
+      <useDefaultExcludes>true</useDefaultExcludes>
+    </fileSet>
+    <fileSet>
+      <directory>${project.basedir}/xdocs</directory>
+    </fileSet>
+  </fileSets>
+</assembly>
\ No newline at end of file

[turbine-fulcrum-factory] 39/49: Update all fulcrum components to use release 1.0.8 of yaafi and testcontainer

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 5fd0ac3808b0a165a136ac9299a1a1cf8f1487b3
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Mon Jan 7 16:37:23 2019 +0000

    Update all fulcrum components to use release 1.0.8 of yaafi and testcontainer
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1850666 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index c01e4db..6355392 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,7 +83,7 @@
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-testcontainer</artifactId>
-      <version>1.0.8-SNAPSHOT</version>
+      <version>1.0.8</version>
       <scope>test</scope>
     </dependency>
     <dependency>

[turbine-fulcrum-factory] 17/49: Fix site building errors: - Updating to Turbine Parent Version 3 - Unknown attribute 'href' for tag 'project'.. - UTF-8 Encoding in XmlRpc Java files

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 145b8d86578a98089c35fb9d9091034c461c7b70
Author: Georg Kallidis <gk...@apache.org>
AuthorDate: Fri Jun 6 10:39:45 2014 +0000

    Fix site building errors:
    - Updating to Turbine Parent Version 3
    - Unknown attribute 'href' for tag 'project'..
    - UTF-8 Encoding in XmlRpc Java files
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1600843 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml           | 6 +++---
 src/site/site.xml | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index f6f3f8c..741dde6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,9 +17,9 @@
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
-    <groupId>org.apache.fulcrum</groupId>
-    <artifactId>fulcrum-parent</artifactId>
-    <version>1</version>
+    <artifactId>turbine-parent</artifactId>
+       <groupId>org.apache.turbine</groupId>
+       <version>3</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
diff --git a/src/site/site.xml b/src/site/site.xml
index 6f94bd6..4473bbd 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -17,10 +17,10 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project
-  name="Fulcrum Factory"
-  href="http://turbine.apache.org/fulcrum/fulcrum-factory/">
-
+<project xmlns="http://maven.apache.org/DECORATION/1.4.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd"
+  name="Fulcrum Factory">
   <body>
     <menu name="Overview">
       <item name="Main"                 href="/index.html"/>

[turbine-fulcrum-factory] 22/49: Add generics and use concurrent collections

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 65055553b6fbb56a1b18e1808550b295f6df5692
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Nov 27 11:44:21 2016 +0000

    Add generics and use concurrent collections
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1771565 13f79535-47bb-0310-9956-ffa450edef68
---
 .../fulcrum/factory/DefaultFactoryService.java     | 208 ++++++++++++++-------
 src/java/org/apache/fulcrum/factory/Factory.java   |  23 +--
 .../org/apache/fulcrum/factory/FactoryService.java |  16 +-
 .../factory/utils/ObjectInputStreamForContext.java |   9 +-
 .../apache/fulcrum/factory/FactoryServiceTest.java |   5 +-
 5 files changed, 166 insertions(+), 95 deletions(-)

diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
index 3034c19..f058372 100644
--- a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -21,11 +21,13 @@ package org.apache.fulcrum.factory;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.ObjectOutputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.activity.Initializable;
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
@@ -48,7 +50,7 @@ import org.apache.fulcrum.factory.utils.ObjectInputStreamForContext;
  */
 public class DefaultFactoryService
     extends AbstractLogEnabled
-    implements FactoryService, Configurable, Initializable
+    implements FactoryService, Configurable, Initializable, Disposable
 {
     protected boolean initialized = false;
     //private boolean disposed = false;
@@ -67,9 +69,10 @@ public class DefaultFactoryService
     /**
      * Primitive classes for reflection of constructors.
      */
-    private static HashMap primitiveClasses;
+    private static HashMap<String, Class<?>> primitiveClasses;
+
     {
-        primitiveClasses = new HashMap(8);
+        primitiveClasses = new HashMap<String, Class<?>>(8);
         primitiveClasses.put(Boolean.TYPE.toString(), Boolean.TYPE);
         primitiveClasses.put(Character.TYPE.toString(), Character.TYPE);
         primitiveClasses.put(Byte.TYPE.toString(), Byte.TYPE);
@@ -86,20 +89,27 @@ public class DefaultFactoryService
     /**
      * Additional class loaders.
      */
-    private ArrayList classLoaders = new ArrayList();
+    private ArrayList<ClassLoader> classLoaders = new ArrayList<ClassLoader>();
     /**
      * Customized object factories.
      */
-    private HashMap objectFactories = new HashMap();
+    private ConcurrentHashMap<String, Factory<?>> objectFactories =
+            new ConcurrentHashMap<String, Factory<?>>();
+    /**
+     * Customized object factory classes.
+     */
+    private ConcurrentHashMap<String, String> objectFactoryClasses =
+            new ConcurrentHashMap<String, String>();
+
     /**
      * Gets the class of a primitive type.
      *
      * @param type a primitive type.
      * @return the corresponding class, or null.
      */
-    protected static Class getPrimitiveClass(String type)
+    protected static Class<?> getPrimitiveClass(String type)
     {
-        return (Class) primitiveClasses.get(type);
+        return primitiveClasses.get(type);
     }
 
     /**
@@ -109,16 +119,17 @@ public class DefaultFactoryService
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance(String className) throws FactoryException
+    @Override
+    public <T> T getInstance(String className) throws FactoryException
     {
         if (className == null)
         {
             throw new FactoryException("Missing String className");
         }
-        Factory factory = getFactory(className);
+        Factory<T> factory = getFactory(className);
         if (factory == null)
         {
-            Class clazz;
+            Class<T> clazz;
             try
             {
                 clazz = loadClass(className);
@@ -145,14 +156,15 @@ public class DefaultFactoryService
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance(String className, ClassLoader loader) throws FactoryException
+    @Override
+    public <T> T getInstance(String className, ClassLoader loader) throws FactoryException
     {
-        Factory factory = getFactory(className);
+        Factory<T> factory = getFactory(className);
         if (factory == null)
         {
             if (loader != null)
             {
-                Class clazz;
+                Class<T> clazz;
                 try
                 {
                     clazz = loadClass(className, loader);
@@ -184,12 +196,13 @@ public class DefaultFactoryService
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance(String className, Object[] params, String[] signature) throws FactoryException
+    @Override
+    public <T> T getInstance(String className, Object[] params, String[] signature) throws FactoryException
     {
-        Factory factory = getFactory(className);
+        Factory<T> factory = getFactory(className);
         if (factory == null)
         {
-            Class clazz;
+            Class<T> clazz;
             try
             {
                 clazz = loadClass(className);
@@ -220,15 +233,16 @@ public class DefaultFactoryService
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance(String className, ClassLoader loader, Object[] params, String[] signature)
+    @Override
+    public <T> T getInstance(String className, ClassLoader loader, Object[] params, String[] signature)
         throws FactoryException
     {
-        Factory factory = getFactory(className);
+        Factory<T> factory = getFactory(className);
         if (factory == null)
         {
             if (loader != null)
             {
-                Class clazz;
+                Class<T> clazz;
                 try
                 {
                     clazz = loadClass(className, loader);
@@ -256,9 +270,10 @@ public class DefaultFactoryService
      * @return true if class loaders are supported, false otherwise.
      * @throws FactoryException if test fails.
      */
+    @Override
     public boolean isLoaderSupported(String className) throws FactoryException
     {
-        Factory factory = getFactory(className);
+        Factory<?> factory = getFactory(className);
         return factory != null ? factory.isLoaderSupported() : true;
     }
     /**
@@ -268,7 +283,8 @@ public class DefaultFactoryService
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance(Class clazz) throws FactoryException
+    @Override
+    public <T> T getInstance(Class<T> clazz) throws FactoryException
     {
         try
         {
@@ -290,12 +306,12 @@ public class DefaultFactoryService
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    protected Object getInstance(Class clazz, Object params[], String signature[]) throws FactoryException
+    protected <T> T getInstance(Class<T> clazz, Object params[], String signature[]) throws FactoryException
     {
         /* Try to construct. */
         try
         {
-            Class[] sign = getSignature(clazz, params, signature);
+            Class<?>[] sign = getSignature(clazz, params, signature);
             return clazz.getConstructor(sign).newInstance(params);
         }
         catch (Exception x)
@@ -314,14 +330,15 @@ public class DefaultFactoryService
      * of a different class loader.
      * @throws ClassNotFoundException if any of the classes is not found.
      */
-    public Class[] getSignature(Class clazz, Object params[], String signature[]) throws ClassNotFoundException
+    @Override
+    public Class<?>[] getSignature(Class<?> clazz, Object params[], String signature[]) throws ClassNotFoundException
     {
         if (signature != null)
         {
             /* We have parameters. */
             ClassLoader tempLoader;
             ClassLoader loader = clazz.getClassLoader();
-            Class[] sign = new Class[signature.length];
+            Class<?>[] sign = new Class[signature.length];
             for (int i = 0; i < signature.length; i++)
             {
                 /* Check primitive types. */
@@ -368,26 +385,44 @@ public class DefaultFactoryService
     protected Object switchObjectContext(Object object, ClassLoader loader)
     {
         ByteArrayOutputStream bout = new ByteArrayOutputStream();
+
         try
         {
             ObjectOutputStream out = new ObjectOutputStream(bout);
             out.writeObject(object);
             out.flush();
         }
-        catch (Exception x)
+        catch (IOException x)
         {
             return object;
         }
+
+        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
+        ObjectInputStreamForContext in = null;
+
         try
         {
-            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-            ObjectInputStreamForContext in = new ObjectInputStreamForContext(bin, loader);
+            in = new ObjectInputStreamForContext(bin, loader);
             return in.readObject();
         }
         catch (Exception x)
         {
             return object;
         }
+        finally
+        {
+            if (in != null)
+            {
+                try
+                {
+                    in.close();
+                }
+                catch (IOException e)
+                {
+                    // close quietly
+                }
+            }
+        }
     }
     /**
      * Loads the named class using the default class loader.
@@ -396,21 +431,33 @@ public class DefaultFactoryService
      * @return the loaded class.
      * @throws ClassNotFoundException if the class was not found.
      */
-    protected Class loadClass(String className) throws ClassNotFoundException
+    @SuppressWarnings("unchecked")
+    protected <T> Class<T> loadClass(String className) throws ClassNotFoundException
     {
         ClassLoader loader = this.getClass().getClassLoader();
         try
         {
-            return loader != null ? loader.loadClass(className) : Class.forName(className);
+            Class<T> clazz;
+
+            if (loader != null)
+            {
+                clazz = (Class<T>) loader.loadClass(className);
+            }
+            else
+            {
+                clazz = (Class<T>) Class.forName(className);
+            }
+
+            return clazz;
         }
         catch (ClassNotFoundException x)
         {
             /* Go through additional loaders. */
-            for (Iterator i = classLoaders.iterator(); i.hasNext();)
+            for (ClassLoader l : classLoaders)
             {
                 try
                 {
-                    return ((ClassLoader) i.next()).loadClass(className);
+                    return (Class<T>) l.loadClass(className);
                 }
                 catch (ClassNotFoundException xx)
                 {
@@ -429,9 +476,17 @@ public class DefaultFactoryService
      * @return the loaded class.
      * @throws ClassNotFoundException if the class was not found.
      */
-    protected Class loadClass(String className, ClassLoader loader) throws ClassNotFoundException
+    @SuppressWarnings("unchecked")
+    protected <T> Class<T> loadClass(String className, ClassLoader loader) throws ClassNotFoundException
     {
-        return loader != null ? loader.loadClass(className) : loadClass(className);
+        if (loader != null)
+        {
+            return (Class<T>) loader.loadClass(className);
+        }
+        else
+        {
+            return loadClass(className);
+        }
     }
     /**
      * Gets a customized factory for a named class. If no class-specific
@@ -442,49 +497,54 @@ public class DefaultFactoryService
      * @return the factory, or null if not specified and no default.
      * @throws FactoryException if instantiation of the factory fails.
      */
-    protected Factory getFactory(String className) throws FactoryException
+    @SuppressWarnings("unchecked")
+    protected <T> Factory<T> getFactory(String className) throws FactoryException
     {
-        HashMap factories = objectFactories;
-        Object factory = factories.get(className);
+        Factory<T> factory = (Factory<T>) objectFactories.get(className);
         if (factory == null)
         {
             //No named factory for this; try the default, if one
             //exists.
-            factory = factories.get(DEFAULT_FACTORY);
+            factory = (Factory<T>) objectFactories.get(DEFAULT_FACTORY);
         }
-        if (factory != null)
+        if (factory == null)
         {
-            if (factory instanceof String)
+            /* Not yet instantiated... */
+            String factoryClass = objectFactoryClasses.get(className);
+            if (factoryClass == null)
             {
-                /* Not yet instantiated... */
-                try
-                {
-                    factory = (Factory) getInstance((String) factory);
-                    ((Factory) factory).init(className);
-                }
-                catch (FactoryException x)
-                {
-                    throw x;
-                }
-                catch (ClassCastException x)
-                {
-                    throw new FactoryException("Incorrect factory " + (String) factory + " for class " + className, x);
-                }
-                factories = (HashMap) factories.clone();
-                factories.put(className, factory);
-                objectFactories = factories;
+                factoryClass = objectFactoryClasses.get(DEFAULT_FACTORY);
+            }
+            if (factoryClass == null)
+            {
+                return null;
+            }
+
+            try
+            {
+                factory = getInstance(factoryClass);
+                factory.init(className);
+            }
+            catch (ClassCastException x)
+            {
+                throw new FactoryException("Incorrect factory " + factoryClass + " for class " + className, x);
+            }
+            Factory<T> _factory = (Factory<T>) objectFactories.putIfAbsent(className, factory);
+            if (_factory != null)
+            {
+                // Already created - take first instance
+                factory = _factory;
             }
-            return (Factory) factory;
-        }
-        else
-        {
-            return null;
         }
+
+        return factory;
     }
+
     // ---------------- Avalon Lifecycle Methods ---------------------
     /**
      * Avalon component lifecycle method
      */
+    @Override
     public void configure(Configuration conf) throws ConfigurationException
     {
         final Configuration[] loaders = conf.getChildren(CLASS_LOADER);
@@ -506,10 +566,11 @@ public class DefaultFactoryService
                 String factory = nameVal[i].getValue();
                 // Store the factory to the table as a string and
                 // instantiate it by using the service when needed.
-                objectFactories.put(key, factory);
+                objectFactoryClasses.put(key, factory);
             }
         }
     }
+
     /**
      * Avalon component lifecycle method
      * Initializes the service by loading default class loaders
@@ -517,6 +578,7 @@ public class DefaultFactoryService
      *
      * @throws InitializationException if initialization fails.
      */
+    @Override
     public void initialize() throws Exception
     {
         if (loaderNames != null)
@@ -525,16 +587,28 @@ public class DefaultFactoryService
             {
                 try
                 {
-                    classLoaders.add(loadClass(loaderNames[i]).newInstance());
+                    ClassLoader loader = (ClassLoader) loadClass(loaderNames[i]).newInstance();
+                    classLoaders.add(loader);
                 }
                 catch (Exception x)
                 {
                     throw new Exception(
-                        "No such class loader '" + loaderNames[i] + "' for DefaultFactoryService",
-                        x);
+                        "No such class loader '" + loaderNames[i] + "' for DefaultFactoryService", x);
                 }
             }
             loaderNames = null;
         }
     }
+
+    /**
+     * Avalon component lifecycle method
+     * Clear lists and maps
+     */
+    @Override
+    public void dispose()
+    {
+        objectFactories.clear();
+        objectFactoryClasses.clear();
+        classLoaders.clear();
+    }
 }
diff --git a/src/java/org/apache/fulcrum/factory/Factory.java b/src/java/org/apache/fulcrum/factory/Factory.java
index 841d30c..bb7e7b4 100644
--- a/src/java/org/apache/fulcrum/factory/Factory.java
+++ b/src/java/org/apache/fulcrum/factory/Factory.java
@@ -1,6 +1,5 @@
 package org.apache.fulcrum.factory;
 
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -20,8 +19,6 @@ package org.apache.fulcrum.factory;
  * under the License.
  */
 
-
-
 /**
  * Factory is an interface for object factories. Object factories
  * can be registered with the Factory Service to support customized
@@ -34,7 +31,7 @@ package org.apache.fulcrum.factory;
  * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
  * @version $Id$
  */
-public interface Factory
+public interface Factory<T>
 {
     /**
      * Initializes the factory. This method is called by
@@ -43,8 +40,7 @@ public interface Factory
      * @param className the name of the production class
      * @throws FactoryException if initialization fails.
      */
-    public void init(String className)
-        throws FactoryException;
+    void init(String className) throws FactoryException;
 
     /**
      * Gets an instance of a class.
@@ -52,8 +48,7 @@ public interface Factory
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance()
-        throws FactoryException;
+    T getInstance() throws FactoryException;
 
     /**
      * Gets an instance of a class using a specified class loader.
@@ -65,8 +60,7 @@ public interface Factory
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance(ClassLoader loader)
-        throws FactoryException;
+    T getInstance(ClassLoader loader) throws FactoryException;
 
     /**
      * Gets an instance of a named class.
@@ -78,8 +72,7 @@ public interface Factory
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance(Object[] params,
-                              String[] signature)
+    T getInstance(Object[] params, String[] signature)
         throws FactoryException;
 
     /**
@@ -96,9 +89,7 @@ public interface Factory
      * @return the instance.
      * @throws FactoryException if instantiation fails.
      */
-    public Object getInstance(ClassLoader loader,
-                              Object[] params,
-                              String[] signature)
+    T getInstance(ClassLoader loader, Object[] params, String[] signature)
         throws FactoryException;
 
     /**
@@ -106,5 +97,5 @@ public interface Factory
      *
      * @return true if class loaders are supported, false otherwise.
      */
-    public boolean isLoaderSupported();
+    boolean isLoaderSupported();
 }
diff --git a/src/java/org/apache/fulcrum/factory/FactoryService.java b/src/java/org/apache/fulcrum/factory/FactoryService.java
index e4e2f5f..9c42e19 100644
--- a/src/java/org/apache/fulcrum/factory/FactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/FactoryService.java
@@ -1,5 +1,7 @@
 package org.apache.fulcrum.factory;
 
+import org.apache.avalon.framework.service.ServiceException;
+
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -47,7 +49,7 @@ public interface FactoryService
 	* @return the instance.
 	* @throws ServiceException if instantiation fails.
 	*/
-   public Object getInstance(Class clazz)
+   <T> T getInstance(Class<T> clazz)
 	   throws FactoryException;
 
     /**
@@ -57,7 +59,7 @@ public interface FactoryService
      * @return the instance.
      * @throws ServiceException if instantiation fails.
      */
-    public Object getInstance(String className)
+    <T> T getInstance(String className)
         throws FactoryException;
 
     /**
@@ -71,7 +73,7 @@ public interface FactoryService
      * @return the instance.
      * @throws ServiceException if instantiation fails.
      */
-    public Object getInstance(String className,
+    <T> T getInstance(String className,
                               ClassLoader loader)
         throws FactoryException;
 
@@ -86,7 +88,7 @@ public interface FactoryService
      * @return the instance.
      * @throws ServiceException if instantiation fails.
      */
-    public Object getInstance(String className,
+    <T> T getInstance(String className,
                               Object[] params,
                               String[] signature)
         throws FactoryException;
@@ -106,7 +108,7 @@ public interface FactoryService
      * @return the instance.
      * @throws ServiceException if instantiation fails.
      */
-    public Object getInstance(String className,
+    <T> T getInstance(String className,
                               ClassLoader loader,
                               Object[] params,
                               String[] signature)
@@ -119,7 +121,7 @@ public interface FactoryService
      * @return true if class loaders are supported, false otherwise.
      * @throws ServiceException if test fails.
      */
-    public boolean isLoaderSupported(String className)
+    boolean isLoaderSupported(String className)
         throws FactoryException;
 
     /**
@@ -133,7 +135,7 @@ public interface FactoryService
      * of a different class loader.
      * @throws ClassNotFoundException if any of the classes is not found.
      */
-    Class[] getSignature(Class clazz,
+    Class<?>[] getSignature(Class<?> clazz,
             Object params[],
             String signature[])
             throws ClassNotFoundException;
diff --git a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
index a0fb934..513448f 100644
--- a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
+++ b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
@@ -1,5 +1,6 @@
 package org.apache.fulcrum.factory.utils;
 
+import java.io.IOException;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -20,11 +21,9 @@ package org.apache.fulcrum.factory.utils;
  * under the License.
  */
 
-
 import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectStreamClass;
-import java.io.IOException;
 
 /**
  * A deserialization stream for a specific class loader context.
@@ -60,7 +59,11 @@ public class ObjectInputStreamForContext extends ObjectInputStream
         classLoader = loader;
     }
 
-    protected Class resolveClass(ObjectStreamClass v)
+    /**
+     * @see java.io.ObjectInputStream#resolveClass()
+     */
+    @Override
+    protected Class<?> resolveClass(ObjectStreamClass v)
                                  throws IOException,
                                  ClassNotFoundException
     {
diff --git a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
index eb97a08..f82256d 100644
--- a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
+++ b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
@@ -21,6 +21,7 @@ package org.apache.fulcrum.factory;
 
 
 import java.util.ArrayList;
+
 import org.apache.fulcrum.testcontainer.BaseUnitTest;
 
 /**
@@ -43,6 +44,7 @@ public class FactoryServiceTest extends BaseUnitTest
         super(name);
     }
 
+    @Override
     public void setUp() throws Exception
     {
         super.setUp();
@@ -116,7 +118,7 @@ public class FactoryServiceTest extends BaseUnitTest
         params[0] = sourceValu;
         String signature[] = new String[1];
         signature[0] = "java.lang.String";
-        Class[] results = factoryService.getSignature(StringBuffer.class, params, signature);
+        Class<?>[] results = factoryService.getSignature(StringBuffer.class, params, signature);
         assertEquals(1, results.length);
         assertTrue(results[0].equals(String.class));
 
@@ -126,6 +128,5 @@ public class FactoryServiceTest extends BaseUnitTest
         results = factoryService.getSignature(ArrayList.class, params, signature);
         assertEquals(1, results.length);
         assertTrue("Result:" + results[0].getName(),results[0].equals(Integer.class));
-
     }
 }

[turbine-fulcrum-factory] 31/49: - Fulcrum factory fix parent pom version - Fulcrum json jackson2 commons-lang align - Fulcrum parser and upload JUnit 4 - Fulcrum Testcontainer endow with Mockito (default request mock copied from Turbine test) - Fulcrum uplad with duplicate mock until not upgraded to testcontainer 1.0.8

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit c6ea79b717520a3af685a0db41385347f0467ca7
Author: Georg Kallidis <gk...@apache.org>
AuthorDate: Tue May 8 07:41:08 2018 +0000

    - Fulcrum factory fix parent pom version
    - Fulcrum json jackson2 commons-lang align
    - Fulcrum parser and upload JUnit 4
    - Fulcrum Testcontainer endow with Mockito (default request mock copied from Turbine test)
    - Fulcrum uplad with duplicate mock until not upgraded to testcontainer 1.0.8
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1831151 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 743c350..1fbf228 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,8 @@
   <parent>
     <artifactId>turbine-parent</artifactId>
        <groupId>org.apache.turbine</groupId>
-       <version>4-SNAPSHOT</version>
+       <version>4</version>
+       <relativePath></relativePath>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>

[turbine-fulcrum-factory] 05/49: Fixed site id to comply with settings.xml as explained in the wiki

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit a7f5c05f25f28d106e942316705120702d0beb57
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Fri Mar 27 08:42:55 2009 +0000

    Fixed site id to comply with settings.xml as explained in the wiki
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@759059 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 0384bd0..dad627a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,7 @@
 
   <distributionManagement>
     <site>
-      <id>fulcrum.website</id>
+      <id>apache.website</id>
       <name>Fulcrum Website</name>
       <url>${fulcrum.deployment.protocol}://people.apache.org/www/turbine.apache.org/fulcrum/fulcrum-factory/</url>
     </site>    

[turbine-fulcrum-factory] 38/49: Update all components to fulcrum-yaafi 1.0.8 release

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 152627c6b0ea17f86777e07abe5b811612850d19
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Mon Dec 17 17:14:35 2018 +0000

    Update all components to fulcrum-yaafi 1.0.8 release
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1849110 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 61ebdd6..c01e4db 100644
--- a/pom.xml
+++ b/pom.xml
@@ -89,7 +89,7 @@
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-yaafi</artifactId>
-      <version>1.0.8-SNAPSHOT</version>
+      <version>1.0.8</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
@@ -103,4 +103,4 @@
     <turbine.site.path>fulcrum/fulcrum-factory</turbine.site.path>
   </properties>  
 	
-</project>
\ No newline at end of file
+</project>

[turbine-fulcrum-factory] 32/49: global replace StringBuffer with StringBuilder

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 082b5a5795aebc4a7b6749de826d8f905f9f538a
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Wed Oct 3 14:02:01 2018 +0000

    global replace StringBuffer with StringBuilder
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1842724 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/fulcrum/factory/FactoryServiceTest.java   | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
index f82256d..0f0fe9e 100644
--- a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
+++ b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
@@ -56,16 +56,16 @@ public class FactoryServiceTest extends BaseUnitTest
      */
     public void testGetInstanceString() throws Exception
     {
-        Object object = factoryService.getInstance("java.lang.StringBuffer");
-        assertTrue(object instanceof StringBuffer);
+        Object object = factoryService.getInstance("java.lang.StringBuilder");
+        assertTrue(object instanceof StringBuilder);
     }
     /*
      * Class to test for Object getInstance(String, ClassLoader)
      */
     public void testGetInstanceStringClassLoader() throws Exception
     {
-        Object object = factoryService.getInstance("java.lang.StringBuffer", StringBuffer.class.getClassLoader());
-        assertTrue(object instanceof StringBuffer);
+        Object object = factoryService.getInstance("java.lang.StringBuilder", StringBuilder.class.getClassLoader());
+        assertTrue(object instanceof StringBuilder);
     }
     /*
      * Class to test for Object getInstance(String, Object[], String[])
@@ -77,8 +77,8 @@ public class FactoryServiceTest extends BaseUnitTest
         params[0] = sourceValue;
         String signature[] = new String[1];
         signature[0] = "java.lang.String";
-        Object object = factoryService.getInstance("java.lang.StringBuffer", params, signature);
-        assertTrue(object instanceof StringBuffer);
+        Object object = factoryService.getInstance("java.lang.StringBuilder", params, signature);
+        assertTrue(object instanceof StringBuilder);
         assertEquals(sourceValue, object.toString());
 
     }
@@ -94,11 +94,11 @@ public class FactoryServiceTest extends BaseUnitTest
         signature[0] = "java.lang.String";
         Object object =
             factoryService.getInstance(
-                "java.lang.StringBuffer",
-                StringBuffer.class.getClassLoader(),
+                "java.lang.StringBuilder",
+                StringBuilder.class.getClassLoader(),
                 params,
                 signature);
-        assertTrue(object instanceof StringBuffer);
+        assertTrue(object instanceof StringBuilder);
         assertEquals(sourceValu, object.toString());
 
     }
@@ -118,7 +118,7 @@ public class FactoryServiceTest extends BaseUnitTest
         params[0] = sourceValu;
         String signature[] = new String[1];
         signature[0] = "java.lang.String";
-        Class<?>[] results = factoryService.getSignature(StringBuffer.class, params, signature);
+        Class<?>[] results = factoryService.getSignature(StringBuilder.class, params, signature);
         assertEquals(1, results.length);
         assertTrue(results[0].equals(String.class));
 

[turbine-fulcrum-factory] 11/49: Fix failed mvn release

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 5dbd3e8c0334a0b93a2b5d5f2012a6c5673982f4
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Jun 15 19:41:31 2009 +0000

    Fix failed mvn release
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@784940 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9aaef39..5e1bc7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,3 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You 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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.fulcrum</groupId>
@@ -7,16 +24,16 @@
 
   <modelVersion>4.0.0</modelVersion>
   <artifactId>fulcrum-factory</artifactId>
-  <version>1.0.4</version>
+  <version>1.0.4-SNAPSHOT</version>
   <name>Fulcrum Factory</name>
   <inceptionYear>2005</inceptionYear>
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</developerConnection>
-    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
+    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/trunk/factory/</url>
   </scm>
 
   <distributionManagement>
@@ -46,7 +63,7 @@
       <name>Siegfried Goeschl</name>
       <id>sgoeschl</id>
       <email>sgoeschl@apache.org</email>
-      <organization />
+      <organization></organization>
       <roles>
         <role>Java Developer</role>
       </roles>
@@ -55,7 +72,7 @@
       <name>Thomas Vandahl</name>
       <id>tv</id>
       <email>tv@apache.org</email>
-      <organization />
+      <organization></organization>
       <roles>
         <role>Java Developer</role>
       </roles>
@@ -109,4 +126,4 @@
     <fulcrum.deployment.protocol>scpexe</fulcrum.deployment.protocol>
   </properties>  
 	
-</project>
\ No newline at end of file
+</project>

[turbine-fulcrum-factory] 10/49: [maven-release-plugin] prepare release FULCRUM_FACTORY_1_0_4

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 5ceed665f117f8489150aaecc284470894c4fa34
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Jun 15 19:35:36 2009 +0000

    [maven-release-plugin] prepare release FULCRUM_FACTORY_1_0_4
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@784934 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 31 +++++++------------------------
 1 file changed, 7 insertions(+), 24 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5e1bc7b..9aaef39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,20 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You 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.
--->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.fulcrum</groupId>
@@ -24,16 +7,16 @@
 
   <modelVersion>4.0.0</modelVersion>
   <artifactId>fulcrum-factory</artifactId>
-  <version>1.0.4-SNAPSHOT</version>
+  <version>1.0.4</version>
   <name>Fulcrum Factory</name>
   <inceptionYear>2005</inceptionYear>
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
-    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/trunk/factory/</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</developerConnection>
+    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</url>
   </scm>
 
   <distributionManagement>
@@ -63,7 +46,7 @@
       <name>Siegfried Goeschl</name>
       <id>sgoeschl</id>
       <email>sgoeschl@apache.org</email>
-      <organization></organization>
+      <organization />
       <roles>
         <role>Java Developer</role>
       </roles>
@@ -72,7 +55,7 @@
       <name>Thomas Vandahl</name>
       <id>tv</id>
       <email>tv@apache.org</email>
-      <organization></organization>
+      <organization />
       <roles>
         <role>Java Developer</role>
       </roles>
@@ -126,4 +109,4 @@
     <fulcrum.deployment.protocol>scpexe</fulcrum.deployment.protocol>
   </properties>  
 	
-</project>
+</project>
\ No newline at end of file

[turbine-fulcrum-factory] 28/49: [maven-release-plugin] prepare for next development iteration

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit f22528f33d47b508fdf95cf1b6eef44d0d251fc4
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Nov 27 13:38:13 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1771593 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index d0670c3..190615b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,16 +25,16 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.fulcrum</groupId>
   <artifactId>fulcrum-factory</artifactId>
-  <version>1.1.0</version>
+  <version>1.1.1-SNAPSHOT</version>
   <name>Fulcrum Factory</name>
   <inceptionYear>2005</inceptionYear>
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-factory-1.1.0</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-factory-1.1.0</developerConnection>
-    <url>http://svn.apache.org/viewvc/turbine/fulcrum/tags/fulcrum-factory-1.1.0</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
+    <url>http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/</url>
   </scm>
 
   <developers>

[turbine-fulcrum-factory] 01/49: +) using fulcrum-yaafi-1.0.5 +) getting it to run with maven 1.1

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 4a3b1ba1d93638036c69d1bec06474c38f0fd755
Author: Siegfried Goeschl <sg...@apache.org>
AuthorDate: Thu Oct 25 16:29:42 2007 +0000

    +) using fulcrum-yaafi-1.0.5
    +) getting it to run with maven 1.1
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@588276 13f79535-47bb-0310-9956-ffa450edef68
---
 .cvsignore                                         |   6 +
 maven.xml                                          |  26 +
 project.xml                                        |  50 ++
 .../fulcrum/factory/DefaultFactoryService.java     | 544 +++++++++++++++++++++
 src/java/org/apache/fulcrum/factory/Factory.java   | 110 +++++
 .../apache/fulcrum/factory/FactoryException.java   |  43 ++
 .../org/apache/fulcrum/factory/FactoryService.java | 140 ++++++
 .../factory/utils/ObjectInputStreamForContext.java |  70 +++
 src/test/TestComponentConfig.xml                   |  23 +
 src/test/TestRoleConfig.xml                        |  28 ++
 .../apache/fulcrum/factory/FactoryServiceTest.java | 131 +++++
 .../utils/ObjectInputStreamForContextTest.java     |  57 +++
 xdocs/changes.xml                                  |  42 ++
 xdocs/index.xml                                    | 198 ++++++++
 xdocs/navigation.xml                               |  38 ++
 xdocs/tasks.xml                                    |  49 ++
 16 files changed, 1555 insertions(+)

diff --git a/.cvsignore b/.cvsignore
new file mode 100644
index 0000000..e97dd78
--- /dev/null
+++ b/.cvsignore
@@ -0,0 +1,6 @@
+target
+*.log
+.classpath
+.project
+jcoverage.ser
+*.merlin
diff --git a/maven.xml b/maven.xml
new file mode 100644
index 0000000..8c6e127
--- /dev/null
+++ b/maven.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<project default="jar:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util">
+
+  <!--preGoal name="java:compile">
+    <attainGoal name="avalon:meta"/>
+  </preGoal-->
+
+</project>
diff --git a/project.xml b/project.xml
new file mode 100644
index 0000000..47be3fe
--- /dev/null
+++ b/project.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<project>
+  <extend>${basedir}/../project.xml</extend>
+  <id>fulcrum-factory</id>
+  <name>Fulcrum Factory Component</name>
+  <currentVersion>1.0.3</currentVersion>
+  <versions>
+    <version>
+      <id>1.0.3</id>
+      <name>1.0.3</name>
+      <tag>FULCRUM_FACTORY_1_0_3</tag>
+    </version>
+  </versions>
+  <dependencies>
+
+    <!--  Needed only for testing -->
+    <dependency>
+      <groupId>fulcrum</groupId>
+      <artifactId>fulcrum-testcontainer</artifactId>
+      <version>1.0.5</version>
+    </dependency>
+
+    <dependency>
+      <groupId>fulcrum</groupId>
+      <artifactId>fulcrum-yaafi</artifactId>
+      <version>1.0.5</version>
+    </dependency>
+
+  </dependencies>
+
+</project>
+
diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
new file mode 100644
index 0000000..86472ca
--- /dev/null
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -0,0 +1,544 @@
+package org.apache.fulcrum.factory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.apache.avalon.framework.activity.Initializable;
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.fulcrum.factory.utils.ObjectInputStreamForContext;
+
+/**
+ * The Factory Service instantiates objects using specified
+ * class loaders. If none is specified, the default one
+ * will be used.
+ *
+ * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
+ * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
+ * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
+ * @version $Id$
+ *
+ * @avalon.component name="factory" lifestyle="singleton"
+ * @avalon.service type="org.apache.fulcrum.factory.FactoryService"
+ */
+public class DefaultFactoryService
+    extends AbstractLogEnabled
+    implements FactoryService, Configurable, Initializable
+{
+    protected boolean initialized = false;
+    //private boolean disposed = false;
+    /**
+     * The property specifying a set of additional class loaders.
+     */
+    private static final String CLASS_LOADER = "classloader";
+    /**
+     * The property prefix specifying additional object factories.
+     */
+    private static final String OBJECT_FACTORY = "object-factory";
+    /**
+     * The name of the default factory.
+     */
+    protected static final String DEFAULT_FACTORY = "default";
+    /**
+     * Primitive classes for reflection of constructors.
+     */
+    private static HashMap primitiveClasses;
+    {
+        primitiveClasses = new HashMap(8);
+        primitiveClasses.put(Boolean.TYPE.toString(), Boolean.TYPE);
+        primitiveClasses.put(Character.TYPE.toString(), Character.TYPE);
+        primitiveClasses.put(Byte.TYPE.toString(), Byte.TYPE);
+        primitiveClasses.put(Short.TYPE.toString(), Short.TYPE);
+        primitiveClasses.put(Integer.TYPE.toString(), Integer.TYPE);
+        primitiveClasses.put(Long.TYPE.toString(), Long.TYPE);
+        primitiveClasses.put(Float.TYPE.toString(), Float.TYPE);
+        primitiveClasses.put(Double.TYPE.toString(), Double.TYPE);
+    }
+    /**
+     * temporary storage of class names between configure and initialize
+     */
+    private String[] loaderNames;
+    /**
+     * Additional class loaders.
+     */
+    private ArrayList classLoaders = new ArrayList();
+    /**
+     * Customized object factories.
+     */
+    private HashMap objectFactories = new HashMap();
+    /**
+     * Gets the class of a primitive type.
+     *
+     * @param type a primitive type.
+     * @return the corresponding class, or null.
+     */
+    protected static Class getPrimitiveClass(String type)
+    {
+        return (Class) primitiveClasses.get(type);
+    }
+    /**
+     * Constructs a Factory Service.
+     */
+    public DefaultFactoryService()
+    {
+    }
+    /**
+     * Gets an instance of a named class.
+     *
+     * @param className the name of the class.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance(String className) throws FactoryException
+    {
+        if (className == null)
+        {
+            throw new FactoryException("Missing String className");
+        }
+        Factory factory = getFactory(className);
+        if (factory == null)
+        {
+            Class clazz;
+            try
+            {
+                clazz = loadClass(className);
+            }
+            catch (ClassNotFoundException x)
+            {
+                throw new FactoryException("Instantiation failed for class " + className, x);
+            }
+            return getInstance(clazz);
+        }
+        else
+        {
+            return factory.getInstance();
+        }
+    }
+    /**
+     * Gets an instance of a named class using a specified class loader.
+     *
+     * <p>Class loaders are supported only if the isLoaderSupported
+     * method returns true. Otherwise the loader parameter is ignored.
+     *
+     * @param className the name of the class.
+     * @param loader the class loader.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance(String className, ClassLoader loader) throws FactoryException
+    {
+        Factory factory = getFactory(className);
+        if (factory == null)
+        {
+            if (loader != null)
+            {
+                Class clazz;
+                try
+                {
+                    clazz = loadClass(className, loader);
+                }
+                catch (ClassNotFoundException x)
+                {
+                    throw new FactoryException("Instantiation failed for class " + className, x);
+                }
+                return getInstance(clazz);
+            }
+            else
+            {
+                return getInstance(className);
+            }
+        }
+        else
+        {
+            return factory.getInstance(loader);
+        }
+    }
+    /**
+     * Gets an instance of a named class.
+     * Parameters for its constructor are given as an array of objects,
+     * primitive types must be wrapped with a corresponding class.
+     *
+     * @param className the name of the class.
+     * @param params an array containing the parameters of the constructor.
+     * @param signature an array containing the signature of the constructor.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance(String className, Object[] params, String[] signature) throws FactoryException
+    {
+        Factory factory = getFactory(className);
+        if (factory == null)
+        {
+            Class clazz;
+            try
+            {
+                clazz = loadClass(className);
+            }
+            catch (ClassNotFoundException x)
+            {
+                throw new FactoryException("Instantiation failed for class " + className, x);
+            }
+            return getInstance(clazz, params, signature);
+        }
+        else
+        {
+            return factory.getInstance(params, signature);
+        }
+    }
+    /**
+     * Gets an instance of a named class using a specified class loader.
+     * Parameters for its constructor are given as an array of objects,
+     * primitive types must be wrapped with a corresponding class.
+     *
+     * <p>Class loaders are supported only if the isLoaderSupported
+     * method returns true. Otherwise the loader parameter is ignored.
+     *
+     * @param className the name of the class.
+     * @param loader the class loader.
+     * @param params an array containing the parameters of the constructor.
+     * @param signature an array containing the signature of the constructor.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance(String className, ClassLoader loader, Object[] params, String[] signature)
+        throws FactoryException
+    {
+        Factory factory = getFactory(className);
+        if (factory == null)
+        {
+            if (loader != null)
+            {
+                Class clazz;
+                try
+                {
+                    clazz = loadClass(className, loader);
+                }
+                catch (ClassNotFoundException x)
+                {
+                    throw new FactoryException("Instantiation failed for class " + className, x);
+                }
+                return getInstance(clazz, params, signature);
+            }
+            else
+            {
+                return getInstance(className, params, signature);
+            }
+        }
+        else
+        {
+            return factory.getInstance(loader, params, signature);
+        }
+    }
+    /**
+     * Tests if specified class loaders are supported for a named class.
+     *
+     * @param className the name of the class.
+     * @return true if class loaders are supported, false otherwise.
+     * @throws FactoryException if test fails.
+     */
+    public boolean isLoaderSupported(String className) throws FactoryException
+    {
+        Factory factory = getFactory(className);
+        return factory != null ? factory.isLoaderSupported() : true;
+    }
+    /**
+     * Gets an instance of a specified class.
+     *
+     * @param clazz the class.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance(Class clazz) throws FactoryException
+    {
+        try
+        {
+            return clazz.newInstance();
+        }
+        catch (Exception x)
+        {
+            throw new FactoryException("Instantiation failed for " + clazz.getName(), x);
+        }
+    }
+    /**
+     * Gets an instance of a specified class.
+     * Parameters for its constructor are given as an array of objects,
+     * primitive types must be wrapped with a corresponding class.
+     *
+     * @param clazz the class.
+     * @param params an array containing the parameters of the constructor.
+     * @param signature an array containing the signature of the constructor.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    protected Object getInstance(Class clazz, Object params[], String signature[]) throws FactoryException
+    {
+        /* Try to construct. */
+        try
+        {
+            Class[] sign = getSignature(clazz, params, signature);
+            return clazz.getConstructor(sign).newInstance(params);
+        }
+        catch (Exception x)
+        {
+            throw new FactoryException("Instantiation failed for " + clazz.getName(), x);
+        }
+    }
+    /**
+     * Gets the signature classes for parameters of a method of a class.
+     *
+     * @param clazz the class.
+     * @param params an array containing the parameters of the method.
+     * @param signature an array containing the signature of the method.
+     * @return an array of signature classes. Note that in some cases
+     * objects in the parameter array can be switched to the context
+     * of a different class loader.
+     * @throws ClassNotFoundException if any of the classes is not found.
+     */
+    public Class[] getSignature(Class clazz, Object params[], String signature[]) throws ClassNotFoundException
+    {
+        if (signature != null)
+        {
+            /* We have parameters. */
+            ClassLoader tempLoader;
+            ClassLoader loader = clazz.getClassLoader();
+            Class[] sign = new Class[signature.length];
+            for (int i = 0; i < signature.length; i++)
+            {
+                /* Check primitive types. */
+                sign[i] = getPrimitiveClass(signature[i]);
+                if (sign[i] == null)
+                {
+                    /* Not a primitive one, continue building. */
+                    if (loader != null)
+                    {
+                        /* Use the class loader of the target object. */
+                        sign[i] = loader.loadClass(signature[i]);
+                        tempLoader = sign[i].getClassLoader();
+                        if ((params[i] != null)
+                            && (tempLoader != null)
+                            && !tempLoader.equals(params[i].getClass().getClassLoader()))
+                        {
+                            /*
+                             * The class uses a different class loader,
+                             * switch the parameter.
+                             */
+                            params[i] = switchObjectContext(params[i], loader);
+                        }
+                    }
+                    else
+                    {
+                        /* Use the default class loader. */
+                        sign[i] = loadClass(signature[i]);
+                    }
+                }
+            }
+            return sign;
+        }
+        else
+        {
+            return null;
+        }
+    }
+    /**
+     * Switches an object into the context of a different class loader.
+     *
+     * @param object an object to switch.
+     * @param loader the loader of the new context.
+     */
+    protected Object switchObjectContext(Object object, ClassLoader loader)
+    {
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        try
+        {
+            ObjectOutputStream out = new ObjectOutputStream(bout);
+            out.writeObject(object);
+            out.flush();
+        }
+        catch (Exception x)
+        {
+            return object;
+        }
+        try
+        {
+            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
+            ObjectInputStreamForContext in = new ObjectInputStreamForContext(bin, loader);
+            return in.readObject();
+        }
+        catch (Exception x)
+        {
+            return object;
+        }
+    }
+    /**
+     * Loads the named class using the default class loader.
+     *
+     * @param className the name of the class to load.
+     * @return the loaded class.
+     * @throws ClassNotFoundException if the class was not found.
+     */
+    protected Class loadClass(String className) throws ClassNotFoundException
+    {
+        ClassLoader loader = this.getClass().getClassLoader();
+        try
+        {
+            return loader != null ? loader.loadClass(className) : Class.forName(className);
+        }
+        catch (ClassNotFoundException x)
+        {
+            /* Go through additional loaders. */
+            for (Iterator i = classLoaders.iterator(); i.hasNext();)
+            {
+                try
+                {
+                    return ((ClassLoader) i.next()).loadClass(className);
+                }
+                catch (ClassNotFoundException xx)
+                {
+                }
+            }
+            /* Give up. */
+            throw x;
+        }
+    }
+    /**
+     * Loads the named class using a specified class loader.
+     *
+     * @param className the name of the class to load.
+     * @param loader the loader to use.
+     * @return the loaded class.
+     * @throws ClassNotFoundException if the class was not found.
+     */
+    protected Class loadClass(String className, ClassLoader loader) throws ClassNotFoundException
+    {
+        return loader != null ? loader.loadClass(className) : loadClass(className);
+    }
+    /**
+     * Gets a customized factory for a named class. If no class-specific
+     * factory is specified but a default factory is, will use the default
+     * factory.
+     *
+     * @param className the name of the class to load.
+     * @return the factory, or null if not specified and no default.
+     * @throws FactoryException if instantiation of the factory fails.
+     */
+    protected Factory getFactory(String className) throws FactoryException
+    {
+        HashMap factories = objectFactories;
+        Object factory = factories.get(className);
+        if (factory == null)
+        {
+            //No named factory for this; try the default, if one
+            //exists.
+            factory = factories.get(DEFAULT_FACTORY);
+        }
+        if (factory != null)
+        {
+            if (factory instanceof String)
+            {
+                /* Not yet instantiated... */
+                try
+                {
+                    factory = (Factory) getInstance((String) factory);
+                    ((Factory) factory).init(className);
+                }
+                catch (FactoryException x)
+                {
+                    throw x;
+                }
+                catch (ClassCastException x)
+                {
+                    throw new FactoryException("Incorrect factory " + (String) factory + " for class " + className, x);
+                }
+                factories = (HashMap) factories.clone();
+                factories.put(className, factory);
+                objectFactories = factories;
+            }
+            return (Factory) factory;
+        }
+        else
+        {
+            return null;
+        }
+    }
+    // ---------------- Avalon Lifecycle Methods ---------------------
+    /**
+     * Avalon component lifecycle method
+     */
+    public void configure(Configuration conf) throws ConfigurationException
+    {
+        final Configuration[] loaders = conf.getChildren(CLASS_LOADER);
+        if (loaders != null)
+        {
+            loaderNames = new String[loaders.length];
+            for (int i = 0; i < loaders.length; i++)
+            {
+                loaderNames[i] = loaders[i].getValue();
+            }
+        }
+        final Configuration factories = conf.getChild(OBJECT_FACTORY, false);
+        if (factories != null)
+        {
+            Configuration[] nameVal = factories.getChildren();
+            for (int i = 0; i < nameVal.length; i++)
+            {
+                String key = nameVal[i].getName();
+                String factory = nameVal[i].getValue();
+                // Store the factory to the table as a string and
+                // instantiate it by using the service when needed.
+                objectFactories.put(key, factory);
+            }
+        }
+    }
+    /**
+     * Avalon component lifecycle method
+     * Initializes the service by loading default class loaders
+     * and customized object factories.
+     *
+     * @throws InitializationException if initialization fails.
+     */
+    public void initialize() throws Exception
+    {
+        if (loaderNames != null)
+        {
+            for (int i = 0; i < loaderNames.length; i++)
+            {
+                try
+                {
+                    classLoaders.add(loadClass(loaderNames[i]).newInstance());
+                }
+                catch (Exception x)
+                {
+                    throw new Exception(
+                        "No such class loader '" + loaderNames[i] + "' for DefaultFactoryService",
+                        x);
+                }
+            }
+            loaderNames = null;
+        }
+    }
+}
diff --git a/src/java/org/apache/fulcrum/factory/Factory.java b/src/java/org/apache/fulcrum/factory/Factory.java
new file mode 100644
index 0000000..841d30c
--- /dev/null
+++ b/src/java/org/apache/fulcrum/factory/Factory.java
@@ -0,0 +1,110 @@
+package org.apache.fulcrum.factory;
+
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+
+
+/**
+ * Factory is an interface for object factories. Object factories
+ * can be registered with the Factory Service to support customized
+ * functionality during instantiation of specific classes that
+ * the service itself cannot provide. Examples include
+ * instantiation of XML parsers and secure sockets requiring
+ * provider specific initializations before instantiation.
+ *
+ * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
+ * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
+ * @version $Id$
+ */
+public interface Factory
+{
+    /**
+     * Initializes the factory. This method is called by
+     * the Factory Service before the factory is used.
+     *
+     * @param className the name of the production class
+     * @throws FactoryException if initialization fails.
+     */
+    public void init(String className)
+        throws FactoryException;
+
+    /**
+     * Gets an instance of a class.
+     *
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance()
+        throws FactoryException;
+
+    /**
+     * Gets an instance of a class using a specified class loader.
+     *
+     * <p>Class loaders are supported only if the isLoaderSupported
+     * method returns true. Otherwise the loader parameter is ignored.
+     *
+     * @param loader the class loader.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance(ClassLoader loader)
+        throws FactoryException;
+
+    /**
+     * Gets an instance of a named class.
+     * Parameters for its constructor are given as an array of objects,
+     * primitive types must be wrapped with a corresponding class.
+     *
+     * @param params an array containing the parameters of the constructor.
+     * @param signature an array containing the signature of the constructor.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance(Object[] params,
+                              String[] signature)
+        throws FactoryException;
+
+    /**
+     * Gets an instance of a named class using a specified class loader.
+     * Parameters for its constructor are given as an array of objects,
+     * primitive types must be wrapped with a corresponding class.
+     *
+     * <p>Class loaders are supported only if the isLoaderSupported
+     * method returns true. Otherwise the loader parameter is ignored.
+     *
+     * @param loader the class loader.
+     * @param params an array containing the parameters of the constructor.
+     * @param signature an array containing the signature of the constructor.
+     * @return the instance.
+     * @throws FactoryException if instantiation fails.
+     */
+    public Object getInstance(ClassLoader loader,
+                              Object[] params,
+                              String[] signature)
+        throws FactoryException;
+
+    /**
+     * Tests if this object factory supports specified class loaders.
+     *
+     * @return true if class loaders are supported, false otherwise.
+     */
+    public boolean isLoaderSupported();
+}
diff --git a/src/java/org/apache/fulcrum/factory/FactoryException.java b/src/java/org/apache/fulcrum/factory/FactoryException.java
new file mode 100644
index 0000000..63c1ee0
--- /dev/null
+++ b/src/java/org/apache/fulcrum/factory/FactoryException.java
@@ -0,0 +1,43 @@
+package org.apache.fulcrum.factory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Exception thrown when there is a problem with the FactoryService
+ *
+ * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
+ * @version $Id$
+ */
+public class FactoryException extends Exception
+{
+    /**
+     * Serial number
+     */
+    private static final long serialVersionUID = 8954422192583295720L;
+
+    public FactoryException(String msg)
+    {
+        super(msg);
+    }
+    public FactoryException(String msg, Exception ex)
+    {
+        super(msg, ex);
+    }
+}
diff --git a/src/java/org/apache/fulcrum/factory/FactoryService.java b/src/java/org/apache/fulcrum/factory/FactoryService.java
new file mode 100644
index 0000000..e4e2f5f
--- /dev/null
+++ b/src/java/org/apache/fulcrum/factory/FactoryService.java
@@ -0,0 +1,140 @@
+package org.apache.fulcrum.factory;
+
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+
+
+/**
+ * The Factory Service instantiates objects using either default
+ * class loaders or a specified one. Whether specified class
+ * loaders are supported for a class depends on implementation
+ * and can be tested with the isLoaderSupported method.
+ *
+ * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
+ * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
+ * @version $Id$
+ */
+public interface FactoryService
+{
+    /**
+     * The key under which this component is known by an avalon container.
+     */
+    String ROLE = FactoryService.class.getName();
+
+
+	/**
+	* Gets an instance of a class.
+	*
+	* @param clazz the name of the class.
+	* @return the instance.
+	* @throws ServiceException if instantiation fails.
+	*/
+   public Object getInstance(Class clazz)
+	   throws FactoryException;
+
+    /**
+     * Gets an instance of a named class.
+     *
+     * @param className the name of the class.
+     * @return the instance.
+     * @throws ServiceException if instantiation fails.
+     */
+    public Object getInstance(String className)
+        throws FactoryException;
+
+    /**
+     * Gets an instance of a named class using a specified class loader.
+     *
+     * <p>Class loaders are supported only if the isLoaderSupported
+     * method returns true. Otherwise the loader parameter is ignored.
+     *
+     * @param className the name of the class.
+     * @param loader the class loader.
+     * @return the instance.
+     * @throws ServiceException if instantiation fails.
+     */
+    public Object getInstance(String className,
+                              ClassLoader loader)
+        throws FactoryException;
+
+    /**
+     * Gets an instance of a named class.
+     * Parameters for its constructor are given as an array of objects,
+     * primitive types must be wrapped with a corresponding class.
+     *
+     * @param className the name of the class.
+     * @param params an array containing the parameters of the constructor.
+     * @param signature an array containing the signature of the constructor.
+     * @return the instance.
+     * @throws ServiceException if instantiation fails.
+     */
+    public Object getInstance(String className,
+                              Object[] params,
+                              String[] signature)
+        throws FactoryException;
+
+    /**
+     * Gets an instance of a named class using a specified class loader.
+     * Parameters for its constructor are given as an array of objects,
+     * primitive types must be wrapped with a corresponding class.
+     *
+     * <p>Class loaders are supported only if the isLoaderSupported
+     * method returns true. Otherwise the loader parameter is ignored.
+     *
+     * @param className the name of the class.
+     * @param loader the class loader.
+     * @param params an array containing the parameters of the constructor.
+     * @param signature an array containing the signature of the constructor.
+     * @return the instance.
+     * @throws ServiceException if instantiation fails.
+     */
+    public Object getInstance(String className,
+                              ClassLoader loader,
+                              Object[] params,
+                              String[] signature)
+        throws FactoryException;
+
+    /**
+     * Tests if specified class loaders are supported for a named class.
+     *
+     * @param className the name of the class.
+     * @return true if class loaders are supported, false otherwise.
+     * @throws ServiceException if test fails.
+     */
+    public boolean isLoaderSupported(String className)
+        throws FactoryException;
+
+    /**
+     * Gets the signature classes for parameters of a method of a class.
+     *
+     * @param clazz the class.
+     * @param params an array containing the parameters of the method.
+     * @param signature an array containing the signature of the method.
+     * @return an array of signature classes. Note that in some cases
+     * objects in the parameter array can be switched to the context
+     * of a different class loader.
+     * @throws ClassNotFoundException if any of the classes is not found.
+     */
+    Class[] getSignature(Class clazz,
+            Object params[],
+            String signature[])
+            throws ClassNotFoundException;
+}
diff --git a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
new file mode 100644
index 0000000..a0fb934
--- /dev/null
+++ b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
@@ -0,0 +1,70 @@
+package org.apache.fulcrum.factory.utils;
+
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamClass;
+import java.io.IOException;
+
+/**
+ * A deserialization stream for a specific class loader context.
+ *
+ * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
+ * @version $Id$
+ */
+public class ObjectInputStreamForContext extends ObjectInputStream
+{
+    /**
+     * The class loader of the context.
+     */
+    private ClassLoader classLoader;
+
+    // this is to make the proxy happy.
+    public ObjectInputStreamForContext()
+        throws IOException
+    {
+    }
+
+    /**
+     * Contructs a new object stream for a context.
+     *
+     * @param in the serialized input stream.
+     * @param loader the class loader of the context.
+     * @throws IOException on errors.
+     */
+    public  ObjectInputStreamForContext(InputStream in,
+                                        ClassLoader loader)
+                                        throws IOException
+    {
+        super(in);
+        classLoader = loader;
+    }
+
+    protected Class resolveClass(ObjectStreamClass v)
+                                 throws IOException,
+                                 ClassNotFoundException
+    {
+        return classLoader == null ?
+            super.resolveClass(v) : classLoader.loadClass(v.getName());
+    }
+}
diff --git a/src/test/TestComponentConfig.xml b/src/test/TestComponentConfig.xml
new file mode 100644
index 0000000..d027290
--- /dev/null
+++ b/src/test/TestComponentConfig.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<componentConfig>
+
+    <factory/>
+</componentConfig>
diff --git a/src/test/TestRoleConfig.xml b/src/test/TestRoleConfig.xml
new file mode 100644
index 0000000..8918105
--- /dev/null
+++ b/src/test/TestRoleConfig.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<!-- This configuration file for Avalon components is used for testing the TestComponent -->
+<role-list>
+    <role
+        name="org.apache.fulcrum.factory.FactoryService"
+        shorthand="factory"
+        default-class="org.apache.fulcrum.factory.DefaultFactoryService"/>
+
+
+</role-list>
diff --git a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
new file mode 100644
index 0000000..eb97a08
--- /dev/null
+++ b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
@@ -0,0 +1,131 @@
+package org.apache.fulcrum.factory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+
+import java.util.ArrayList;
+import org.apache.fulcrum.testcontainer.BaseUnitTest;
+
+/**
+ * @author Eric Pugh
+ * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class FactoryServiceTest extends BaseUnitTest
+{
+    private FactoryService factoryService = null;
+    /**
+     * Defines the testcase name for JUnit.
+     *
+     * @param name the testcase's name.
+     */
+    public FactoryServiceTest(String name)
+    {
+        super(name);
+    }
+
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        factoryService = (FactoryService) this.resolve( FactoryService.class.getName() );
+
+    }
+    /*
+     * Class to test for Object getInstance(String)
+     */
+    public void testGetInstanceString() throws Exception
+    {
+        Object object = factoryService.getInstance("java.lang.StringBuffer");
+        assertTrue(object instanceof StringBuffer);
+    }
+    /*
+     * Class to test for Object getInstance(String, ClassLoader)
+     */
+    public void testGetInstanceStringClassLoader() throws Exception
+    {
+        Object object = factoryService.getInstance("java.lang.StringBuffer", StringBuffer.class.getClassLoader());
+        assertTrue(object instanceof StringBuffer);
+    }
+    /*
+     * Class to test for Object getInstance(String, Object[], String[])
+     */
+    public void testGetInstanceStringObjectArrayStringArray() throws Exception
+    {
+        Object params[] = new Object[1];
+        String sourceValue = "testing";
+        params[0] = sourceValue;
+        String signature[] = new String[1];
+        signature[0] = "java.lang.String";
+        Object object = factoryService.getInstance("java.lang.StringBuffer", params, signature);
+        assertTrue(object instanceof StringBuffer);
+        assertEquals(sourceValue, object.toString());
+
+    }
+    /*
+     * Class to test for Object getInstance(String, ClassLoader, Object[], String[])
+     */
+    public void testGetInstanceStringClassLoaderObjectArrayStringArray() throws Exception
+    {
+        Object params[] = new Object[1];
+        String sourceValu = "testing";
+        params[0] = sourceValu;
+        String signature[] = new String[1];
+        signature[0] = "java.lang.String";
+        Object object =
+            factoryService.getInstance(
+                "java.lang.StringBuffer",
+                StringBuffer.class.getClassLoader(),
+                params,
+                signature);
+        assertTrue(object instanceof StringBuffer);
+        assertEquals(sourceValu, object.toString());
+
+    }
+    /**
+     * @todo Need to run a test where the loader is NOT supported.
+     * @throws Exception
+     */
+    public void testIsLoaderSupported() throws Exception
+    {
+        assertTrue(factoryService.isLoaderSupported("java.lang.String"));
+
+    }
+    public void testGetSignature() throws Exception
+    {
+        Object params[] = new Object[1];
+        String sourceValu = "testing";
+        params[0] = sourceValu;
+        String signature[] = new String[1];
+        signature[0] = "java.lang.String";
+        Class[] results = factoryService.getSignature(StringBuffer.class, params, signature);
+        assertEquals(1, results.length);
+        assertTrue(results[0].equals(String.class));
+
+        Integer sourceValueInteger = new Integer(10);
+        params[0] = sourceValueInteger;
+        signature[0] = "java.lang.Integer";
+        results = factoryService.getSignature(ArrayList.class, params, signature);
+        assertEquals(1, results.length);
+        assertTrue("Result:" + results[0].getName(),results[0].equals(Integer.class));
+
+    }
+}
diff --git a/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java b/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
new file mode 100644
index 0000000..f00fa7e
--- /dev/null
+++ b/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
@@ -0,0 +1,57 @@
+package org.apache.fulcrum.factory.utils;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import junit.framework.TestCase;
+
+/**
+ * @author Eric Pugh
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+
+public class ObjectInputStreamForContextTest extends TestCase
+{
+    public static void main(String[] args)
+    {
+        junit.textui.TestRunner.run(ObjectInputStreamForContextTest.class);
+    }
+    /*
+     * Class to test for void ObjectInputStreamForContext(InputStream, ClassLoader)
+     */
+    public void testObjectInputStreamForContextInputStreamClassLoader() throws Exception
+    {
+        Object object = new String("I am testing");
+        Object object2 = null;
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        ObjectOutputStream out = new ObjectOutputStream(bout);
+        out.writeObject(object);
+        out.flush();
+        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
+        ObjectInputStreamForContext in = new ObjectInputStreamForContext(bin, String.class.getClassLoader());
+        object2 = in.readObject();
+        assertEquals(object.toString(), object2.toString());
+        assertEquals(object, object2);
+    }
+}
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
new file mode 100644
index 0000000..bcc5886
--- /dev/null
+++ b/xdocs/changes.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<document>
+  <properties>
+    <title>Fulcrum Factory</title>
+    <author email="epugh@opensourceconnections.com">Eric Pugh</author>
+  </properties>
+
+  <body>
+    <release version="1.0.3" date="2004-11-24">
+      <action dev="epugh" type="update" due-to="Kostyantyn Shchekotykhin">
+        Merge api and impl jars into one project.
+      </action>
+      <action dev="epugh" type="update">
+      	Clean up dependencies.  Use TestContainer.
+      </action>
+    </release>
+	<release version="1.0.2" date="">
+      <action dev="epugh" type="update">
+      	Update to use Merlin 3.3.0
+      </action>
+    </release>
+  </body>
+</document>
+
diff --git a/xdocs/index.xml b/xdocs/index.xml
new file mode 100644
index 0000000..74e7d09
--- /dev/null
+++ b/xdocs/index.xml
@@ -0,0 +1,198 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+
+<document>
+
+  <properties>
+    <title>Factory Component</title>
+    <author email="epugh@upstate.com">Eric PUgh</author>
+  </properties>
+
+  <body>
+
+  <section name="Overview">
+<p>
+The Factory Service instantiates objects from the given class name
+using either the given class loader or an applicable one found from the class
+loader repository. If neither one is specified, the default class loader
+will be used.
+</p>
+
+<p>
+The service provides the following benefits compared to Class.forName():
+</p>
+<ul>
+<li>support for parameters in constructors,</li>
+<li>internal class loader repository, which can be specified in resources,</li>
+<li>optional class specific factories, which can be used for customized instantiation, and</li>
+<li>integration with the Pool Service supporting recycling of instances created by the service.</li>
+</ul>
+  </section>
+
+<section name="Configuration">
+
+    <p>
+      First, here is the role configuration.
+    </p>
+
+<source>
+<![CDATA[
+   <role
+        name="org.apache.fulcrum.factory.FactoryService"
+        shorthand="factory"
+        default-class="org.apache.fulcrum.factory.DefaultFactoryService"/>
+]]>
+</source>
+
+  <p>
+    There is configuration values for classloaders, still need to add.
+  </p>
+<source>
+
+<![CDATA[
+    <factory/>
+]]>
+</source>
+
+  </section>
+
+  <section name="Usage">
+
+<p>
+In Turbine, the Factory Service is currently only used internally by the Pool Service.
+Applications can also use the service instead of Class.forName() and for unifying
+initialization, configuration and access to vendor specific object factories.
+The following is a simplified example of a customized DOM parser factory:
+</p>
+
+<source><![CDATA[
+package org.foo.xml;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.fulcrum.ServiceException;
+import org.apache.fulcrum.factory.Factory;
+
+/**
+ * A factory for instantiating DOM parsers.
+ */
+public class DomBuilderFactory implements Factory
+{
+    /**
+     * The implementation of the factory.
+     */
+    private DocumentBuilderFactory factory;
+
+    /**
+     * Initializes the factory.
+     */
+    public void init(String className)
+        throws ServiceException
+    {
+        factory = DocumentBuilderFactory.newInstance();
+    }
+
+    /**
+     * Gets a DocumentBuilder instance.
+     */
+    public Object getInstance()
+        throws ServiceException
+    {
+        try
+        {
+            return factory.newDocumentBuilder();
+        }
+        catch (ParserConfigurationException x)
+        {
+            throw new TurbineException(x);
+        }
+    }
+
+    /**
+     * Gets a DocumentBuilder instance.
+     * The given loader is ignored.
+     */
+    public Object getInstance(ClassLoader loader)
+        throws ServiceException
+    {
+        return getInstance();
+    }
+
+    /**
+     * Gets a DocumentBuilder instance.
+     * Constructor parameters are ignored.
+     */
+    public Object getInstance(Object[] params,
+                              String[] signature)
+        throws ServiceException
+    {
+        return getInstance();
+    }
+
+    /**
+     * Gets a DocumentBuilder instance.
+     * The given loader and constructor parameters are ignored.
+     */
+    public Object getInstance(ClassLoader loader,
+                              Object[] params,
+                              String[] signature)
+        throws ServiceException
+    {
+        return getInstance();
+    }
+
+    /**
+     * Returns false as given class loaders are not supported.
+     */
+    public boolean isLoaderSupported()
+    {
+        return false;
+    }
+}
+]]></source>
+
+<p>
+The customized DOM parser factory must be specified in Turbine Resources before it can be used:
+</p>
+
+<source><![CDATA[
+services.FactoryService.factory.javax.xml.parsers.DocumentBuilder=org.foo.xml.DomBuilderFactory
+]]></source>
+
+<p>
+A DOM parser can now be instantiated with the following code fragment:
+</p>
+
+<source><![CDATA[
+// Access the service singleton.
+FactoryService service = (FactoryService)
+    TurbineServices.getInstance().getService(FactoryService.SERVICE_NAME);
+
+// Create a new DOM parser.
+DocumentBuilder parser =
+    service.getInstance("javax.xml.parsers.DocumentBuilder");
+]]></source>
+
+  </section>
+
+</body>
+</document>
diff --git a/xdocs/navigation.xml b/xdocs/navigation.xml
new file mode 100644
index 0000000..0fead1d
--- /dev/null
+++ b/xdocs/navigation.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+
+<!DOCTYPE project [
+<!ENTITY site-nav SYSTEM "../../incl_site_nav.xml">
+]>
+
+<project
+  name="Fulcrum Factory"
+  href="http://turbine.apache.org/fulcrum/fulcrum-factory/">
+
+  <body>
+
+&site-nav;
+
+    <menu name="Overview">
+      <item name="Main"                 href="/index.html"/>
+      <item name="Tasks"                href="/tasks.html"/>
+    </menu>
+  </body>
+</project>
diff --git a/xdocs/tasks.xml b/xdocs/tasks.xml
new file mode 100644
index 0000000..a8572e6
--- /dev/null
+++ b/xdocs/tasks.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<document>
+
+  <properties>
+    <title>Tasks</title>
+    <author email="epugh@upstate.com">Eric Pugh</author>
+  </properties>
+
+  <body>
+    <section name="Tasks">
+      <p>
+      	Lists of todos and ideas for future versions.
+      </p>
+
+      <subsection name="1.0">
+       <p>
+          <ul>
+           <li>
+              Need to test using the configuratio values.  Currently it just uses the default Classloader.
+            </li>
+           <li>
+              Document using different classloaders.
+            </li>
+          </ul>
+        </p>
+      </subsection>
+
+    </section>
+
+  </body>
+</document>

[turbine-fulcrum-factory] 46/49: - Update Fulcrum Testcontainer 1.0.9 and Turbine Parent 7 - Fix Mock Encoding in Fulcrum Update Test - Format Yaafi Tests - Remove JUnitPlatform in json, crypto module

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 1960e07133e8873c9c0582326567998e2c6e6106
Author: Georg Kallidis <gk...@apache.org>
AuthorDate: Tue Mar 23 14:42:37 2021 +0000

    - Update Fulcrum Testcontainer 1.0.9 and Turbine Parent 7
    - Fix Mock Encoding in Fulcrum Update Test
    - Format Yaafi Tests
    - Remove JUnitPlatform in json, crypto module
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1887964 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 61c7af5..541a093 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <artifactId>turbine-parent</artifactId>
        <groupId>org.apache.turbine</groupId>
-       <version>5</version>
+       <version>7</version>
        <relativePath />
   </parent>
 
@@ -91,7 +91,7 @@
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-testcontainer</artifactId>
-      <version>1.0.8</version>
+      <version>1.0.9</version>
       <scope>test</scope>
     </dependency>
     <dependency>

[turbine-fulcrum-factory] 43/49: [maven-release-plugin] prepare for next development iteration

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 513afc09a10238ad41ceeda371ce534cdf91ef58
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Fri Jan 11 12:54:04 2019 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1851037 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9b24d2a..5b186af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,16 +26,16 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.fulcrum</groupId>
   <artifactId>fulcrum-factory</artifactId>
-  <version>1.1.1</version>
+  <version>1.1.2-SNAPSHOT</version>
   <name>Fulcrum Factory</name>
   <inceptionYear>2005</inceptionYear>
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-factory-1.1.1</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-factory-1.1.1</developerConnection>
-    <url>http://svn.apache.org/viewvc/turbine/fulcrum/tags/fulcrum-factory-1.1.1</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
+    <url>http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/</url>
   </scm>
 
   <developers>

[turbine-fulcrum-factory] 08/49: Use released version of fulcrum-testcontainer

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit c3bf09a471c45d55ad2ea9fea1731e80e24e3f72
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Fri May 29 21:22:59 2009 +0000

    Use released version of fulcrum-testcontainer
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@780110 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index a94e7a3..0c81a50 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,7 +92,7 @@
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-testcontainer</artifactId>
-      <version>1.0.6-SNAPSHOT</version>
+      <version>1.0.6</version>
       <scope>test</scope>
     </dependency>
     <dependency>

[turbine-fulcrum-factory] 49/49: - Remove .cvsignore, replace with .gitignore (mostly identical)

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 2ba3c28636e29b796ffee093998280357ce9df24
Author: Georg Kallidis <gk...@apache.org>
AuthorDate: Tue Jun 8 08:33:25 2021 +0000

    - Remove .cvsignore, replace with .gitignore (mostly identical)
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1890592 13f79535-47bb-0310-9956-ffa450edef68
---
 .cvsignore => .gitignore | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/.cvsignore b/.gitignore
similarity index 58%
rename from .cvsignore
rename to .gitignore
index e97dd78..4dd87bc 100644
--- a/.cvsignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
-target
-*.log
-.classpath
-.project
-jcoverage.ser
-*.merlin
+target
+*.log
+.classpath
+.project
+*.iml

[turbine-fulcrum-factory] 42/49: [maven-release-plugin] prepare release fulcrum-factory-1.1.1

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit c6b49b46e0c40f49c99587ef1e963123c789bcc0
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Fri Jan 11 12:53:52 2019 +0000

    [maven-release-plugin] prepare release fulcrum-factory-1.1.1
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1851035 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6355392..9b24d2a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,22 +20,22 @@
     <artifactId>turbine-parent</artifactId>
        <groupId>org.apache.turbine</groupId>
        <version>5</version>
-       <relativePath></relativePath>
+       <relativePath />
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.fulcrum</groupId>
   <artifactId>fulcrum-factory</artifactId>
-  <version>1.1.1-SNAPSHOT</version>
+  <version>1.1.1</version>
   <name>Fulcrum Factory</name>
   <inceptionYear>2005</inceptionYear>
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
-    <url>http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-factory-1.1.1</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-factory-1.1.1</developerConnection>
+    <url>http://svn.apache.org/viewvc/turbine/fulcrum/tags/fulcrum-factory-1.1.1</url>
   </scm>
 
   <developers>

[turbine-fulcrum-factory] 48/49: Add missing NOTICE.txt files and update copyright year to 2021

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit aa003a4efa299d22f347bdb39f69daf6032235df
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Mon May 24 16:49:39 2021 +0000

    Add missing NOTICE.txt files and update copyright year to 2021
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1890170 13f79535-47bb-0310-9956-ffa450edef68
---
 NOTICE.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 0000000..29012dc
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,6 @@
+Turbine Fulcrum Factory Component
+Copyright 2005-2021 The Apache Software Foundation.
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+

[turbine-fulcrum-factory] 14/49: Fix POM

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit f644468a312a05de9040f127d283da2750af67ba
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Jun 15 19:52:49 2009 +0000

    Fix POM
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@784947 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/pom.xml b/pom.xml
index b823e33..f6f3f8c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,3 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You 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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.fulcrum</groupId>

[turbine-fulcrum-factory] 13/49: [maven-release-plugin] prepare for next development iteration

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 9242469cde93d3c6c62193964844f541dc5284ae
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Jun 15 19:48:17 2009 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@784945 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9aaef39..b823e33 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,16 +7,16 @@
 
   <modelVersion>4.0.0</modelVersion>
   <artifactId>fulcrum-factory</artifactId>
-  <version>1.0.4</version>
+  <version>1.0.5-SNAPSHOT</version>
   <name>Fulcrum Factory</name>
   <inceptionYear>2005</inceptionYear>
   <description>Fulcrum Factory Service</description>
   <url>http://turbine.apache.org/fulcrum/fulcrum-factory</url>
 		
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</developerConnection>
-    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/tags/FULCRUM_FACTORY_1_0_4</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory/</developerConnection>
+    <url>http://svn.apache.org/viewcvs/turbine/fulcrum/trunk/factory/</url>
   </scm>
 
   <distributionManagement>

[turbine-fulcrum-factory] 44/49: Update release versions for changes.xml

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 555a81f9b84227624f95f466267dc12b447bdd93
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Wed Jan 23 19:59:34 2019 +0000

    Update release versions for changes.xml
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1851974 13f79535-47bb-0310-9956-ffa450edef68
---
 src/changes/changes.xml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index f58ffcb..f0d02a7 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,7 +24,9 @@
   </properties>
 
   <body>
-    <release version="1.1.1" date="in SVN">
+    <release version="1.1.2" date="in SVN">
+    </release>
+    <release version="1.1.1" date="2019-01-20">
 		<action dev="painter" type="update">
 			Update to junit 5 test cases
 		</action>

[turbine-fulcrum-factory] 40/49: Turbine coding standards compliance, update tests with annotations

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit ce263e0da1553a77afd15d71af33a47b727fa6df
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Mon Jan 7 21:02:00 2019 +0000

    Turbine coding standards compliance, update tests with annotations
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1850690 13f79535-47bb-0310-9956-ffa450edef68
---
 .../fulcrum/factory/DefaultFactoryService.java     | 140 ++++++++++++++-------
 .../apache/fulcrum/factory/FactoryException.java   |  12 +-
 .../org/apache/fulcrum/factory/FactoryService.java |  15 ++-
 .../factory/utils/ObjectInputStreamForContext.java |   4 +-
 .../apache/fulcrum/factory/FactoryServiceTest.java |  75 +++++++----
 .../utils/ObjectInputStreamForContextTest.java     |  31 ++++-
 6 files changed, 193 insertions(+), 84 deletions(-)

diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
index 0e6d599..69532f0 100644
--- a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -106,7 +106,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @param type a primitive type.
 	 * @return the corresponding class, or null.
 	 */
-	protected static Class<?> getPrimitiveClass(String type) {
+	protected static Class<?> getPrimitiveClass(String type) 
+	{
 		return primitiveClasses.get(type);
 	}
 
@@ -118,7 +119,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws FactoryException if instantiation fails.
 	 */
 	@Override
-	public <T> T getInstance(String className) throws FactoryException {
+	public <T> T getInstance(String className) throws FactoryException 
+	{
 		if (className == null) {
 			throw new FactoryException("Missing String className");
 		}
@@ -149,7 +151,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws FactoryException if instantiation fails.
 	 */
 	@Override
-	public <T> T getInstance(String className, ClassLoader loader) throws FactoryException {
+	public <T> T getInstance(String className, ClassLoader loader) throws FactoryException 
+	{
 		Factory<T> factory = getFactory(className);
 		if (factory == null) {
 			if (loader != null) {
@@ -180,7 +183,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws FactoryException if instantiation fails.
 	 */
 	@Override
-	public <T> T getInstance(String className, Object[] params, String[] signature) throws FactoryException {
+	public <T> T getInstance(String className, Object[] params, String[] signature) throws FactoryException 
+	{
 		Factory<T> factory = getFactory(className);
 		if (factory == null) {
 			Class<T> clazz;
@@ -203,7 +207,9 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * <p>
 	 * Class loaders are supported only if the isLoaderSupported method returns
 	 * true. Otherwise the loader parameter is ignored.
+	 * </p>
 	 *
+	 * @param           <T> Type of the class
 	 * @param className the name of the class.
 	 * @param loader    the class loader.
 	 * @param params    an array containing the parameters of the constructor.
@@ -213,7 +219,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 */
 	@Override
 	public <T> T getInstance(String className, ClassLoader loader, Object[] params, String[] signature)
-			throws FactoryException {
+			throws FactoryException 
+	{
 		Factory<T> factory = getFactory(className);
 		if (factory == null) {
 			if (loader != null) {
@@ -248,6 +255,7 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	/**
 	 * Gets an instance of a specified class.
 	 *
+	 * @param           <T> Type of the class
 	 * @param clazz the class.
 	 * @return the instance.
 	 * @throws FactoryException if instantiation fails.
@@ -295,7 +303,8 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws ClassNotFoundException if any of the classes is not found.
 	 */
 	@Override
-	public Class<?>[] getSignature(Class<?> clazz, Object params[], String signature[]) throws ClassNotFoundException {
+	public Class<?>[] getSignature(Class<?> clazz, Object params[], String signature[]) throws ClassNotFoundException 
+	{
 		if (signature != null) {
 			/* We have parameters. */
 			ClassLoader tempLoader;
@@ -337,30 +346,43 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @param loader the loader of the new context.
 	 * @return the object
 	 */
-	protected Object switchObjectContext(Object object, ClassLoader loader) {
+	protected Object switchObjectContext(Object object, ClassLoader loader) 
+	{
 		ByteArrayOutputStream bout = new ByteArrayOutputStream();
 
-		try {
+		try 
+		{
 			ObjectOutputStream out = new ObjectOutputStream(bout);
 			out.writeObject(object);
 			out.flush();
-		} catch (IOException x) {
+		} 
+		catch (IOException x) 
+		{
 			return object;
 		}
 
 		ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
 		ObjectInputStreamForContext in = null;
 
-		try {
+		try 
+		{
 			in = new ObjectInputStreamForContext(bin, loader);
 			return in.readObject();
-		} catch (Exception x) {
+		} 
+		catch (Exception x) 
+		{
 			return object;
-		} finally {
-			if (in != null) {
-				try {
+		} 
+		finally 
+		{
+			if (in != null) 
+			{
+				try 
+				{
 					in.close();
-				} catch (IOException e) {
+				} 
+				catch (IOException e) 
+				{
 					// close quietly
 				}
 			}
@@ -375,24 +397,35 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws ClassNotFoundException if the class was not found.
 	 */
 	@SuppressWarnings("unchecked")
-	protected <T> Class<T> loadClass(String className) throws ClassNotFoundException {
+	protected <T> Class<T> loadClass(String className) throws ClassNotFoundException 
+	{
 		ClassLoader loader = this.getClass().getClassLoader();
-		try {
+		try 
+		{
 			Class<T> clazz;
 
-			if (loader != null) {
+			if (loader != null) 
+			{
 				clazz = (Class<T>) loader.loadClass(className);
-			} else {
+			} 
+			else 
+			{
 				clazz = (Class<T>) Class.forName(className);
 			}
 
 			return clazz;
-		} catch (ClassNotFoundException x) {
+		} 
+		catch (ClassNotFoundException x) 
+		{
 			/* Go through additional loaders. */
-			for (ClassLoader l : classLoaders) {
-				try {
+			for (ClassLoader l : classLoaders) 
+			{
+				try 
+				{
 					return (Class<T>) l.loadClass(className);
-				} catch (ClassNotFoundException xx) {
+				} 
+				catch (ClassNotFoundException xx) 
+				{
 					// continue
 				}
 			}
@@ -410,10 +443,14 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws ClassNotFoundException if the class was not found.
 	 */
 	@SuppressWarnings("unchecked")
-	protected <T> Class<T> loadClass(String className, ClassLoader loader) throws ClassNotFoundException {
-		if (loader != null) {
+	protected <T> Class<T> loadClass(String className, ClassLoader loader) throws ClassNotFoundException 
+	{
+		if (loader != null) 
+		{
 			return (Class<T>) loader.loadClass(className);
-		} else {
+		} 
+		else 
+		{
 			return loadClass(className);
 		}
 	}
@@ -427,19 +464,24 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws FactoryException if instantiation of the factory fails.
 	 */
 	@SuppressWarnings("unchecked")
-	protected <T> Factory<T> getFactory(String className) throws FactoryException {
+	protected <T> Factory<T> getFactory(String className) throws FactoryException 
+	{
 		Factory<T> factory = (Factory<T>) objectFactories.get(className);
-		if (factory == null) {
-			// No named factory for this; try the default, if one
-			// exists.
+		if (factory == null) 
+		{
+			// No named factory for this; try the default, if one exists
 			factory = (Factory<T>) objectFactories.get(DEFAULT_FACTORY);
 		}
+		
 		if (factory == null) {
+			
 			/* Not yet instantiated... */
 			String factoryClass = objectFactoryClasses.get(className);
-			if (factoryClass == null) {
+			if (factoryClass == null) 
+			{
 				factoryClass = objectFactoryClasses.get(DEFAULT_FACTORY);
 			}
+			
 			if (factoryClass == null) {
 				return null;
 			}
@@ -447,11 +489,15 @@ public class DefaultFactoryService extends AbstractLogEnabled
 			try {
 				factory = getInstance(factoryClass);
 				factory.init(className);
-			} catch (ClassCastException x) {
+			} 
+			catch (ClassCastException x) 
+			{
 				throw new FactoryException("Incorrect factory " + factoryClass + " for class " + className, x);
 			}
+			
 			Factory<T> _factory = (Factory<T>) objectFactories.putIfAbsent(className, factory);
-			if (_factory != null) {
+			if (_factory != null) 
+			{
 				// Already created - take first instance
 				factory = _factory;
 			}
@@ -467,17 +513,21 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
 	 */
 	@Override
-	public void configure(Configuration conf) throws ConfigurationException {
+	public void configure(Configuration conf) throws ConfigurationException 
+	{
 		final Configuration[] loaders = conf.getChildren(CLASS_LOADER);
-		if (loaders != null) {
+		if (loaders != null) 
+		{
 			loaderNames = new String[loaders.length];
-			for (int i = 0; i < loaders.length; i++) {
+			for (int i = 0; i < loaders.length; i++) 
+			{
 				loaderNames[i] = loaders[i].getValue();
 			}
 		}
 
 		final Configuration factories = conf.getChild(OBJECT_FACTORY, false);
-		if (factories != null) {
+		if (factories != null) 
+		{
 			// Store the factory to the table as a string and
 			// instantiate it by using the service when needed.
 			Configuration[] nameVal = factories.getChildren();
@@ -494,13 +544,19 @@ public class DefaultFactoryService extends AbstractLogEnabled
 	 * @throws Exception if initialization fails.
 	 */
 	@Override
-	public void initialize() throws Exception {
-		if (loaderNames != null) {
-			for (String className : loaderNames) {
-				try {
+	public void initialize() throws Exception 
+	{
+		if (loaderNames != null) 
+		{
+			for (String className : loaderNames) 
+			{
+				try 
+				{
 					ClassLoader loader = (ClassLoader) loadClass(className).newInstance();
 					classLoaders.add(loader);
-				} catch (Exception x) {
+				} 
+				catch (Exception x) 
+				{
 					throw new Exception("No such class loader '" + className + "' for DefaultFactoryService", x);
 				}
 			}
diff --git a/src/java/org/apache/fulcrum/factory/FactoryException.java b/src/java/org/apache/fulcrum/factory/FactoryException.java
index 1e1cae1..d87033b 100644
--- a/src/java/org/apache/fulcrum/factory/FactoryException.java
+++ b/src/java/org/apache/fulcrum/factory/FactoryException.java
@@ -34,7 +34,8 @@ public class FactoryException extends Exception {
 	/**
 	 * Default constructor
 	 */
-	public FactoryException() {
+	public FactoryException() 
+	{
 		super();
 	}
 
@@ -44,7 +45,8 @@ public class FactoryException extends Exception {
 	 * @param message the message
 	 * @param e       the exception
 	 */
-	public FactoryException(String message, Throwable e) {
+	public FactoryException(String message, Throwable e) 
+	{
 		super(message, e);
 	}
 
@@ -53,7 +55,8 @@ public class FactoryException extends Exception {
 	 * 
 	 * @param e the exception to bubble up
 	 */
-	public FactoryException(Throwable e) {
+	public FactoryException(Throwable e) 
+	{
 		super(e);
 	}
 
@@ -62,7 +65,8 @@ public class FactoryException extends Exception {
 	 * 
 	 * @param msg the message to bubble up
 	 */
-	public FactoryException(String msg) {
+	public FactoryException(String msg) 
+	{
 		super(msg);
 	}
 }
diff --git a/src/java/org/apache/fulcrum/factory/FactoryService.java b/src/java/org/apache/fulcrum/factory/FactoryService.java
index f48ecd4..8f4347f 100644
--- a/src/java/org/apache/fulcrum/factory/FactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/FactoryService.java
@@ -40,6 +40,7 @@ public interface FactoryService
 	/**
 	* Gets an instance of a class.
 	*
+	* @param <T> Type of the class
 	* @param clazz the name of the class.
 	* @return {@inheritDoc} the instance.
 	* @throws FactoryException if instantiation fails.
@@ -50,6 +51,7 @@ public interface FactoryService
     /**
      * Gets an instance of a named class.
      *
+     * @param <T> Type of the class
      * @param className the name of the class.
      * @return {@inheritDoc} the instance.
      * @throws FactoryException if instantiation fails.
@@ -60,9 +62,10 @@ public interface FactoryService
     /**
      * Gets an instance of a named class using a specified class loader.
      *
-     * <p>Class loaders are supported only if the isLoaderSupported
+     * Class loaders are supported only if the isLoaderSupported
      * method returns true. Otherwise the loader parameter is ignored.
-     *
+     * 
+     * @param <T> Type of the class
      * @param className the name of the class.
      * @param loader the class loader.
      * @return {@inheritDoc} the instance.
@@ -77,6 +80,7 @@ public interface FactoryService
      * Parameters for its constructor are given as an array of objects,
      * primitive types must be wrapped with a corresponding class.
      *
+     * @param <T> Type of the class
      * @param className the name of the class.
      * @param params an array containing the parameters of the constructor.
      * @param signature an array containing the signature of the constructor.
@@ -93,9 +97,10 @@ public interface FactoryService
      * Parameters for its constructor are given as an array of objects,
      * primitive types must be wrapped with a corresponding class.
      *
-     * <p>Class loaders are supported only if the isLoaderSupported
+     * Class loaders are supported only if the isLoaderSupported
      * method returns true. Otherwise the loader parameter is ignored.
      *
+     * @param <T> Type of the class
      * @param className the name of the class.
      * @param loader the class loader.
      * @param params an array containing the parameters of the constructor.
@@ -125,9 +130,11 @@ public interface FactoryService
      * @param clazz the class.
      * @param params an array containing the parameters of the method.
      * @param signature an array containing the signature of the method.
+     * 
      * @return {@inheritDoc} an array of signature classes. Note that in some cases
      * objects in the parameter array can be switched to the context
-     * of a different class loader.
+     * of a different class loader
+     * 
      * @throws ClassNotFoundException if any of the classes is not found.
      */
     Class<?>[] getSignature(Class<?> clazz,
diff --git a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
index bf9338b..f7b2e40 100644
--- a/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
+++ b/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java
@@ -38,7 +38,7 @@ public class ObjectInputStreamForContext extends ObjectInputStream
     private ClassLoader classLoader;
 
     /**
-     * this is to make the proxy happy.
+     * Required to make satisfy the proxy methods
      * 
      * @throws IOException Generic exception
      */
@@ -48,7 +48,7 @@ public class ObjectInputStreamForContext extends ObjectInputStream
     }
 
     /**
-     * Contructs a new object stream for a context.
+     * This method will construct a new object stream for a context.
      *
      * @param in the serialized input stream.
      * @param loader the class loader of the context.
diff --git a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
index e86a229..1a85700 100644
--- a/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
+++ b/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java
@@ -23,15 +23,21 @@ package org.apache.fulcrum.factory;
 import java.util.ArrayList;
 
 import org.apache.fulcrum.testcontainer.BaseUnitTest;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
- * @author Eric Pugh
+ * Basic tests of the fulcrum factory service
+ * 
+ * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
- *
+ * 
+ * @version $Id$ 
  */
 public class FactoryServiceTest extends BaseUnitTest
 {
     private FactoryService factoryService = null;
+    
     /**
      * Defines the testcase name for JUnit.
      *
@@ -42,54 +48,64 @@ public class FactoryServiceTest extends BaseUnitTest
         super(name);
     }
 
-    @Override
+    @Before
     public void setUp() throws Exception
     {
         super.setUp();
         factoryService = (FactoryService) this.resolve( FactoryService.class.getName() );
-
     }
-    /*
+    
+    /**
      * Class to test for Object getInstance(String)
+     * @throws Exception if factory fails to generate object
      */
+    @Test
     public void testGetInstanceString() throws Exception
     {
         Object object = factoryService.getInstance("java.lang.StringBuilder");
         assertTrue(object instanceof StringBuilder);
     }
-    /*
+    
+    /**
      * Class to test for Object getInstance(String, ClassLoader)
+     *
+     * @throws Exception Generic exception
      */
+    @Test
     public void testGetInstanceStringClassLoader() throws Exception
     {
         Object object = factoryService.getInstance("java.lang.StringBuilder", StringBuilder.class.getClassLoader());
         assertTrue(object instanceof StringBuilder);
     }
-    /*
+    
+    /**
      * Class to test for Object getInstance(String, Object[], String[])
+     * @throws Exception Generic exception
      */
+    @Test
     public void testGetInstanceStringObjectArrayStringArray() throws Exception
     {
-        Object params[] = new Object[1];
-        String sourceValue = "testing";
-        params[0] = sourceValue;
-        String signature[] = new String[1];
-        signature[0] = "java.lang.String";
+    	String sourceValue = "testing";
+    	Object params[] = new Object[] { sourceValue };
+        String signature[] = new String[] { "java.lang.String" };
+
         Object object = factoryService.getInstance("java.lang.StringBuilder", params, signature);
         assertTrue(object instanceof StringBuilder);
         assertEquals(sourceValue, object.toString());
-
     }
-    /*
+    
+    /**
      * Class to test for Object getInstance(String, ClassLoader, Object[], String[])
-     */
+     * 
+     * @throws Exception Generic exception
+     */    
+    @Test
     public void testGetInstanceStringClassLoaderObjectArrayStringArray() throws Exception
     {
-        Object params[] = new Object[1];
-        String sourceValu = "testing";
-        params[0] = sourceValu;
-        String signature[] = new String[1];
-        signature[0] = "java.lang.String";
+    	String sourceValue = "testing";
+    	Object params[] = new Object[] { sourceValue };
+        String signature[] = new String[] { "java.lang.String" };
+
         Object object =
             factoryService.getInstance(
                 "java.lang.StringBuilder",
@@ -97,7 +113,7 @@ public class FactoryServiceTest extends BaseUnitTest
                 params,
                 signature);
         assertTrue(object instanceof StringBuilder);
-        assertEquals(sourceValu, object.toString());
+        assertEquals(sourceValue, object.toString());
 
     }
     
@@ -106,19 +122,26 @@ public class FactoryServiceTest extends BaseUnitTest
      * 
      * @throws Exception Generic exception
      */
+    @Test
     public void testIsLoaderSupported() throws Exception
     {
         // TODO Need to run a test where the loader is NOT supported.
         assertTrue(factoryService.isLoaderSupported("java.lang.String"));
     }
     
+
+    /**
+     * Test get signature
+     * 
+     * @throws Exception Generic exception
+     */
+    @Test
     public void testGetSignature() throws Exception
     {
-        Object params[] = new Object[1];
-        String sourceValu = "testing";
-        params[0] = sourceValu;
-        String signature[] = new String[1];
-        signature[0] = "java.lang.String";
+    	String sourceValue = "testing";
+    	Object params[] = new Object[] { sourceValue };
+        String signature[] = new String[] { "java.lang.String" };
+
         Class<?>[] results = factoryService.getSignature(StringBuilder.class, params, signature);
         assertEquals(1, results.length);
         assertTrue(results[0].equals(String.class));
diff --git a/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java b/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
index d8010a1..e533e03 100644
--- a/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
+++ b/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java
@@ -22,31 +22,50 @@ package org.apache.fulcrum.factory.utils;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.ObjectOutputStream;
-import junit.framework.TestCase;
+
+import org.apache.fulcrum.testcontainer.BaseUnitTest;
+import org.junit.Test;
 
 /**
- * @author Eric Pugh
+ * Basic test for object input stream for fulcrum factory
+ * 
+ * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
+ * @version $Id$ 
  */
-public class ObjectInputStreamForContextTest extends TestCase
+public class ObjectInputStreamForContextTest extends BaseUnitTest
 {
-    public static void main(String[] args)
+	 
+    /**
+     * Defines the testcase name for JUnit.
+     *
+     * @param name the testcase's name.
+     */
+    public ObjectInputStreamForContextTest(String name)
     {
-        junit.textui.TestRunner.run(ObjectInputStreamForContextTest.class);
+        super(name);
     }
-    /*
+	
+    /**
+     * 
      * Class to test for void ObjectInputStreamForContext(InputStream, ClassLoader)
+     * 
+     * @throws Exception generic exception
      */
+    @Test
     public void testObjectInputStreamForContextInputStreamClassLoader() throws Exception
     {
         Object object = new String("I am testing");
         Object object2 = null;
+        
         ByteArrayOutputStream bout = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream(bout);
         out.writeObject(object);
         out.flush();
+        
         ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
         ObjectInputStreamForContext in = new ObjectInputStreamForContext(bin, String.class.getClassLoader());
         object2 = in.readObject();
+        
         assertEquals(object.toString(), object2.toString());
         assertEquals(object, object2);
     }

[turbine-fulcrum-factory] 03/49: (Hopefully) improve documentation

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 34a461d99660c7045b95f4ae7dcfda6a1e6594a9
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Tue Aug 5 16:32:32 2008 +0000

    (Hopefully) improve documentation
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@682777 13f79535-47bb-0310-9956-ffa450edef68
---
 xdocs/index.xml | 115 ++++++++++++++++++++++++++++++++++----------------------
 xdocs/tasks.xml |   2 +-
 2 files changed, 72 insertions(+), 45 deletions(-)

diff --git a/xdocs/index.xml b/xdocs/index.xml
index 74e7d09..b17ff14 100644
--- a/xdocs/index.xml
+++ b/xdocs/index.xml
@@ -22,7 +22,8 @@
 
   <properties>
     <title>Factory Component</title>
-    <author email="epugh@upstate.com">Eric PUgh</author>
+    <author email="epugh@upstate.com">Eric Pugh</author>
+    <author email="tv@apache.org">Thomas Vandahl</author>
   </properties>
 
   <body>
@@ -47,42 +48,72 @@ The service provides the following benefits compared to Class.forName():
   </section>
 
 <section name="Configuration">
-
-    <p>
-      First, here is the role configuration.
-    </p>
-
-<source>
-<![CDATA[
-   <role
+    <subsection name="Role Configuration">
+      <source><![CDATA[
+    <role
         name="org.apache.fulcrum.factory.FactoryService"
         shorthand="factory"
         default-class="org.apache.fulcrum.factory.DefaultFactoryService"/>
-]]>
-</source>
-
-  <p>
-    There is configuration values for classloaders, still need to add.
-  </p>
-<source>
-
-<![CDATA[
-    <factory/>
-]]>
-</source>
-
+      ]]></source>
+    </subsection>
+
+    <subsection name="Component Configuration">
+      <table>
+        <tr>
+          <th>Item</th>
+          <th>Datatype</th>
+          <th>Cardinality</th>
+          <th>Description</th>
+        </tr>
+        <tr>
+          <td>classloader</td>
+          <td>String</td>
+          <td>[0..n]</td>
+          <td>
+            A class loader. Class loaders will be tried in sequence when
+            trying to create an object instance.
+          </td>
+        </tr>
+        <tr>
+          <td>object-factory</td>
+          <td>Complex</td>
+          <td>[0|1]</td>
+          <td>
+            The parent element for object factories. Sub-elements define
+            factories for certain class names. You can define one
+            <code>default</code> factory that will be used if no others
+            match. See the configuration example below.
+          </td>
+        </tr>
+      </table>
+    </subsection>
+
+    <subsection name="Component Configuration Example">
+      <source><![CDATA[
+    <factory>
+        <classloader>java.net.URLClassLoader</classloader>
+        <object-factory>
+            <javax.xml.parsers.DocumentBuilder>
+                org.foo.xml.DomBuilderFactory
+            </javax.xml.parsers.DocumentBuilder>
+            <default>
+                org.some.default.Factory
+            </default>
+        </object-factory>
+    </factory>
+      ]]></source>
+    </subsection>
   </section>
 
   <section name="Usage">
+    <p>
+      In Turbine, the Factory Service is currently only used internally by the Pool Service.
+      Applications can also use the service instead of Class.forName() and for unifying
+      initialization, configuration and access to vendor specific object factories.
+      The following is a simplified example of a customized DOM parser factory:
+    </p>
 
-<p>
-In Turbine, the Factory Service is currently only used internally by the Pool Service.
-Applications can also use the service instead of Class.forName() and for unifying
-initialization, configuration and access to vendor specific object factories.
-The following is a simplified example of a customized DOM parser factory:
-</p>
-
-<source><![CDATA[
+    <source><![CDATA[
 package org.foo.xml;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -170,22 +201,19 @@ public class DomBuilderFactory implements Factory
 }
 ]]></source>
 
-<p>
-The customized DOM parser factory must be specified in Turbine Resources before it can be used:
-</p>
-
-<source><![CDATA[
-services.FactoryService.factory.javax.xml.parsers.DocumentBuilder=org.foo.xml.DomBuilderFactory
-]]></source>
+    <p>
+      The customized DOM parser factory must be specified in the component 
+      configuration like in the configuration example above before it can 
+      be used.
+    </p>
 
-<p>
-A DOM parser can now be instantiated with the following code fragment:
-</p>
+    <p>
+    A DOM parser can now be instantiated with the following code fragment:
+    </p>
 
-<source><![CDATA[
+    <source><![CDATA[
 // Access the service singleton.
-FactoryService service = (FactoryService)
-    TurbineServices.getInstance().getService(FactoryService.SERVICE_NAME);
+FactoryService service = (FactoryService)container.lookup(FactoryService.ROLE);
 
 // Create a new DOM parser.
 DocumentBuilder parser =
@@ -193,6 +221,5 @@ DocumentBuilder parser =
 ]]></source>
 
   </section>
-
 </body>
 </document>
diff --git a/xdocs/tasks.xml b/xdocs/tasks.xml
index a8572e6..28a83f2 100644
--- a/xdocs/tasks.xml
+++ b/xdocs/tasks.xml
@@ -34,7 +34,7 @@
        <p>
           <ul>
            <li>
-              Need to test using the configuratio values.  Currently it just uses the default Classloader.
+              Need to test using the configuration values.  Currently it just uses the default Classloader.
             </li>
            <li>
               Document using different classloaders.

[turbine-fulcrum-factory] 47/49: - update most Fulcrum parent to version 8 and update Fulcrum site + use md format for README

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 5dcdccee6f2dd5ad99c9718d28aa08634b2bf4f9
Author: Georg Kallidis <gk...@apache.org>
AuthorDate: Wed Apr 28 10:31:09 2021 +0000

    - update most Fulcrum parent to version 8 and update Fulcrum site + use md format for README
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1889262 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 541a093..fc1d1cd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <artifactId>turbine-parent</artifactId>
        <groupId>org.apache.turbine</groupId>
-       <version>7</version>
+       <version>8</version>
        <relativePath />
   </parent>
 

[turbine-fulcrum-factory] 34/49: Wrapping up a few more findbug complaints

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-factory.git

commit 76ad66d3fd9604e919e96e1226c996aba612b448
Author: Jeffery Painter <pa...@apache.org>
AuthorDate: Mon Oct 8 15:57:04 2018 +0000

    Wrapping up a few more findbug complaints
    
    git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/factory@1843165 13f79535-47bb-0310-9956-ffa450edef68
---
 src/java/org/apache/fulcrum/factory/DefaultFactoryService.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
index 221f65f..8d4a361 100644
--- a/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
+++ b/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java
@@ -69,10 +69,9 @@ public class DefaultFactoryService
     /**
      * Primitive classes for reflection of constructors.
      */
-    private static HashMap<String, Class<?>> primitiveClasses;
+    private static HashMap<String, Class<?>> primitiveClasses = new HashMap<String, Class<?>>(8);
 
     {
-        primitiveClasses = new HashMap<String, Class<?>>(8);
         primitiveClasses.put(Boolean.TYPE.toString(), Boolean.TYPE);
         primitiveClasses.put(Character.TYPE.toString(), Character.TYPE);
         primitiveClasses.put(Byte.TYPE.toString(), Byte.TYPE);