Author: painter Date: Thu Oct 25 15:33:42 2018 New Revision: 1844842 URL: http://svn.apache.org/viewvc?rev=1844842&view=rev Log: Fix JavaDocs for factory
Modified: turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryException.java turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryService.java turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java Modified: turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java?rev=1844842&r1=1844841&r2=1844842&view=diff ============================================================================== --- turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java (original) +++ turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/DefaultFactoryService.java Thu Oct 25 15:33:42 2018 @@ -39,33 +39,37 @@ import org.apache.fulcrum.factory.utils. * 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:ep...@upstate.com">Eric Pugh</a> * @author <a href="mailto:ilkka.pr...@simsoft.fi">Ilkka Priha</a> * @author <a href="mailto:mcconn...@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 Modified: turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryException.java URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryException.java?rev=1844842&r1=1844841&r2=1844842&view=diff ============================================================================== --- turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryException.java (original) +++ turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryException.java Thu Oct 25 15:33:42 2018 @@ -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 Ex } /** - * @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 Ex } /** - * @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 Ex } /** - * @see java.lang.Exception(String) + * {@link java.lang.Exception#Exception(String)} + * @param msg the message to bubble up */ public FactoryException(String msg) { Modified: turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryService.java URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryService.java?rev=1844842&r1=1844841&r2=1844842&view=diff ============================================================================== --- turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryService.java (original) +++ turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/FactoryService.java Thu Oct 25 15:33:42 2018 @@ -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. Modified: turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java?rev=1844842&r1=1844841&r2=1844842&view=diff ============================================================================== --- turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java (original) +++ turbine/fulcrum/trunk/factory/src/java/org/apache/fulcrum/factory/utils/ObjectInputStreamForContext.java Thu Oct 25 15:33:42 2018 @@ -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 */ 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 } /** - * @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 Modified: turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java?rev=1844842&r1=1844841&r2=1844842&view=diff ============================================================================== --- turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java (original) +++ turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/FactoryServiceTest.java Thu Oct 25 15:33:42 2018 @@ -28,8 +28,6 @@ import org.apache.fulcrum.testcontainer. * @author Eric Pugh * @author <a href="mailto:mcconn...@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 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]; Modified: turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java?rev=1844842&r1=1844841&r2=1844842&view=diff ============================================================================== --- turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java (original) +++ turbine/fulcrum/trunk/factory/src/test/org/apache/fulcrum/factory/utils/ObjectInputStreamForContextTest.java Thu Oct 25 15:33:42 2018 @@ -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)